485724bcdce8810dcf1b65755c97dbb3c39fa02a braney Mon Aug 25 15:37:25 2025 -0700 give quickLiftChains there own methods in hgTracks and a special hgc page diff --git src/hg/hgTracks/quickLift.c src/hg/hgTracks/quickLift.c index 04cc8ab2849..1a3a2ef12cd 100644 --- src/hg/hgTracks/quickLift.c +++ src/hg/hgTracks/quickLift.c @@ -1,28 +1,35 @@ #include "common.h" #include "hgTracks.h" #include "chromAlias.h" #include "hgConfig.h" #include "bigChain.h" #include "bigLink.h" #include "trackHub.h" #include "quickLift.h" +#include "chainCart.h" static Color *highlightColors; //static unsigned lengthLimit; +struct cartOptions + { + enum chainColorEnum chainColor; /* ChromColors, ScoreColors, NoColors */ + int scoreFilter ; /* filter chains by score if > 0 */ + }; + static Color getColor(char *confVariable, char *defaultRgba) { Color color = 0xff0000ff; char *str = cloneString(cfgOptionDefault(confVariable, defaultRgba)); char *words[10]; if (chopCommas(str, words) != 4) errAbort("conf variable '%s' is expected to have a string like r,g,b,a ", confVariable); color = MAKECOLOR_32_A(atoi(words[0]),atoi(words[1]),atoi(words[2]),atoi(words[3])); return color; } static void initializeHighlightColors() { @@ -98,30 +105,57 @@ mapBoxHc(hvg, hr->chromStart, hr->chromEnd, x1, yOff, w, height, tg->track, hr->id, mouseOver); } else { if (drawTriangle) { startX = x1 + w/2 - fontHeight/2; endX = x1 + w/2 + fontHeight/2 ; drawTri(hvg, startX, endX , yOff, hexColor); } else { startX = x1; endX = x1 + w; hvGfxBox(hvg, startX, yOff, w, height, hexColor); + continue; } if (hr->type == QUICKTYPE_MISMATCH) safef(mouseOver, sizeof mouseOver, "mismatch %c->%c", *hr->otherBases, *hr->bases); else if (hr->chromStart == hr->chromEnd) safef(mouseOver, sizeof mouseOver, "deletion %ldbp (%.*s)", hr->oChromEnd - hr->oChromStart, hr->otherBaseCount, hr->otherBases); else if (hr->oChromStart == hr->oChromEnd) safef(mouseOver, sizeof mouseOver, "insertion %ldbp (%.*s)", hr->chromEnd - hr->chromStart, hr->baseCount, hr->bases); else safef(mouseOver, sizeof mouseOver, "double %ldbp", hr->oChromEnd - hr->oChromStart); mapBoxHc(hvg, seqStart, seqEnd, startX, yOff, endX - startX, height, tg->track, hr->id, mouseOver); } } } + +void quickLiftDraw(struct track *tg, int seqStart, int seqEnd, + struct hvGfx *hvg, int xOff, int yOff, int width, + MgFont *font, Color color, enum trackVisibility vis) +{ +//mapBoxHc(hvg, seqStart, seqEnd, xOff, yOff, width, tg->height, tg->track, "fart", "hallo"); +maybeDrawQuickLiftLines( tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis); +} + +void quickLiftChainMethods(struct track *tg, struct trackDb *tdb, + int wordCount, char *words[]) +/* Fill in custom parts of quickLift chains */ +{ +struct cartOptions *chainCart; + +AllocVar(chainCart); +tg->extraUiData = (void *) chainCart; + +tg->isBigBed = TRUE; + +void bigChainLoadItems(struct track *tg); +tg->loadItems = bigChainLoadItems; +tg->drawItems = quickLiftDraw; +int linkedFeaturesFixedTotalHeightNoOverflow(struct track *tg, enum trackVisibility vis); +tg->totalHeight = linkedFeaturesFixedTotalHeightNoOverflow; +}