src/hg/instinct/lib/hgHeatmapLib.c 1.67

1.67 2010/03/11 19:38:48 jsanborn
fixed getHeatmaps to look at two databases
Index: src/hg/instinct/lib/hgHeatmapLib.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/lib/hgHeatmapLib.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -b -B -U 4 -r1.66 -r1.67
--- src/hg/instinct/lib/hgHeatmapLib.c	10 Mar 2010 22:55:20 -0000	1.66
+++ src/hg/instinct/lib/hgHeatmapLib.c	11 Mar 2010 19:38:48 -0000	1.67
@@ -156,13 +156,19 @@
 }
 
 
 /* Get heatmap using database, tableName */
-struct genoHeatmap *getHeatmap(struct sqlConnection *conn, char *database, char *tableName, 
-			       struct hash *raHash)
+struct genoHeatmap *getHeatmap(struct sqlConnection *localConn, struct sqlConnection *publicConn, 
+			       char *database, char *tableName, struct hash *raHash)
 {
-if (!sqlTableExists(conn, tableName))
+struct sqlConnection *conn = localConn;
+if (!sqlTableExists(localConn, tableName))
+    { /* check if table exists on public database */
+    if (publicConn && sqlTableExists(publicConn, tableName))
+	conn = publicConn;
+    else
     return NULL;
+    }
 
 /* Connect to database on local host */
 struct genoHeatmap *gh = AllocVar(gh);