src/hg/hgTables/hgTables.c 1.191

1.191 2010/04/12 05:32:51 kent
Making all fields output work with makeItems.
Index: src/hg/hgTables/hgTables.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/hgTables.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -b -B -U 4 -r1.190 -r1.191
--- src/hg/hgTables/hgTables.c	9 Apr 2010 18:41:17 -0000	1.190
+++ src/hg/hgTables/hgTables.c	12 Apr 2010 05:32:51 -0000	1.191
@@ -1140,10 +1140,9 @@
 
 return(ret);
 }
 
-static void doTabOutDb( char *db, char *table, FILE *f,
-	struct sqlConnection *conn, char *fields)
+void doTabOutDb( char *db, char *table, FILE *f, struct sqlConnection *conn, char *fields)
 /* Do tab-separated output on fields of a single table. */
 {
 struct region *regionList = getRegions();
 struct region *region;
@@ -1265,9 +1264,9 @@
     bigBedTabOut(db, table, conn, fields, f);
 else if (isCustomTrack(table))
     {
     struct trackDb *track = findTrack(table, fullTrackList);
-    doTabOutCustomTracks(track, conn, fields, f);
+    doTabOutCustomTracks(db, track, conn, fields, f);
     }
 else
     doTabOutDb(db, table, f, conn, fields);
 }
@@ -1277,8 +1276,9 @@
 {
 char dtBuf[256];
 struct sqlConnection *conn;
 struct slName *fieldList = NULL, *dtfList = NULL, *field, *dtf;
+// uglyAbort("fullTableFields(db=%s, table=%s, isCustomTrack=%d)", db, table, isCustomTrack(table));
 if (hIsBigBed(database, table, curTrack, ctLookupName))
     {
     conn = hAllocConn(db);
     fieldList = bigBedGetFields(table, conn);
@@ -1286,20 +1286,19 @@
     }
 else if (isCustomTrack(table))
     {
     struct customTrack *ct = ctLookupName(table);
-    if ((ct!= NULL) && (ct->dbTrackType != NULL) &&
-	    sameString(ct->dbTrackType, "maf"))
+    char *type = ct->dbTrackType;
+    if (type != NULL)
 	{
 	conn = hAllocConn(CUSTOM_TRASH);
+	if (startsWithWord("maf", type) || startsWithWord("makeItems", type))
 	fieldList = sqlListFields(conn, ct->dbTableName);
 	hFreeConn(&conn);
 	}
-    else
-	{
+    if (fieldList == NULL)
 	fieldList = getBedFields(ct->fieldCount);
 	}
-    }
 else
     {
     char *splitTable;
     dbOverrideFromTable(dtBuf, &db, &table);