bd5ab545fd2f8439916541d8ba0bd74f7d16e504
kent
  Tue Mar 20 15:33:58 2012 -0700
Replacing a hash that gives a tdb for a track name with one that gives tdb for a table name. Addresses redmine 7222.
diff --git src/hg/hgTables/bigWig.c src/hg/hgTables/bigWig.c
index c5ebb50..3c71787 100644
--- src/hg/hgTables/bigWig.c
+++ src/hg/hgTables/bigWig.c
@@ -12,63 +12,63 @@
 #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"
 
 boolean isBigWigTable(char *table)
 /* Return TRUE if table corresponds to a bigWig file. */
 {
-struct trackDb *tdb = hashFindVal(fullTrackAndSubtrackHash, table);
+struct trackDb *tdb = hashFindVal(fullTableToTdbHash, table);
 if (tdb)
     return tdbIsBigWig(tdb);
 else
     return trackIsType(database, table, curTrack, "bigWig", ctLookupName);
 }
 
 char *bigFileNameFromCtOrHub(char *table, struct sqlConnection *conn)
 /* If table is a custom track or hub track, return the bigDataUrl setting;
  * otherwise return NULL.  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(fullTrackAndSubtrackHash, table);
+    struct trackDb *tdb = hashFindVal(fullTableToTdbHash, table);
     assert(tdb != NULL);
     fileName = cloneString(trackDbSetting(tdb, "bigDataUrl"));
     assert(fileName != NULL);
     }
 return fileName;
 }
 
 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. */
 {
-struct trackDb *tdb = findTdbForTable(database, curTrack, table, ctLookupName);
+struct trackDb *tdb = hashMustFindVal(fullTableToTdbHash, table);
 return tdbBigFileName(conn, tdb);
 }
 
 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. */
 {
 char *chrom = region->chrom;
 int chromSize = hChromSize(database, chrom);
 struct bbiInterval *iv, *ivList = bigWigIntervalQuery(bwf, chrom, region->start, region->end, lm);
 
 /* Run filter if necessary */
 if (filterCmp != wigNoOp_e)