f01366a14e4574f413ed9b55a0d1c36376074dd8
hiram
  Tue Apr 9 14:43:00 2019 -0700
adding an allowedBigBedType() function to recognize that set of big types refs #18869

diff --git src/hg/hubApi/apiUtils.c src/hg/hubApi/apiUtils.c
index ccfca81..cc684eb 100644
--- src/hg/hubApi/apiUtils.c
+++ src/hg/hubApi/apiUtils.c
@@ -231,38 +231,51 @@
     if (trackFound->subtracks)
 	{
         struct trackDb *subTrack = findTrackDb(track, trackFound->subtracks);
 	if (subTrack)
 	    {
 	    if (sameOk(subTrack->track, track))
 		trackFound = subTrack;
 	    }
 	}
     if (sameOk(trackFound->track, track))
 	break;
     }
 return trackFound;
 }
 
+boolean allowedBigBedType(char *type)
+/* return TRUE if the big* bed-like type is to be supported
+ * add to this list as the big* bed-like supported types are expanded
+ */
+{
+if (startsWithWord("bigBed", type) ||
+    startsWithWord("bigPsl", type)
+   )
+    return TRUE;
+else
+    return FALSE;
+}
+
 struct bbiFile *bigFileOpen(char *trackType, char *bigDataUrl)
 /* open bigDataUrl for correct trackType and error catch if failure */
 {
 struct bbiFile *bbi = NULL;
 struct errCatch *errCatch = errCatchNew();
 if (errCatchStart(errCatch))
     {
-if (startsWith("bigBed", trackType))
+if (allowedBigBedType(trackType))
     bbi = bigBedFileOpen(bigDataUrl);
 else if (startsWith("bigWig", trackType))
     bbi = bigWigFileOpen(bigDataUrl);
     }
 errCatchEnd(errCatch);
 if (errCatch->gotError)
     {
     apiErrAbort("error opening bigFile URL: '%s', '%s'", bigDataUrl,  errCatch->message->string);
     }
 errCatchFree(&errCatch);
 return bbi;
 }
 
 int chromInfoCmp(const void *va, const void *vb)
 /* Compare to sort based on size */