00811fcbcfd1c9a317b07477ff46a14dba046160 braney Wed Sep 9 12:39:44 2026 -0700 bigBed: use the file's own field count when the type line asks for more, refs #38310 A `type bigBed N` larger than the number of fields the file holds left the track drawing nothing at all, and its details page reporting a disagreement instead of the item. Fall back on the count in the file's header, which is the count hubCheck already requires the type line to match. The bound has to be the file's total field count and not its definedFieldCount. Fifty-two tracks legitimately declare more bed fields than their header calls defined, forty-eight of them the hs1 T2T_Encode_LOPeaks narrowPeak set, and those are untouched. Three tracks are in the over-declared state today, all `type bigBed 4` over a three-field file: hg38 setDups, and the KAPA_HyperExome and nexterarapidcapture subtracks of hg19 exomeProbesets. Their item boxes render pixel-identically and their details pages, which failed before, now work. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c index c5cdac79997..fe193402f79 100644 --- src/hg/hgTracks/bigBedTrack.c +++ src/hg/hgTracks/bigBedTrack.c @@ -712,30 +712,35 @@ bbi = fetchBbiForTrack(track); } errCatchEnd(errCatch); if (errCatch->gotError) { track->networkErrMsg = cloneString(errCatch->message->string); track->drawItems = bigDrawWarning; track->totalHeight = bigWarnTotalHeight; return; } errCatchFree(&errCatch); fieldCount = track->bedSize; if (fieldCount == 0) track->bedSize = fieldCount = bbi->definedFieldCount; +else if (fieldCount > bbi->fieldCount) + /* The type line asks for more fields than the file holds, and bedRow below is sized by + * the file's own count. Use that count: it is the only one the file can answer for, + * and it is the one hubCheck already requires the type line to match. */ + track->bedSize = fieldCount = bbi->fieldCount; struct bigBedInterval *bb, *bbList; char *quickLiftFile = cloneString(trackDbSetting(track->tdb, "quickLiftUrl")); struct hash *chainHash = NULL; if (quickLiftFile) bbList = quickLiftGetIntervals(quickLiftFile, bbi, chromName, winStart, winEnd, &chainHash); else bbList = bigBedSelectRangeExt(track, chrom, start, end, lm, maxItems); char *squishField = cartOrTdbString(cart, track->tdb, "squishyPackField", NULL); int squishFieldIdx = bbExtraFieldIndex(bbi, squishField); /* colorFields: optional alternative color scheme stored in a named extra field. */ int colorFieldIdx = 0; char *colorFieldsSetting = trackDbSettingClosestToHome(tdb, "colorFields");