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/list.c src/hg/hubApi/list.c
index ab06632a486..2fa22ad37e2 100644
--- src/hg/hubApi/list.c
+++ src/hg/hubApi/list.c
@@ -189,30 +189,32 @@
 jsonWriteObjectEnd(jw);
 long long itemCount = slCount(list);
 jsonWriteNumber(jw, "totalAssemblies", genArkCount);
 jsonWriteNumber(jw, "itemsReturned", itemCount);
 if (!genome && (genArkCount > itemCount))
     jsonWriteBoolean(jw, "maxItemsLimit", TRUE);
 apiFinishOutput(0, NULL, jw);
 hDisconnectCentral(&conn);
 }
 
 static void bigFileChromInfoOutput(struct jsonWrite *jw,
     struct trackDb *thisTrack, char *bigDataUrl)
 /* output the chromosome list for the bigDataUrl file */
 {
 struct bbiFile *bbi = bigFileOpen(thisTrack->type, bigDataUrl);
+if (NULL == bbi)
+    apiErrAbort(err415, err415Msg, "track type '%s' for track=%s not supported at this time for endpoint '/list/chromosomes'", thisTrack->type, thisTrack->track);
 struct bbiChromInfo *chrList = bbiChromList(bbi);
 slSort(chrList, chromInfoCmp);
 struct bbiChromInfo *el = chrList;
 jsonWriteNumber(jw, "chromCount", (long long)slCount(chrList));
 jsonWriteObjectStart(jw, "chromosomes");
 for ( ; el; el = el->next )
     {
     jsonWriteNumber(jw, el->name, (long long)el->size);
     }
 jsonWriteObjectEnd(jw);	/* chromosomes */
 }
 
 static void hubChromInfoJsonOutput(FILE *f, char *hubUrl, char *genome)
 /* for given hubUrl list the chromosomes in the sequence for specified genome
  */