src/hg/hgTables/custom.c 1.46

1.46 2010/04/13 05:51:25 kent
Improving BED output for makeItems.
Index: src/hg/hgTables/custom.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/custom.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -b -B -U 4 -r1.45 -r1.46
--- src/hg/hgTables/custom.c	13 Apr 2010 04:42:00 -0000	1.45
+++ src/hg/hgTables/custom.c	13 Apr 2010 05:51:25 -0000	1.46
@@ -459,9 +459,9 @@
 	}
     }
 }
 
-struct bed *customTrackGetFilteredBeds(char *name, struct region *regionList,
+struct bed *customTrackGetFilteredBeds(char *db, char *name, struct region *regionList,
 	struct lm *lm, int *retFieldCount)
 /* Get list of beds from custom track of given name that are
  * in current regions and that pass filters.  You can bedFree
  * this when done. */
@@ -474,10 +474,19 @@
 int fieldCount;
 
 if (ct == NULL)
     errAbort("Can't find custom track %s", name);
+char *type = ct->dbTrackType;
 
-if (ct->wiggle)
+if (type != NULL && startsWithWord("makeItems", type))
+    {
+    struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH);
+    bedList = dbGetFilteredBedsOnRegions(conn, CUSTOM_TRASH, db, ct->dbTableName, name,
+    	regionList, lm, retFieldCount);
+    hFreeConn(&conn);
+    fieldCount = 9;
+    }
+else if (ct->wiggle)
     {
     struct bed *wigBedList = NULL, *bed;
 
     /* Grab filtered beds for each region. */
@@ -498,9 +507,9 @@
     /* Figure out how to filter things. */
     fieldCount = ct->fieldCount;
     bf = bedFilterForCustomTrack(name);
     if (ct->fieldCount > 3)
-	idHash = identifierHash(database, name);
+	idHash = identifierHash(db, name);
 
     /* Grab filtered beds for each region. */
     for (region = regionList; region != NULL; region = region->next)
 	customTrackFilteredBedOnRegion(region, ct, idHash, bf, lm, &bedList);