41861d25a94c0578853ae4280d195d7d8ca2fcb4
kate
  Mon Mar 21 17:17:46 2016 -0700
Add version awareness to tissue handling. refs #15645

diff --git src/hg/lib/gtexInfo.c src/hg/lib/gtexInfo.c
index ed99419..517e3d6 100644
--- src/hg/lib/gtexInfo.c
+++ src/hg/lib/gtexInfo.c
@@ -177,30 +177,38 @@
 {
 char query[1024];
 
 sqlSafef(query, sizeof(query),
 "CREATE TABLE %s (\n"
 "    version varchar(255) not null,	# GTEX data release (e.g. V4, V6)\n"
 "    releaseDate varchar(255) not null,	# Release date\n"
 "    maxScore double not null,	# Maximum score observed (use to scale display)\n"
 "    maxMedianScore double not null,	# Maximum score observed for a tissue median (use to scale display)\n"
 "        #Indices\n"
 "    PRIMARY KEY(version)\n"
 ")\n",   table);
 sqlRemakeTable(conn, table, query);
 }
 
+char *gtexVersionSuffix(char *table)
+/* Return version string for a GTEx track table.  For now, just supporting V4 and V6 (default, no suffix )*/                                        
+{
+if (endsWith(table, "V4"))
+    return("V4");
+return("");
+}
+
 char *gtexVersion(char *table)
 /* Return version string based on table suffix */
 {
 char *suffix = gtexVersionSuffix(table);
 // Currently the V4 tables have no suffix
 return (sameString(suffix, "")) ? GTEX_DEFAULT_VERSION : suffix;
 }
 
 double gtexMaxMedianScore(char *version)
 /* Retrieve max median score for latest (or named) version */
 {
 char query[1024];
 struct sqlConnection *conn = hAllocConn("hgFixed");
 if (!conn)
     return 0;