d6c216fa6a01dbd47ae3a8848d0b6456adf31a4b
braney
  Mon Sep 21 17:31:58 2026 -0700
hubApi: serve bigNarrowPeak tracks, refs #38395

initSupportedTypes() advertises bigNarrowPeak but allowedBigBedType() left
it out, so bigFileOpen() returned NULL for a type the API says it supports.
Three endpoints were affected: /getData/track and /list/schema reported the
bigDataUrl as missing although the file was there, and /list/chromosomes
killed the CGI, because bigFileChromInfoOutput() passed the null bbi
straight to bbiChromList().

Add bigNarrowPeak to allowedBigBedType(), guard the null in
bigFileChromInfoOutput() so a future divergence between the two lists is a
415 rather than a crash, and note in each list that they have to agree.

Adds a bigNarrowPeak test to the supportedTypes group covering all three
endpoints.

diff --git src/hg/hubApi/apiUtils.c src/hg/hubApi/apiUtils.c
index cc0fa14c4e3..3337177a019 100644
--- src/hg/hubApi/apiUtils.c
+++ src/hg/hubApi/apiUtils.c
@@ -354,37 +354,41 @@
 	    {
 	    if (sameOk(trackHubSkipHubName(subTrack->track), track))
 		trackFound = subTrack;
 	    }
 	}
     if (sameOk(trackHubSkipHubName(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
+ * every bed-like big* type named in initSupportedTypes() (hubApi.c) belongs
+ * here too, otherwise bigFileOpen() returns NULL for a type the API says it
+ * supports and the caller reports a missing file
  */
 {
 if (startsWithWord("bigBarChart", type) ||
     startsWithWord("bigBed", type) ||
     startsWithWord("bigGenePred", type) ||
     startsWithWord("bigInteract", type) ||
     startsWithWord("bigLolly", type) ||
+    startsWithWord("bigNarrowPeak", type) ||
     startsWithWord("bigRmsk", type) ||
     startsWithWord("bigDbSnp", type) ||
     startsWithWord("bigMaf", type) ||
     startsWithWord("bigChain", type) ||
     startsWithWord("bigNet", 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 */
 {