7ce3e16e83b15840bdf4cb0ff4f9b7298f5153d0 braney Tue May 26 13:25:44 2026 -0700 add a FIXME comment for some person far in the future to fix diff --git src/hg/hgTracks/bigWigTrack.c src/hg/hgTracks/bigWigTrack.c index 9f047cddf60..6a917e76d9c 100644 --- src/hg/hgTracks/bigWigTrack.c +++ src/hg/hgTracks/bigWigTrack.c @@ -70,30 +70,40 @@ struct bbiFile *bbiFile, *bbiNext; for(bbiFile = tg->bbiFile; bbiFile ; bbiFile = bbiNext) { struct preDrawContainer *pre = initPreDrawContainer(width); slAddHead(&preDrawList, pre); if (quickLiftFile != NULL) { char *linkFileName = bigChainGetLinkFile(quickLiftFile); // get the chain that maps to our window coordinates struct chain *chain, *chainList = chainLoadIdRangeHub(NULL, quickLiftFile, linkFileName, chromName, winStart, winEnd, -1); // go through each block of each chain and grab a summary from the query coordinates + // FIXME (refs #37621): quickLift bigWig summary issues. + // 1. summaryOffset/summarySizeBlock are scaled by retChain->tSize, not + // (winEnd - winStart). When a chain only partially covers the visible + // window, its blocks get stretched to fill the full preDraw buffer + // instead of landing at the correct window pixels. With multiple chains + // in chainList, each stretches independently and overwrites the others. + // 2. summarySizeBlock is computed from target span but bigWigSummaryArrayExtended + // is called with query coordinates; the bigWig zoom level it selects is + // based on (qEnd-qStart)/summarySizeBlock, which can pick the wrong zoom + // when target and query block lengths differ significantly (indels). for(chain = chainList; chain; chain = chain->next) { struct chain *retChain, *retChainToFree; char *chrom = chain->qName; chainSubsetOnT(chain, winStart, winEnd, &retChain, &retChainToFree); struct cBlock *cb; for(cb = retChain->blockList; cb; cb = cb->next) { // figure out where in the summary array the target coordinates put us int tSize = retChain->tEnd - retChain->tStart; int summaryOffset = (((double)cb->tStart - retChain->tStart) / tSize ) * summarySize; int summarySizeBlock = (((double)cb->tEnd - cb->tStart) / tSize ) * summarySize; // grab the data using query coordinates if (summarySizeBlock != 0)