src/hg/hgTables/schema.c 1.60
1.60 2009/05/20 20:59:56 mikep
Libified findTdbForTable, findTypeForTable, trackIsType, hIsBigBed from hgTables so that other code can easily determine if a track is a bigBed.
Index: src/hg/hgTables/schema.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/schema.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -b -B -U 4 -r1.59 -r1.60
--- src/hg/hgTables/schema.c 10 Apr 2009 20:04:29 -0000 1.59
+++ src/hg/hgTables/schema.c 20 May 2009 20:59:56 -0000 1.60
@@ -81,9 +81,9 @@
char query[256];
struct slName *exampleList, *example;
boolean showItemRgb = FALSE;
-showItemRgb=bedItemRgb(findTdbForTable(db, curTrack, table));
+showItemRgb=bedItemRgb(findTdbForTable(db, curTrack, table, ctLookupName));
// should we expect itemRgb instead of "reserved"
safef(query, sizeof(query), "select * from %s limit 1", table);
exampleList = storeRow(conn, query);
@@ -201,9 +201,9 @@
int i, columnCount = 0;
int itemRgbCol = -1;
boolean showItemRgb = FALSE;
-showItemRgb=bedItemRgb(findTdbForTable(database, curTrack, table));
+showItemRgb=bedItemRgb(findTdbForTable(database, curTrack, table, ctLookupName));
// should we expect itemRgb instead of "reserved"
/* Make table with header row containing name of fields. */
safef(query, sizeof(query), "describe %s", table);
@@ -517,9 +517,9 @@
static void showSchemaCt(char *table)
/* Show schema on custom track. */
{
-struct customTrack *ct = lookupCt(table);
+struct customTrack *ct = ctLookupName(table);
char *type = ct->tdb->type;
if (startsWithWord("wig", type) || startsWithWord("bigWig", type))
showSchemaCtWiggle(table, ct);
else if (startsWithWord("chromGraph", type))
@@ -543,9 +543,9 @@
static void showSchema(char *db, struct trackDb *tdb, char *table)
/* Show schema to open html page. */
{
-if (isBigBed(table))
+if (hIsBigBed(database, table, curTrack, ctLookupName))
showSchemaBigBed(table);
else if (isCustomTrack(table))
showSchemaCt(table);
else if (sameWord(table, WIKI_TRACK_TABLE))