src/hg/lib/wiggleUtils.c 1.51
1.51 2009/08/20 23:34:49 braney
if no spanList is specified in trackDb, build list by choosing first span in the table rather than trying to find all the spans. This is the same behavior as adding "spanList first" to the trackDb for over 500 tables.
Index: src/hg/lib/wiggleUtils.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/wiggleUtils.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -b -B -U 4 -r1.50 -r1.51
--- src/hg/lib/wiggleUtils.c 14 Jan 2009 18:59:14 -0000 1.50
+++ src/hg/lib/wiggleUtils.c 20 Aug 2009 23:34:49 -0000 1.51
@@ -372,10 +372,11 @@
tdbDefault = cloneString((char *)hel->val);
}
}
}
-/* If something found, let's parse it */
-else if (sameWord("first",tdbDefault))
+/* if we still don't have a spanList, or we got "first" for spanList,
+ * make up spanList by choosing the first span we find in the table */
+if (sameWord("NONE",tdbDefault) || sameWord("first",tdbDefault))
{
char query[1024];
snprintf(query, sizeof(query), "SELECT span FROM %s limit 1", tdb->tableName );
char *tmpSpan = sqlQuickString(conn, query);
@@ -385,8 +386,9 @@
freeMem(tmpSpan);
}
else
{
+ /* If something found, let's parse it */
int i;
char *words[MAX_SPAN_COUNT];
int wc;
wc = chopCommas(tdbDefault,words);