Index: src/hg/hgTables/wiggle.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/wiggle.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -b -B -U 4 -r1.72 -r1.73
--- src/hg/hgTables/wiggle.c	10 Apr 2009 20:04:30 -0000	1.72
+++ src/hg/hgTables/wiggle.c	20 May 2009 20:59:57 -0000	1.73
@@ -34,9 +34,9 @@
  */
 #define WIG_INIT \
 if (isCustomTrack(table)) \
     { \
-    ct = lookupCt(table); \
+    ct = ctLookupName(table); \
     isCustom = TRUE; \
     if (! ct->wiggle) \
 	errAbort("called to work on a custom track '%s' that isn't wiggle data ?", table); \
  \
@@ -520,9 +520,9 @@
 	    wds->setSpanConstraint(wds,spanConstraint);
 	else
 	    {
 	    struct sqlConnection *trashConn = hAllocConn(CUSTOM_TRASH);
-	    struct trackDb *tdb = findTdbForTable(database, curTrack, table);
+	    struct trackDb *tdb = findTdbForTable(database, curTrack, table, ctLookupName);
 	    unsigned span = minSpan(trashConn, splitTableOrFileName,
 		region->chrom, region->start, region->end, cart, tdb);
 	    wds->setSpanConstraint(wds, span);
 	    hFreeConn(&trashConn);
@@ -543,9 +543,9 @@
 	{
 	/* XXX TBD, watch for a span limit coming in as an SQL filter */
 	if (intersectBedList)
 	    {
-	    struct trackDb *tdb = findTdbForTable(database, curTrack, table);
+	    struct trackDb *tdb = findTdbForTable(database, curTrack, table, ctLookupName);
 	    unsigned span;
 	    span = minSpan(conn, splitTableOrFileName, region->chrom,
 		region->start, region->end, cart, tdb);
 	    wds->setSpanConstraint(wds, span);
@@ -698,9 +698,9 @@
     {
     struct trackDb *tdb;
     if (isCustomTrack(table))
         {
-        struct customTrack *ct = lookupCt(table);
+        struct customTrack *ct = ctLookupName(table);
         tdb = ct->tdb;
         conn = hAllocConn(CUSTOM_TRASH);
         }
     else
@@ -773,9 +773,9 @@
 if (db != NULL && table != NULL)
     {
     if (isCustomTrack(table))
 	{
-	struct customTrack *ct = lookupCt(table);
+	struct customTrack *ct = ctLookupName(table);
 	if (ct != NULL && ct->wiggle)
 	    typeWiggle = TRUE;
 	}
     else
@@ -790,9 +790,9 @@
 boolean isBedGraph(char *table)
 /* Return TRUE if table is specified as a bedGraph in the current database's
  * trackDb. */
 {
-return trackIsType(table, "bedGraph");
+return trackIsType(database, table, NULL, "bedGraph", ctLookupName);// Do we need to get parent track here?
 }
 
 struct bed *getWiggleAsBed(
     char *db, char *table, 	/* Database and table. */
@@ -840,9 +840,9 @@
     if (ct->dbTrack)
 	{
 	unsigned span = 0;
 	struct sqlConnection *trashConn = hAllocConn(CUSTOM_TRASH);
-	struct trackDb *tdb = findTdbForTable(database, curTrack, table);
+	struct trackDb *tdb = findTdbForTable(database, curTrack, table, ctLookupName);
 	valuesMatched = getWigglePossibleIntersection(wds, region,
 	    CUSTOM_TRASH, table2, &intersectBedList,
 		splitTableOrFileName, operations);
 	span = minSpan(trashConn, splitTableOrFileName, region->chrom,
@@ -862,9 +862,9 @@
 	errAbort( "getWiggleAsBed: NULL conn given for database table");
 
     if (hFindSplitTable(database, region->chrom, table, splitTableOrFileName, &hasBin))
 	{
-	struct trackDb *tdb = findTdbForTable(database, curTrack, table);
+	struct trackDb *tdb = findTdbForTable(database, curTrack, table, ctLookupName);
 	unsigned span = 0;
 
 	/* XXX TBD, watch for a span limit coming in as an SQL filter */
 	span = minSpan(conn, splitTableOrFileName, region->chrom,
@@ -1023,9 +1023,9 @@
 	{
 	if (ct->dbTrack)
 	    {
 	    struct sqlConnection *trashConn = hAllocConn(CUSTOM_TRASH);
-	    struct trackDb *tdb = findTdbForTable(database, curTrack, table);
+	    struct trackDb *tdb = findTdbForTable(database, curTrack, table, ctLookupName);
 	    span = minSpan(trashConn, splitTableOrFileName, region->chrom,
 		region->start, region->end, cart, tdb);
 	    wds->setSpanConstraint(wds, span);
 	    valuesMatched = getWigglePossibleIntersection(wds, region,

