e55631175ec686f6f63bc4da3ab3b0972c8e0ef3 braney Tue Jul 28 10:18:23 2026 -0700 quickLift: leave the Alignment Differences track blank when there are no differences drawDenseChain() was only reached when the window had no mismatches, indels, or double-sided gaps, and it painted each chain as a solid box from a rotating palette, so an identical window rendered as solid blue. Renamed it mapDenseChain() and dropped the fill (and the now-unused palette); it still lays down a mapbox per chain so the click-through to the other assembly keeps working. diff --git src/hg/hgTracks/quickLift.c src/hg/hgTracks/quickLift.c index 820303bf77a..558059f00d0 100644 --- src/hg/hgTracks/quickLift.c +++ src/hg/hgTracks/quickLift.c @@ -49,61 +49,51 @@ static void drawTri(struct hvGfx *hvg, int x1, int x2, int y, Color color) /* Draw traingle. */ { struct gfxPoly *poly = gfxPolyNew(); int half = (x2 - x1) / 2; gfxPolyAddPoint(poly, x1, y); gfxPolyAddPoint(poly, x1+half, y+2*half); gfxPolyAddPoint(poly, x2, y); hvGfxDrawPoly(hvg, poly, color, TRUE); gfxPolyFree(&poly); } -static int snakePalette2[] = -{ -0x1f77b4, 0xaec7e8, 0xff7f0e, 0xffbb78, 0x2ca02c, 0x98df8a, 0xd62728, 0xff9896, 0x9467bd, 0xc5b0d5, 0x8c564b, 0xc49c94, 0xe377c2, 0xf7b6d2, 0x7f7f7f, 0xc7c7c7, 0xbcbd22, 0xdbdb8d, 0x17becf, 0x9edae5 -}; - -static void drawDenseChain(struct track *tg, struct hvGfx *hvg, char *fileName, int start, int end, int xOff, int yOff, int width, MgFont *font, Color color) -// draw a dense version of a chain that users can use to click through to the other species +static void mapDenseChain(struct track *tg, struct hvGfx *hvg, char *fileName, int start, int end, int xOff, int yOff, int width, MgFont *font, Color color) +// There are no alignment differences in this window, so draw nothing, but still lay down +// map boxes over the chains so users can click through to the other species. { struct lm *lm = lmInit(0); struct bbiFile *bbi = bigBedFileOpenAlias(fileName, chromAliasFindAliases); struct bigBedInterval *bb, *bbList = bigBedIntervalQuery(bbi, chromName, start, end, 0, lm); char *bedRow[12]; char startBuf[16], endBuf[16]; double scale = scaleForWindow(width, start, end); -unsigned colorIndex = 0; -for(bb=bbList; bb; bb = bb->next, colorIndex++) +for(bb=bbList; bb; bb = bb->next) { - colorIndex %= sizeof(snakePalette2) / sizeof(int); - bigBedIntervalToRow(bb, chromName, startBuf, endBuf, bedRow, ArraySize(bedRow)); struct bigChain *chain = bigChainLoad(bedRow); if (chain->chromStart < start) chain->chromStart = start; if (chain->chromEnd > end) chain->chromEnd = end; int x1 = xOff + scale * (chain->chromStart - start); int w = scale * (chain->chromEnd - chain->chromStart); - unsigned colorHex = snakePalette2[colorIndex]; - unsigned colorVal = MAKECOLOR_32(((colorHex >> 16) & 0xff),((colorHex >> 8) & 0xff),((colorHex >> 0) & 0xff)); - hvGfxBox(hvg, x1, yOff, w, tg->height, colorVal); char otherChrom[1024]; safef(otherChrom, sizeof otherChrom, "%s:%d-%d", chain->qName, chain->qStart, chain->qEnd); mapBoxHc(hvg, chain->chromStart, chain->chromEnd, x1, yOff, w, tg->height, tg->track, chain->name, otherChrom); } } void maybeDrawQuickLiftLines( struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis) /* Draw the indel regions in quickLifted tracks as a highlight. */ { char *quickLiftFile = cloneString(trackDbSetting(tg->tdb, "quickLiftUrl")); if (quickLiftFile == NULL) return; @@ -113,31 +103,31 @@ drawTriangle = TRUE; char *liftDb = trackDbSetting(tg->tdb, "quickLiftDb"); struct quickLiftRegions *regions = quickLiftGetRegions(database, liftDb, quickLiftFile, chromName, seqStart, seqEnd); struct quickLiftRegions *hr = regions; int fontHeight = mgFontLineHeight(tl.font); int height = tg->height; if (!drawTriangle && isCenterLabelIncluded(tg)) { height += fontHeight; yOff -= fontHeight; } if (drawTriangle && (hr == NULL)) { - drawDenseChain(tg, hvg, quickLiftFile, seqStart, seqEnd, xOff, yOff, width, font, color); + mapDenseChain(tg, hvg, quickLiftFile, seqStart, seqEnd, xOff, yOff, width, font, color); return; } int pos = xOff; char * lastId = 0; for(; hr; hr = hr->next) { unsigned int hexColor = highlightColors[hr->type]; double scale = scaleForWindow(width, seqStart, seqEnd); int x1 = xOff + scale * (hr->chromStart - seqStart); int w = scale * (hr->chromEnd - hr->chromStart); if (w == 0) w = 1; hvGfxSetClip(hvg, xOff, yOff, width, height); // we're drawing in the center label at the moment int startX, endX;