624776f628c3257193e39187f02b5624d3b58b53
kate
Mon Oct 17 16:36:51 2016 -0700
Add track description. refs #17369
diff --git src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c
index 3b072a8..81bb4a5 100644
--- src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c
+++ src/hg/hgGtexTrackSettings/hgGtexTrackSettings.c
@@ -1,160 +1,182 @@
/* hgGtexTrackSettings: Configure GTEx track
*
* Copyright (C) 2016 The Regents of the University of California
*/
#include "common.h"
#include "cart.h"
#include "cartJson.h"
#include "cheapcgi.h"
#include "errCatch.h"
#include "googleAnalytics.h"
#include "hCommon.h"
#include "hgConfig.h"
#include "hdb.h"
#include "htmshell.h"
#include "hubConnect.h"
#include "hui.h"
#include "jsHelper.h"
#include "jsonParse.h"
#include "obscure.h" // for readInGulp
#include "regexHelper.h"
#include "suggest.h"
#include "trackHub.h"
#include "trix.h"
#include "web.h"
#include "gtexInfo.h"
#include "gtexTissue.h"
/* Global Variables */
struct cart *cart = NULL; /* CGI and other variables */
struct hash *oldVars = NULL; /* Old contents of cart before it was updated by CGI */
+char *db = NULL;
static void doCartJson()
/* Perform UI commands to update the cart and/or retrieve cart vars & metadata. */
{
struct cartJson *cj = cartJsonNew(cart);
//e.g. cartJsonRegisterHandler(cj, "setTaxId", setTaxId);
cartJsonExecute(cj);
}
static void doJsIncludes()
/* Include JS libraries. From hgGateway (think about libifying) */
{
//puts("");
//puts("");
//puts("");
puts("");
webIncludeResourceFile("jquery-ui.css");
jsIncludeFile("jquery-ui.js", NULL);
jsIncludeFile("jquery.watermarkinput.js", NULL);
jsIncludeFile("utils.js",NULL);
}
+static void printTrackDescription()
+{
+puts("
Track Description
");
+puts("");
+struct sqlConnection *conn = sqlConnect(db);
+char query[256];
+sqlSafef(query, sizeof(query), "select html from trackDb where tableName='gtexGene'");
+char *html = sqlQuickString(conn, query);
+sqlDisconnect(&conn);
+puts("
");
+puts("
");
+puts(html);
+puts("
");
+puts("");
+}
+
static void printTissueTable(char *version)
/* Output HTML with tissue labels and colors, in 2 columns, to fit next to body map */
{
struct gtexTissue *tis, *tissues = gtexGetTissues(version);
struct gtexTissue **tisTable = NULL;
int count = slCount(tissues);
AllocArray(tisTable, count);
int i=0, col=0;
int cols = 2;
int last = count/2 + 1;
puts("
");
puts("
");
for (tis = tissues; tis != NULL; tis = tis->next)
{
if (tis->id < last)
i = tis->id * 2;
else
i = (tis->id - last) * 2 + 1;
tisTable[i] = tis;
}
for (i=0; i"
"