e2d7638b2848fe00bbf9b66bca395ec68a9ee9e6
braney
  Thu Oct 15 16:22:06 2015 -0700
first cut at bigMaf support #15935

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index e3a40b5..8ccbb44 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -415,30 +415,31 @@
 /* returns TRUE is this track has a remote datasource */
 {
 if (!IS_KNOWN(track->remoteDataSource))
     {
     SET_TO_NO(track->remoteDataSource);
     //if (track->bbiFile != NULL)   // FIXME: Chicken or the egg. bigWig/bigBed "bbiFile" filled
     //                              //        in by loadItems, but we don't want to load items.
     //    {
     //    if (!startsWith("/gbdb/",track->bbiFile->fileName))
     //        SET_TO_YES(track->remoteDataSource);
     //    }
     if (startsWithWord("bigWig",track->tdb->type) || startsWithWord("bigBed",track->tdb->type) ||
 	startsWithWord("halSnake",track->tdb->type) ||
 	startsWithWord("bigPsl",track->tdb->type) ||
 	startsWithWord("bigGenePred",track->tdb->type) ||
+	startsWithWord("bigMaf",track->tdb->type) ||
 	startsWithWord("bam",track->tdb->type) || startsWithWord("vcfTabix", track->tdb->type))
         {
         SET_TO_YES(track->remoteDataSource);
         }
     }
 return IS_YES(track->remoteDataSource);
 }
 
 boolean trackShouldUseAjaxRetrieval(struct track *track)
 /* Tracks with remote data sources should berendered via an ajax callback */
 {
 return (theImgBox && !trackImgOnly && trackUsesRemoteData(track));
 }
 #endif///def REMOTE_TRACK_AJAX_CALLBACK
 
@@ -1205,31 +1206,31 @@
         samplePrintYAxisLabel( hvg, y+5, track, "3.0", min0, max0 );
         samplePrintYAxisLabel( hvg, y+5, track, "4.0", min0, max0 );
         samplePrintYAxisLabel( hvg, y+5, track, "5.0", min0, max0 );
         samplePrintYAxisLabel( hvg, y+5, track, "6.0", min0, max0 );
         }
     }
 else
     {
     sprintf( minRangeStr, "%d", (int)round(minRangeCutoff));
     sprintf( maxRangeStr, "%d", (int)round(maxRangeCutoff));
     }
 /* special label handling for wigMaf type tracks -- they
    display a left label in pack mode.  To use the full mode
    labeling, temporarily set visibility to full.
    Restore savedVis later */
-if (startsWith("wigMaf", track->tdb->type) || startsWith("maf", track->tdb->type))
+if (startsWith("bigMaf", track->tdb->type) || startsWith("wigMaf", track->tdb->type) || startsWith("maf", track->tdb->type))
     vis = tvFull;
 
 switch (vis)
     {
     case tvHide:
         break;  /* Do nothing; */
     case tvPack:
     case tvSquish:
 	y += tHeight;
         break;
     case tvFull:
         if (isCenterLabelIncluded(track))
             y += fontHeight;
 
         if( track->subType == lfSubSample && track->items == NULL )
@@ -3255,39 +3256,41 @@
     if (ct->dbTrack)
         tg->loadItems = wigLoadItems;
     else
         tg->loadItems = ctWigLoadItems;
     tg->customPt = ct;
     tg->nextItemButtonable = FALSE;
     }
 else if (sameString(type, "bigWig"))
     {
     tg = trackFromTrackDb(tdb);
     tg->bbiFile = ct->bbiFile;
     tg->nextItemButtonable = FALSE;
     if (trackShouldUseAjaxRetrieval(tg))
         tg->loadItems = dontLoadItems;
     }
-else if (sameString(type, "bigBed")|| sameString(type, "bigGenePred") || sameString(type, "bigPsl"))
+else if (sameString(type, "bigBed")|| sameString(type, "bigGenePred") || sameString(type, "bigPsl") || sameString(type, "bigMaf"))
     {
     struct bbiFile *bbi = ct->bbiFile;
 
     /* Find field counts, and from that revise the tdb->type to be more complete. */
     char extra = (bbi->fieldCount > bbi->definedFieldCount ? '+' : '.');
     char typeBuf[64];
     if (sameString(type, "bigGenePred"))
 	safef(typeBuf, sizeof(typeBuf), "bigGenePred");
+    else if (sameString(type, "bigMaf"))
+	safef(typeBuf, sizeof(typeBuf), "bigMaf");
     else if (sameString(type, "bigPsl"))
 	safef(typeBuf, sizeof(typeBuf), "bigPsl");
     else
 	safef(typeBuf, sizeof(typeBuf), "bigBed %d %c", bbi->definedFieldCount, extra);
     tdb->type = cloneString(typeBuf);
 
     /* Finish wrapping track around tdb. */
     tg = trackFromTrackDb(tdb);
     tg->bbiFile = bbi;
     tg->nextItemButtonable = TRUE;
     if (trackShouldUseAjaxRetrieval(tg))
         tg->loadItems = dontLoadItems;
     }
 else if (sameString(type, "bedGraph"))
     {
@@ -4191,30 +4194,31 @@
 struct paraFetchData
     {
     struct paraFetchData *next;
     struct track *track;
     boolean done;
     };
 
 static boolean isTrackForParallelLoad(struct track *track)
 /* Is this a track that should be loaded in parallel ? */
 {
 char *bdu = trackDbSetting(track->tdb, "bigDataUrl");
 return (startsWithWord("bigWig"  , track->tdb->type)
      || startsWithWord("bigBed"  , track->tdb->type)
      || startsWithWord("bigPsl"  , track->tdb->type)
      || startsWithWord("bigGenePred"  , track->tdb->type)
+     || startsWithWord("bigMaf"  , track->tdb->type)
      || startsWithWord("bam"     , track->tdb->type)
      || startsWithWord("halSnake", track->tdb->type)
      || startsWithWord("vcfTabix", track->tdb->type))
      && (bdu && strstr(bdu,"://"))
      && !(containsStringNoCase(bdu, "dl.dropboxusercontent.com"))
      && (track->subtracks == NULL);
 }
 
 static void findLeavesForParallelLoad(struct track *trackList, struct paraFetchData **ppfdList)
 /* Find leaves of track tree that are remote network resources for parallel-fetch loading */
 {
 struct track *track;
 if (!trackList)
     return;
 for (track = trackList; track != NULL; track = track->next)