src/hg/lib/hui.c 1.211

1.211 2009/06/12 15:52:22 hiram
Fixup chainCfgUi to work properly on split table names
Index: src/hg/lib/hui.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hui.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -b -B -U 4 -r1.210 -r1.211
--- src/hg/lib/hui.c	10 Jun 2009 23:27:08 -0000	1.210
+++ src/hg/lib/hui.c	12 Jun 2009 15:52:22 -0000	1.211
@@ -2830,9 +2830,9 @@
     case cfgWigMaf:     wigMafCfgUi(cart,tdb,prefix,title,boxed, db);
                         break;
     case cfgGenePred:   genePredCfgUi(cart,tdb,prefix,title,boxed);
                         break;
-    case cfgChain:      chainCfgUi(db,cart,tdb,prefix,title,boxed);
+    case cfgChain:      chainCfgUi(db,cart,tdb,prefix,title,boxed, NULL);
                         break;
     case cfgNetAlign:	netAlignCfgUi(db,cart,tdb,prefix,title,boxed);
                         break;
     default:            warn("Track type is not known to multi-view composites.");
@@ -3642,9 +3642,9 @@
 
 cfgEndBox(boxed);
 }
 
-void chainCfgUi(char *db, struct cart *cart, struct trackDb *tdb, char *prefix, char *title, boolean boxed)
+void chainCfgUi(char *db, struct cart *cart, struct trackDb *tdb, char *prefix, char *title, boolean boxed, char *chromosome)
 /* Put up UI for chain tracks */
 {
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 
@@ -3657,15 +3657,23 @@
 boolean normScoreAvailable = FALSE;
 
 if (! compositeLevel)
     {
+    if (chromosome)
+	{
+	if (chainDbNormScoreAvailable(db, chromosome, tdb->tableName, NULL))
+	    normScoreAvailable = TRUE;
+	}
+    else
+	{
     // This will not work if tableName is a split table, we don't know
     //	the chromosome at this point here
     struct sqlConnection *conn = hAllocConn(db);
     int tblIx = sqlFieldIndex(conn, tdb->tableName, "normScore");
     normScoreAvailable = (tblIx > -1) ? TRUE : FALSE;
     hFreeConn(&conn);
     }
+    }
 else
     {
     char * colorOptionType =
      trackDbSettingClosestToHomeOrDefault(tdb, "chainNormScoreAvailable", "no");