aee624ca913fe7b58e955d576a45763acdb05c08
angie
  Thu Apr 30 12:01:06 2015 -0700
Use the right autoSql for annoStreamDbFactorSource (with cellType and
treatment columns) so those extra columns can be selected/deselected from output.
refs #14579

diff --git src/hg/lib/hAnno.c src/hg/lib/hAnno.c
index ffc6016..e857a79 100644
--- src/hg/lib/hAnno.c
+++ src/hg/lib/hAnno.c
@@ -281,30 +281,34 @@
     // BED with no + fields; parse bed field count out of type line.
     int bedFieldCount = 3;
     char typeCopy[PATH_LEN];
     safecpy(typeCopy, sizeof(typeCopy), tdb->type);
     char *words[8];
     int wordCount = chopLine(typeCopy, words);
     if (wordCount > 1)
         bedFieldCount = atoi(words[1]);
     asObj = asParseText(bedAsDef(bedFieldCount, bedFieldCount));
     }
 else if (sameString(tdb->track, "knownGene"))
     {
     if (hTableExists(db, "knownGene") && hTableExists(db, "kgXref"))
         asObj = annoStreamDbKnownGeneAsObj();
     }
+else if (sameString("factorSource", tdb->type))
+    {
+    asObj = annoStreamDbFactorSourceAsObj();
+    }
 return asObj;
 }
 
 struct asObject *hAnnoGetAutoSqlForTdb(char *db, char *chrom, struct trackDb *tdb)
 /* If possible, return the asObj that a streamer for this track would use, otherwise NULL. */
 {
 struct asObject *asObj = getAutoSqlForType(db, chrom, tdb);
 
 if (!asObj && !isHubTrack(tdb->track))
     {
     // If none of the above, it must be a database table; deduce autoSql from sql fields.
     char *dataDb = db, *dbTable = tdb->table;
     if (isCustomTrack(tdb->track))
         {
         dbTable = trackDbSetting(tdb, "dbTableName");