");
struct sqlConnection *conn = sqlConnect(db);
+if (conn == NULL)
+ errAbort("Can't connect to database %s\n", db);
char query[256];
sqlSafef(query, sizeof(query), "select html from trackDb where tableName='gtexGene'");
char *html = sqlQuickString(conn, query);
-sqlDisconnect(&conn);
+if (html != NULL)
+ {
puts("
");
puts("
");
puts(html);
+ }
+sqlDisconnect(&conn);
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;
@@ -108,31 +113,37 @@
if (col > cols-1)
{
puts("\n
");
col = 0;
}
}
puts("
\n");
puts("");
}
static void doMainPage()
/* Send HTML with javascript to bootstrap the user interface. */
{
// Start web page with new banner
char *genome = NULL, *clade = NULL;
-getDbGenomeClade(cart, &db, &genome, &clade, oldVars);
+//getDbGenomeClade(cart, &db, &genome, &clade, oldVars);
+
+/* hardcode for now -- later, check for hg19 or hg38 */
+
+db = "hg19";
+genome = "human";
+clade = "mammal";
// char *chromosome = cartUsualString(cart, "c", hDefaultChrom(database));
//char *track = cartString(cart, "g");
webStartJWestNoBanner(cart, db, "Genome Browser GTEx Track Settings");
puts("");
puts("");
// The initial visible page elements are hgGtexTrackSettings.html,
// which is transformed into a quoted .h
// file containing a string constant that we #include and print here (see makefile).
puts(
#include "hgGtexTrackSettings.html.h"
);
@@ -144,31 +155,31 @@
printTissueTable(gtexVersion(table));
puts("");
printTrackDescription();
puts("");
// end panel, section and body layout container
// Track description
// JS libraries
doJsIncludes();
// Main JS
-puts("");
+puts("");
webIncludeFile("inc/jWestFooter.html");
webEndJWest();
}
void doMiddle(struct cart *theCart)
/* Display the main page or execute a command and update the page */
{
cart = theCart;
if (cgiOptionalString(CARTJSON_COMMAND))
doCartJson();
else
doMainPage();