src/hg/hgTables/hgTables.c 1.177
1.177 2009/03/17 17:24:51 kent
Simplifying some logic where code was unnecessarily distinguishing between hPrintf and fprintf(stdout - which is an issue in the Genome Browser, but not here in the Table Browser. Also enabling select fields user interface.
Index: src/hg/hgTables/hgTables.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/hgTables.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -b -B -U 4 -r1.176 -r1.177
--- src/hg/hgTables/hgTables.c 17 Mar 2009 10:13:26 -0000 1.176
+++ src/hg/hgTables/hgTables.c 17 Mar 2009 17:24:51 -0000 1.177
@@ -1255,9 +1255,11 @@
void doTabOutTable( char *db, char *table, FILE *f, struct sqlConnection *conn, char *fields)
/* Do tab-separated output on fields of a single table. */
{
-if (isCustomTrack(table))
+if (isBigBed(table))
+ bigBedTabOut(table, conn, fields, f);
+else if (isCustomTrack(table))
{
struct trackDb *track = findTrack(table, fullTrackList);
doTabOutCustomTracks(track, conn, fields, f);
}
@@ -1270,9 +1272,15 @@
{
char dtBuf[256];
struct sqlConnection *conn;
struct slName *fieldList = NULL, *dtfList = NULL, *field, *dtf;
-if (isCustomTrack(table))
+if (isBigBed(table))
+ {
+ conn = hAllocConn(db);
+ fieldList = bigBedGetFields(table, conn);
+ hFreeConn(&conn);
+ }
+else if (isCustomTrack(table))
{
struct customTrack *ct = lookupCt(table);
if ((ct!= NULL) && (ct->dbTrackType != NULL) &&
sameString(ct->dbTrackType, "maf"))
@@ -1289,13 +1297,13 @@
else
{
char *splitTable;
dbOverrideFromTable(dtBuf, &db, &table);
- conn = sqlConnect(db);
+ conn = hAllocConn(db);
splitTable = chromTable(conn, table);
fieldList = sqlListFields(conn, splitTable);
freez(&splitTable);
- sqlDisconnect(&conn);
+ hFreeConn(&conn);
}
for (field = fieldList; field != NULL; field = field->next)
{
char buf[256];