d09b392333a2f5d2f943f2f36dad4be0a477381e
kate
  Thu Sep 14 13:55:37 2017 -0700
Add pvalue and TSS distance for each eQTL. Input from Casey Brown, U Penn. refs #15646

diff --git src/hg/hgc/gtexEqtlClusterClick.c src/hg/hgc/gtexEqtlClusterClick.c
index f25be1f..7152e66 100644
--- src/hg/hgc/gtexEqtlClusterClick.c
+++ src/hg/hgc/gtexEqtlClusterClick.c
@@ -96,41 +96,42 @@
         posLink, end-start, FLANK);
 }
 
 static void printClusterDetails(struct gtexEqtlCluster *eqtl, char *table)
 /* Print details of an eQTL cluster */
 {
 webNewSection("eQTL Cluster Details");
 char *version = gtexVersion(table);
 struct gtexTissue *tissues = gtexGetTissues(version);
 struct hash *tissueHash = hashNew(0);
 struct gtexTissue *tis = NULL;
 for (tis = tissues; tis != NULL; tis = tis->next)
     hashAdd(tissueHash, tis->name, tis);
 printf("<table id='eqtls' cellspacing=1 cellpadding=3>\n");
 printf("<style>#eqtls th {text-align: left; background-color: #F3E0BE;}</style>");
-printf("<tr><th>&nbsp;&nbsp;&nbsp;</th><th>Tissue</th><th>Effect &nbsp;&nbsp;</th><th>Probability </th></tr>\n");
+printf("<tr><th>&nbsp;&nbsp;&nbsp;</th><th>Tissue</th><th>Effect &nbsp;&nbsp;</th><th>P-Value (-log10)</th><th>Probability </th></tr>\n");
 int i;
 for (i=0; i<eqtl->expCount; i++)
     {
     double effect = eqtl->expScores[i];
+    double pval = eqtl->expPvals[i];
     double prob = eqtl->expProbs[i];
     struct gtexTissue *tis = (struct gtexTissue *)hashFindVal(tissueHash, eqtl->expNames[i]);
     unsigned color = tis ? tis->color : 0;       // BLACK
     char *name = tis ? tis->description : "Unknown";
-    printf("<tr><td bgcolor=#%06X></td><td>%s</td><td>%s%0.2f</td><td>%0.2f</td></tr>\n", 
-                                color, name, effect < 0 ? "" : "+", effect, prob); 
+    printf("<tr><td bgcolor=#%06X></td><td>%s</td><td>%s%0.2f</td><td>%0.2f</td><td>%0.2f</td></tr>\n", 
+                                color, name, effect < 0 ? "" : "+", effect, pval, prob); 
     }
 printf("</table>");
 webEndSection();
 }
 
 void doGtexEqtlDetails(struct trackDb *tdb, char *item)
 /* Details of GTEx eQTL item */
 {
 char *chrom = cartString(cart, "c");
 int start = cartInt(cart, "o");
 int end = cartInt(cart, "t");
 struct gtexEqtlCluster *eqtl = getGtexEqtl(item, chrom, start, end, tdb->table);
 char *geneName = eqtl->target;
 
 
@@ -145,30 +146,31 @@
     printf("<a target='_blank' href='%s?db=%s&hgg_gene=%s'>%s</a><br>\n",
                         hgGeneName(), database, geneName, geneName);
     printf("<b>Description:</b> %s\n", desc);
     }
 
 // TODO: Consider adding Ensembl gene ID, GENCODE biotype and class (as in gtexGene track)
 printf("<br><b>Variant: </b>%s ", eqtl->name);
 if (startsWith("rs", eqtl->name))
     {
     printDbSnpRsUrl(eqtl->name, "dbSNP");
     printMinorAlleleFreq(eqtl->name, conn);
     printGwasCatalogTrait(eqtl->name, conn);
     }
 else
     printf("%s\n", eqtl->name);
+printf("<br><b>Distance from TSS:</b> %d\n", eqtl->distance);
 
 char posLink[1024];
 safef(posLink, sizeof posLink,"<a href='%s&db=%s&position=%s%%3A%d-%d'>%s:%d-%d</a>",
         hgTracksPathAndSettings(), database,
             eqtl->chrom, eqtl->chromStart+1, eqtl->chromEnd,
             eqtl->chrom, eqtl->chromStart+1, eqtl->chromEnd);
 printf("<br><b>Position:</b> %s\n", posLink);
 
 printf("<br><b>Score:</b> %d\n", eqtl->score);
 
 printEqtlRegion(eqtl, tdb->table, conn);
 printf("<br><b>Number of tissues with this eQTL:</b> %d\n", eqtl->expCount);
 
 // print link to GTEx portal
 printf("<br><a target='_blank' href='https://www.gtexportal.org/home/bubbleHeatmapPage/%s'>"