458eb071b9214f95170c0e7d597f79cdc9bd04db galt Wed Sep 3 15:21:09 2025 -0700 Revert "Fixes #35580 and #36250" This reverts commit 6a731cde7f73dcf905192439bdf064a73abf11d2. I will have to revert this for now and continue debugging on my branch. diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c index 854f81a9f4d..8784208b144 100644 --- src/hg/hgTracks/bigBedTrack.c +++ src/hg/hgTracks/bigBedTrack.c @@ -475,144 +475,79 @@ { static boolean set = FALSE; static unsigned maxItems = 0; if (!set) { char *maxItemsStr = cfgOptionDefault("bigBedMaxItems", "10000"); maxItems = sqlUnsigned(maxItemsStr); set = TRUE; } return maxItems; } -static void loadBigBedSummary(struct track *track) -/* Check if summary loading needed for bigBed */ -{ - -if (track->subtracks) // do tracks or subtracks but not parents. +struct bigBedInterval *bigBedSelectRangeExt(struct track *track, + char *chrom, int start, int end, struct lm *lm, int maxItems) +/* Return list of intervals in range. */ { - return; - } - -struct lm *lm = lmInit(0); - -char *chrom = chromName; -int start = winStart; -int end = winEnd; - +struct bigBedInterval *result = NULL; /* protect against temporary network error */ struct errCatch *errCatch = errCatchNew(); boolean filtering = FALSE; // for the moment assume we're not filtering if (errCatchStart(errCatch)) { - // scan all windows for errors and overflows - boolean errorsInWindows = FALSE; - boolean overFlowedInWindows = FALSE; - - struct track *thisTrack; - for(thisTrack=track->prevWindow; thisTrack; thisTrack=thisTrack->prevWindow) - { - if (!thisTrack->items) - overFlowedInWindows = TRUE; - if (thisTrack->drawItems == bigDrawWarning) - errorsInWindows = TRUE; - } - for(thisTrack=track->nextWindow; thisTrack; thisTrack=thisTrack->nextWindow) - { - if (!thisTrack->items) - overFlowedInWindows = TRUE; - if (thisTrack->drawItems == bigDrawWarning) - errorsInWindows = TRUE; - } - - if (!track->items) - overFlowedInWindows = TRUE; - - if (!errorsInWindows && overFlowedInWindows) + struct bbiFile *bbi = fetchBbiForTrack(track); + result = bigBedIntervalQuery(bbi, chrom, start, end, bigBedMaxItems() + 1, lm); + if (slCount(result) > bigBedMaxItems()) { if (filtering) errAbort("Too many items in window to filter.Zoom in or remove filters to view track."); else - { - struct bbiFile *bbi = fetchBbiForTrack(track); - if (bbi) { // use summary levels if (track->visibility != tvDense) { track->limitedVis = tvFull; track->limitWiggle = TRUE; track->limitedVisSet = TRUE; } else { track->limitedVis = tvDense; track->limitedVisSet = TRUE; } + result = NULL; AllocArray(track->summary, insideWidth); if (bigBedSummaryArrayExtended(bbi, chrom, start, end, insideWidth, track->summary)) { char *denseCoverage = trackDbSettingClosestToHome(track->tdb, "denseCoverage"); if (denseCoverage != NULL) { double endVal = atof(denseCoverage); if (endVal <= 0) { AllocVar(track->sumAll); *track->sumAll = bbiTotalSummary(bbi); } } } else freez(&track->summary); } } - } - } -errCatchEnd(errCatch); -if (errCatch->gotError) - { - track->networkErrMsg = cloneString(errCatch->message->string); - track->drawItems = bigDrawWarning; - track->totalHeight = bigWarnTotalHeight; - } -errCatchFree(&errCatch); -lmCleanup(&lm); -track->bbiFile = NULL; - -} - -struct bigBedInterval *bigBedSelectRangeExt(struct track *track, - char *chrom, int start, int end, struct lm *lm, int maxItems) -/* Return list of intervals in range. */ -{ -struct bigBedInterval *result = NULL; -/* protect against temporary network error */ -struct errCatch *errCatch = errCatchNew(); -if (errCatchStart(errCatch)) - { - struct bbiFile *bbi = fetchBbiForTrack(track); - result = bigBedIntervalQuery(bbi, chrom, start, end, bigBedMaxItems() + 1, lm); // pass in desired limit or 0 for all. - - if (slCount(result) > bigBedMaxItems()) - { - result = NULL; // lets loadSummary know we reached maximum size allowed and want to use wiggle summaries. - } - track->bbiFile = NULL; } errCatchEnd(errCatch); if (errCatch->gotError) { track->networkErrMsg = cloneString(errCatch->message->string); track->drawItems = bigDrawWarning; track->totalHeight = bigWarnTotalHeight; result = NULL; } errCatchFree(&errCatch); return result; } @@ -1043,20 +978,16 @@ #endif complexBedMethods(track, tdb, TRUE, wordCount, newWords); } void bigBedMethods(struct track *track, struct trackDb *tdb, int wordCount, char *words[]) /* Set up bigBed methods for tracks that are type bigBed. */ { commonBigBedMethods(track, tdb, wordCount, words); if (sameWordOk(trackDbSetting(tdb, "style"), "heatmap")) { // Might want to check here if required heatmap settings/fields are in place, // maybe some combo of row count and labels. heatmapMethods(track); } -//track->loadItems = -// add name loadSummary to the track structure. -track->loadSummary = loadBigBedSummary; } -