008c1354e9fce6bef2c4d494a1afc8f22b92c56a
kate
  Fri Jun 8 11:43:29 2018 -0700
Add links to GTEx body map page: hgGene details, hgc for GTEx tracks, gene sorter column info. refs #18628

diff --git src/hg/hgc/gtexEqtlClusterClick.c src/hg/hgc/gtexEqtlClusterClick.c
index 219cee7..eab1b1c 100644
--- src/hg/hgc/gtexEqtlClusterClick.c
+++ src/hg/hgc/gtexEqtlClusterClick.c
@@ -1,26 +1,27 @@
 /* Details page for GTEx eQTL Clusters */
 
 /* Copyright (C) 2017 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 
 #include "common.h"
 #include "hCommon.h"
 #include "web.h"
 #include "gtexTissue.h"
 #include "gtexInfo.h"
 #include "gtexEqtlCluster.h"
+#include "gtexUi.h"
 #include "hgc.h"
 
 static struct gtexEqtlCluster *getGtexEqtl(char *item, char *chrom, int start, int end, char *table)
 /* Retrieve this item from the track table */
 {
 char *gene = firstWordInLine(cloneString(item));
 struct sqlConnection *conn = hAllocConn(database);
 struct gtexEqtlCluster *eqtls = NULL, *eqtl;
 char **row;
 int offset;
 char where[512];
 sqlSafefFrag(where, sizeof(where), "target='%s'", gene);
 struct sqlResult *sr = hRangeQuery(conn, table, chrom, start, end, where, &offset); 
 while ((row = sqlNextRow(sr)) != NULL)
     {
@@ -158,30 +159,33 @@
     }
 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);
+hFreeConn(&conn);
 
 // print link to GTEx portal
 printf("<br><a target='_blank' href='https://www.gtexportal.org/home/bubbleHeatmapPage/%s'>"
         "View eQTL Visualizer for this gene at the GTEx Portal<a>\n", 
                 geneName);
-hFreeConn(&conn);
+
+hPrintf("&nbsp;&nbsp;&nbsp;&nbsp;");
+gtexBodyMapLink();
 
 printClusterDetails(eqtl, tdb->table);
 
 webNewEmptySection();
 printTrackHtml(tdb);
 }