e6775d01a591715928bcdce52c694744cc498caa
braney
  Thu Oct 17 15:21:35 2013 -0700
implement maf output in table browser
diff --git src/hg/hgTables/mainPage.c src/hg/hgTables/mainPage.c
index 018cfe2..0c9d284 100644
--- src/hg/hgTables/mainPage.c
+++ src/hg/hgTables/mainPage.c
@@ -481,55 +481,59 @@
 struct outputType otPal =       { NULL, outPalOptions,
                                   "CDS FASTA alignment from multiple alignment", };
 struct outputType otGff =         { NULL, outGff,         "GTF - gene transfer format", };
 struct outputType otBed =         { NULL, outBed,         "BED - browser extensible data", };
 struct outputType otCustomTrack = { NULL, outCustomTrack, "custom track", };
 struct outputType otHyperlinks =  { NULL, outHyperlinks,  "hyperlinks to Genome Browser", };
 struct outputType otWigData =     { NULL, outWigData,     "data points", };
 struct outputType otWigBed =      { NULL, outWigBed,      "bed format", };
 struct outputType otMaf =         { NULL, outMaf,         "MAF - multiple alignment format", };
 struct outputType otChromGraphData =      { NULL, outChromGraphData,       "data points", };
 struct outputType otMicroarrayNames =     { NULL, outMicroarrayNames,     "microarray names", };
 struct outputType otMicroarrayGroupings = { NULL, outMicroarrayGroupings, "microarray groupings", };
 
 static void showOutputTypeRow(boolean isWig, boolean isBedGr,
     boolean isPositional, boolean isMaf, boolean isChromGraphCt,
-    boolean isPal, boolean isMicroarray)
+    boolean isPal, boolean isMicroarray, boolean isHalSnake)
 /* Print output line. */
 {
 struct outputType *otList = NULL, *otDefault = NULL;
 boolean bedifiedOnly = (anySubtrackMerge(database, curTable) || anyIntersection());
 
 hPrintf("<TR><TD><B>output format:</B>\n");
 
 if (isBedGr)
     {
     if (! bedifiedOnly)
 	{
 	slAddTail(&otList, &otAllFields);
 	slAddTail(&otList, &otSelected);
 	}
     slAddTail(&otList, &otWigData);
     slAddTail(&otList, &otWigBed);
     slAddTail(&otList, &otCustomTrack);
     }
 else if (isWig)
     {
     slAddTail(&otList, &otWigData);
     slAddTail(&otList, &otWigBed);
     slAddTail(&otList, &otCustomTrack);
     }
+else if (isHalSnake)
+    {
+    slAddTail(&otList, &otMaf);
+    }
 else if (isMaf)
     {
     slAddTail(&otList, &otMaf);
     if (! bedifiedOnly)
 	slAddTail(&otList, &otAllFields);
     }
 else if (isChromGraphCt)
     {
     slAddTail(&otList, &otChromGraphData);
     }
 else if (isMicroarray)
     {
     slAddTail(&otList, &otMicroarrayNames);
     slAddTail(&otList, &otAllFields);
     slAddTail(&otList, &otSelected);
@@ -560,31 +564,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, isVcf = FALSE;
+        isChromGraphCt = FALSE, isPal = FALSE, isArray = FALSE, isBam = FALSE, isVcf = FALSE, isHalSnake = 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());
         }
@@ -631,30 +635,31 @@
     hPrintf("<TR><TD>");
     curTable = showTableField(curTrack, hgtaTable, TRUE);
     if (isHubTrack(curTable) || (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;
         }
+    isHalSnake = isHalTable( curTable);
     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);
         }
     cgiMakeButton(hgtaDoSchema, "describe table schema");
     hPrintf("</TD></TR>\n");
     }
 
 if (curTrack == NULL)
@@ -831,31 +836,31 @@
             {
             hPrintf("<BR>&nbsp;(debug:&nbsp;'%s',&nbsp;'%s(%s)')",
                     curTrack->type, tdb2->type, table2);
             }
         /* debugging 	debug	^^^^^	*/
 #endif
 
         }
     else
         cgiMakeButton(hgtaDoCorrelatePage, "create");
 
     hPrintf("</TD></TR>\n");
     }
 
 /* Print output type line. */
-showOutputTypeRow(isWig, isBedGr, isPositional, isMaf, isChromGraphCt, isPal, isArray);
+showOutputTypeRow(isWig, isBedGr, isPositional, isMaf, isChromGraphCt, isPal, isArray, isHalSnake);
 
 /* Print output destination line. */
     {
     char *compressType =
 	cartUsualString(cart, hgtaCompressType, textOutCompressNone);
     char *fileName = cartUsualString(cart, hgtaOutFileName, "");
     hPrintf("<TR><TD>\n");
     hPrintf("<B>output file:</B>&nbsp;");
     cgiMakeTextVar(hgtaOutFileName, fileName, 29);
     hPrintf("&nbsp;(leave blank to keep output in browser)</TD></TR>\n");
     hPrintf("<TR><TD>\n");
     hPrintf("<B>file type returned:&nbsp;</B>");
     cgiMakeRadioButton(hgtaCompressType, textOutCompressNone,
 	sameWord(textOutCompressNone, compressType));
     hPrintf("&nbsp;plain text&nbsp&nbsp");