440d84ee43c6a5f8a22bfe7886681db4ee7cc202
braney
  Thu Aug 28 16:55:27 2014 -0700
adding more support for bigGenePred in hgc and hgTables.
diff --git src/hg/lib/hgSeq.c src/hg/lib/hgSeq.c
index 366bbf8..5b53b0e 100644
--- src/hg/lib/hgSeq.c
+++ src/hg/lib/hgSeq.c
@@ -2,30 +2,31 @@
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 #include "common.h"
 #include "dnautil.h"
 #include "dnaseq.h"
 #include "cart.h"
 #include "cheapcgi.h"
 #include "hdb.h"
 #include "web.h"
 #include "rmskOut.h"
 #include "fa.h"
 #include "genePred.h"
 #include "bed.h"
 #include "hgSeq.h"
+#include "trackHub.h"
 
 
 int hgSeqChromSize(char *db, char *chromName)
 /* get chrom size if there's a database out there,
  * otherwise just return 0 */
 {
 int thisSize = 0;
 if (hDbExists(db))
     thisSize = hChromSize(db, chromName);
 return thisSize;
 }
 
 static void hgSeqFeatureRegionOptions(struct cart *cart, boolean canDoUTR,
 			       boolean canDoIntrons)
 /* Print out HTML FORM entries for feature region options. */
@@ -217,31 +218,38 @@
 /* Print out HTML FORM entries for gene region and sequence display options.
  * Use defaults from CGI. */
 {
 hgSeqOptionsHtiCart(hti, NULL);
 }
 #endif /* NEVER */
 
 
 void hgSeqOptions(struct cart *cart, char *db, char *table)
 /* Print out HTML FORM entries for gene region and sequence display options. */
 {
 struct hTableInfo *hti;
 char chrom[32];
 char rootName[256];
 
-if ((table == NULL) || (table[0] == 0))
+if (startsWith("hub_", table))
+    {
+    // we asssume that this is a bigGenePred table if we got here with it
+    hgSeqFeatureRegionOptions(cart, TRUE, TRUE);
+    hgSeqDisplayOptions(cart, TRUE, TRUE, FALSE);
+    return;
+    }
+else if ((table == NULL) || (table[0] == 0))
     {
     hti = NULL;
     }
 else
     {
     hParseTableName(db, table, rootName, chrom);
     hti = hFindTableInfo(db, chrom, rootName);
     if (hti == NULL)
 	webAbort("Error", "Could not find table info for table %s (%s)",
 		 rootName, table);
     }
 hgSeqOptionsHtiCart(hti, cart);
 }
 
 static void hgSeqConcatRegionsDb(char *db, char *chrom, int chromSize, char strand, char *name,
@@ -772,31 +780,31 @@
     freeMem(starts);
     freeMem(sizes);
     freeMem(exonFlags);
     freeMem(cdsFlags);
     }
 return totalCount;
 }
 
 
 int hgSeqItemsInRange(char *db, char *table, char *chrom, int chromStart,
                       int chromEnd, char *sqlConstraints)
 /* Print out dna sequence of all items (that match sqlConstraints, if nonNULL) 
    in the given range in table.  Return number of items. */
 {
 struct hTableInfo *hti;
-struct bed *bedList;
+struct bed *bedList = NULL;
 char rootName[256];
 char parsedChrom[32];
 int itemCount;
 
 hParseTableName(db, table, rootName, parsedChrom);
 hti = hFindTableInfo(db, chrom, rootName);
 if (hti == NULL)
     webAbort("Error", "Could not find table info for table %s (%s)",
 	     rootName, table);
 bedList = hGetBedRange(db, table, chrom, chromStart, chromEnd,
 		       sqlConstraints);
 
 itemCount = hgSeqBed(db, hti, bedList);
 bedFreeList(&bedList);
 return itemCount;