70d4208efa11f262ba5591198214c9ccdc6b54ae
angie
  Mon Aug 22 22:24:05 2011 -0700
Feature #3707 (VCF+tabix support in hgTables):Basic hgTables support for VCF, modeled after BAM code.  Tested all fields,
selected fields, bed output; filter, intersection, schema
on 3 flavors of vcfTabix:
ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/release/20101123/interim_phase1_release/ALL.chr17.phase1.projectConsensus.genotypes.vcf.gz
ftp://ftp-trace.ncbi.nlm.nih.gov/1000genomes/ftp/release/20100804/AFR.dindel.20100804.sites.vcf.gz
ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606/VCF/v4.0/ByChromosomeNoGeno/00-All.vcf.gz

diff --git src/hg/hgTables/mainPage.c src/hg/hgTables/mainPage.c
index d9191c3..ccc54d8 100644
--- src/hg/hgTables/mainPage.c
+++ src/hg/hgTables/mainPage.c
@@ -585,31 +585,31 @@
 }
 
 void nbSpaces(int count)
 /* Print some non-breaking spaces. */
 {
 int i;
 for (i=0; i<count; ++i)
     hPrintf("&nbsp;");
 }
 
 void showMainControlTable(struct sqlConnection *conn)
 /* Put up table with main controls for main page. */
 {
 struct grp *selGroup;
 boolean isWig = FALSE, isPositional = FALSE, isMaf = FALSE, isBedGr = FALSE,
-      isChromGraphCt = FALSE, isPal = FALSE, isArray = FALSE, isBam = FALSE;
+        isChromGraphCt = FALSE, isPal = FALSE, isArray = FALSE, isBam = FALSE, isVcf = FALSE;
 boolean gotClade = hGotClade();
 struct hTableInfo *hti = NULL;
 
 hPrintf("<TABLE BORDER=0>\n");
 
 /* Print clade, genome and assembly line. */
     {
     if (gotClade)
         {
         hPrintf("<TR><TD><B>clade:</B>\n");
         printCladeListHtml(hGenome(database), onChangeClade());
         nbSpaces(3);
         hPrintf("<B>genome:</B>\n");
         printGenomeListForCladeHtml(database, onChangeOrg());
         }
@@ -648,30 +648,31 @@
     hOnClickButton("document.trackHubForm.submit();return false;", "track hubs");
 
     hPrintf("</TD></TR>\n");
     }
 
 /* Print table line. */
     {
     hPrintf("<TR><TD>");
     curTable = showTableField(curTrack, hgtaTable, TRUE);
     if (strchr(curTable, '.') == NULL)  /* In same database */
         {
         hti = getHti(database, curTable, conn);
         isPositional = htiIsPositional(hti);
         }
     isBam = isBamTable( curTable);
+    isVcf = isVcfTable( curTable);
     isWig = isWiggle(database, curTable);
     if (isBigWigTable(curTable))
         {
         isPositional = TRUE;
         isWig = TRUE;
         }
     isMaf = isMafTable(database, curTrack, curTable);
     isBedGr = isBedGraph(curTable);
     isArray = isMicroarray(curTrack, curTable);
     struct trackDb *tdb = findTdbForTable(database, curTrack, curTable, ctLookupName);
     isPal = isPalCompatible(conn, tdb, curTable);
     nbSpaces(1);
     if (isCustomTrack(curTable))
         {
         isChromGraphCt = isChromGraph(tdb);
@@ -766,31 +767,31 @@
     {
     cgiMakeButton(hgtaDoFilterPage, "edit");
     hPrintf(" ");
     cgiMakeButton(hgtaDoClearFilter, "clear");
     if (isWig || isBedGr)
 	wigShowFilter(conn);
     }
 else
     {
     cgiMakeButton(hgtaDoFilterPage, "create");
     }
 hPrintf("</TD></TR>\n");
 }
 
 /* Composite track subtrack merge line. */
-boolean canSubtrackMerge = (curTrack && tdbIsComposite(curTrack) && !isBam);
+boolean canSubtrackMerge = (curTrack && tdbIsComposite(curTrack) && !isBam && !isVcf);
 if (canSubtrackMerge)
     {
     hPrintf("<TR><TD><B>subtrack merge:</B>\n");
     if (anySubtrackMerge(database, curTable))
 	{
 	cgiMakeButton(hgtaDoSubtrackMergePage, "edit");
 	hPrintf(" ");
 	cgiMakeButton(hgtaDoClearSubtrackMerge, "clear");
 	}
     else
 	{
 	cgiMakeButton(hgtaDoSubtrackMergePage, "create");
 	}
     hPrintf("</TD></TR>\n");
     }
@@ -878,51 +879,51 @@
     cgiMakeRadioButton(hgtaCompressType, textOutCompressNone,
 	sameWord(textOutCompressNone, compressType));
     hPrintf("&nbsp;plain text&nbsp&nbsp");
     cgiMakeRadioButton(hgtaCompressType, textOutCompressGzip,
 	sameWord(textOutCompressGzip, compressType));
     hPrintf("&nbsp;gzip compressed");
     hPrintf("</TD></TR>\n");
     }
 
 hPrintf("</TABLE>\n");
 
 
 /* Submit buttons. */
     {
     hPrintf("<BR>\n");
-    if (isWig || isBam)
+    if (isWig || isBam || isVcf)
 	{
 	char *name;
 	extern char *maxOutMenu[];
 	char *maxOutput = maxOutMenu[0];
 
 	if (isCustomTrack(curTable))
 	    name=filterFieldVarName("ct", curTable, "_", filterMaxOutputVar);
 	else
 	    name=filterFieldVarName(database,curTable, "_",filterMaxOutputVar);
 
 	maxOutput = cartUsualString(cart, name, maxOutMenu[0]);
 
 	if (isWig)
 	    hPrintf(
 		"<I>Note: to return more than %s lines, change the filter setting"
 		" (above). The entire data set may be available for download as"
 		" a very large file that contains the original data values (not"
 		" compressed into the wiggle format) -- see the Downloads page."
 		"</I><BR>", maxOutput);
-	else if (isBam)
+	else if (isBam || isVcf)
 	    hPrintf(
 		"<I>Note: to return more than %s lines, change the filter setting"
 		" (above). Please consider downloading the entire data from our Download pages."
 		"</I><BR>", maxOutput);
 	}
     else if (anySubtrackMerge(database, curTable) || anyIntersection())
 	{
 	hPrintf("<I>Note: The all fields and selected fields output formats "
 		"are not available when a%s has been specified.</I><BR>",
 		canSubtrackMerge ? " subtrack merge or intersection" : "n intersection");
 	}
     cgiMakeButton(hgtaDoTopSubmit, "get output");
     hPrintf(" ");
     if (isPositional || isWig)
 	{