ef979bfff9b9e2f5c963016dcd8469cfd80b3ff6
kate
  Fri Jul 17 14:48:21 2015 -0700
Mouseover display of tissues now works a bit better.  Still fragile & messy (don't bother reviewing this commit). refs #15645

diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index f959117..f61c200 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -30,30 +30,31 @@
 #include "hPrint.h"
 #include "fileUi.h"
 #include "bigBed.h"
 #include "bigWig.h"
 #include "regexHelper.h"
 #include "snakeUi.h"
 #include "vcfUi.h"
 #include "vcf.h"
 #include "errCatch.h"
 #include "samAlignment.h"
 #include "makeItemsItem.h"
 #include "bedDetail.h"
 #include "pgSnp.h"
 #include "memgfx.h"
 #include "trackHub.h"
+#include "gtexUi.h"
 
 #define SMALLBUF 256
 #define MAX_SUBGROUP 9
 #define ADD_BUTTON_LABEL        "add"
 #define CLEAR_BUTTON_LABEL      "clear"
 #define JBUFSIZE 2048
 
 #define PM_BUTTON  "<IMG height=18 width=18 onclick=\"setCheckBoxesThatContain(" \
                    "'%s',%s,true,'%s','','%s');\" id=\"btn_%s\" src=\"../images/%s\" alt=\"%s\">\n"
 #define DEF_BUTTON "<IMG onclick=\"setCheckBoxesThatContain('%s',true,false,'%s','','%s'); " \
                    "setCheckBoxesThatContain('%s',false,false,'%s','_defOff','%s');\" " \
                    "id=\"btn_%s\" src=\"../images/%s\" alt=\"%s\">\n"
 #define DEFAULT_BUTTON(nameOrId,anc,beg,contains) \
         printf(DEF_BUTTON,(nameOrId),(beg),(contains),(nameOrId),(beg),(contains),(anc), \
               "defaults_sm.png","default")
@@ -6693,30 +6694,49 @@
 indelShowOptionsWithNameExt(cart, tdb, name, "LRG sequence", FALSE, FALSE);
 cfgEndBox(boxed);
 }
 
 void lrgTranscriptAliCfgUi(struct cart *cart, struct trackDb *tdb, char *name, char *title,
 			   boolean boxed)
 /* LRG Transcripts: Locus Reference Genomic transcript sequences mapped to assembly. */
 {
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 printf("<TABLE%s><TR><TD>",boxed?" width='100%'":"");
 baseColorDrawOptDropDown(cart, tdb);
 indelShowOptionsWithNameExt(cart, tdb, name, "LRG transcript sequence", FALSE, FALSE);
 cfgEndBox(boxed);
 }
 
+void gtexGeneUi(struct cart *cart, struct trackDb *tdb, char *name, char *title, boolean boxed)
+/* GTEx (Genotype Tissue Expression) per gene data */
+{
+boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
+printf("<TABLE%s><TR><TD>",boxed?" width='100%'":"");
+
+// Color scheme
+printf("<B>Tissue color scheme:</B>\n");
+char cartVarName[1024];
+safef(cartVarName, sizeof(cartVarName), "%s." GTEX_COLORS, name);
+char *selected = cartCgiUsualString(cart, cartVarName, GTEX_COLORS_DEFAULT); 
+boolean isGtexColors = sameString(selected, GTEX_COLORS_GTEX);
+cgiMakeRadioButton(cartVarName, GTEX_COLORS_GTEX, isGtexColors);
+printf("GTEx\n");
+cgiMakeRadioButton(cartVarName, GTEX_COLORS_RAINBOW, !isGtexColors);
+printf("rainbow\n");
+
+cfgEndBox(boxed);
+}
 
 struct trackDb *rFindView(struct trackDb *forest, char *view)
 // Return the trackDb on the list that matches the view tag. Prefers ancestors before decendents
 {
 struct trackDb *tdb;
 for (tdb = forest; tdb != NULL; tdb = tdb->next)
     {
     char *viewSetting = trackDbSetting(tdb, "view");
     if (sameOk(viewSetting, view) || sameOk(tagEncode(viewSetting), view))
         return tdb;
     }
 for (tdb = forest; tdb != NULL; tdb = tdb->next)
     {
     struct trackDb *viewTdb = rFindView(tdb->subtracks, view);
     if (viewTdb != NULL)