78dfd4b6e906a962da40780c799f92bb7ea1b3c1
kent
  Wed Jan 12 15:47:29 2011 -0800
Starting to integrate data hub into table browser.  Still problems, so effectively is commented out at the moment.
diff --git src/hg/hgTables/bigWig.c src/hg/hgTables/bigWig.c
index d3a864c..b22bd4a 100644
--- src/hg/hgTables/bigWig.c
+++ src/hg/hgTables/bigWig.c
@@ -6,51 +6,65 @@
 #include "dystring.h"
 #include "localmem.h"
 #include "jksql.h"
 #include "cheapcgi.h"
 #include "cart.h"
 #include "web.h"
 #include "bed.h"
 #include "hdb.h"
 #include "trackDb.h"
 #include "customTrack.h"
 #include "wiggle.h"
 #include "hmmstats.h"
 #include "correlate.h"
 #include "bbiFile.h"
 #include "bigWig.h"
+#include "hubConnect.h"
 #include "hgTables.h"
 
 static char const rcsid[] = "$Id: bigWig.c,v 1.7 2010/06/03 18:53:59 kent Exp $";
 
 boolean isBigWigTable(char *table)
 /* Return TRUE if table corresponds to a bigWig file. */
 {
+if (isHubTrack(table))
+    {
+    struct trackDb *tdb = hashFindVal(fullTrackHash, table);
+    return startsWithWord("bigWig", tdb->type);
+    }
+else
 return trackIsType(database, table, curTrack, "bigWig", ctLookupName);
 }
 
 char *bigWigFileName(char *table, struct sqlConnection *conn)
 /* Return file name associated with bigWig.  This handles differences whether it's
  * a custom or built-in track.  Do a freeMem on returned string when done. */
 {
 char *fileName = NULL;
 if (isCustomTrack(table))
     {
     struct customTrack *ct = ctLookupName(table);
     if (ct != NULL)
         fileName = cloneString(trackDbSetting(ct->tdb, "bigDataUrl"));
     }
+else if (isHubTrack(table))
+    {
+    struct trackDb *tdb = hashFindVal(fullTrackHash, table);
+    assert(tdb != NULL);
+    fileName = trackDbSetting(tdb, "bigDataUrl");
+    assert(fileName != NULL);
+    }
 else
     {
     char query[256];
     safef(query, sizeof(query), "select fileName from %s", table);
     fileName = sqlQuickString(conn, query);
     }
 return fileName;
 }
 
 struct bbiInterval *intersectedFilteredBbiIntervalsOnRegion(struct sqlConnection *conn, 
 	struct bbiFile *bwf, struct region *region, enum wigCompare filterCmp, double filterLl,
 	double filterUl, struct lm *lm)
 /* Get list of bbiIntervals (more-or-less bedGraph things from bigWig) out of bigWig file
  * and if necessary apply filter and intersection.  Return list which is allocated in lm. */
 {