c9d5c3eeb09a866dbc81d9732431c6ff0c096666 chmalee Sun Jun 7 15:46:27 2020 -0700 Add maxWindowToDraw trackDb support to vcfPhasedTrio and limit 1000G phased trio track to 5MB. Also change up some of the UI labels, refs #25582 diff --git src/hg/hgTracks/vcfTrack.c src/hg/hgTracks/vcfTrack.c index a3251b9..cf11ade 100644 --- src/hg/hgTracks/vcfTrack.c +++ src/hg/hgTracks/vcfTrack.c @@ -2016,31 +2016,31 @@ static void vcfPhasedSetupHaplotypesLines(struct track *track, struct hvGfx *hvg, int xOff, int yOff, int width, int *retYOffsets, struct slPair *sampleNames, MgFont *font) /* Setup the background for drawing the ticks, the two haplotype lines for each sample, and the * transparent gray box to help distinguish between consecutive samples */ { int sampleHeight = round(track->height / track->customInt); double yHap1 = track->lineHeight; // relative offset of first haplotype line double yHap2 = sampleHeight - track->lineHeight; // relative offset of second line struct slPair *name; int i, y1, y2; struct rgbColor yellow = lightRainbowAtPos(0.2); int transYellow = MAKECOLOR_32_A(yellow.r, yellow.g, yellow.b, 100); boolean useDefaultLabel = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE, VCF_PHASED_DEFAULT_LABEL_VAR, TRUE); -boolean useAliasLabel = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE, VCF_PHASED_ALIAS_LABEL_VAR, FALSE); +boolean useAliasLabel = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE, VCF_PHASED_ALIAS_LABEL_VAR, TRUE); for (name = sampleNames, i = 0; name != NULL; name = name->next, i++) { y1 = yOff + yHap1 + (i * sampleHeight); y2 = yOff + yHap2 + (i * sampleHeight); retYOffsets[2*i] = y1; retYOffsets[(2*i) + 1] = y2; // make the background of every other lane light yellow, but only when NOT doing PDF/EPS output if ((hvg->pixelBased && i & 1)) { hvGfxBox(hvg, xOff, y1-(track->lineHeight), width, (y2 + track->lineHeight) - (y1-track->lineHeight), transYellow); } hvGfxLine(hvg, xOff, y1, xOff+width, y1, MG_BLACK); hvGfxLine(hvg, xOff, y2, xOff+width, y2, MG_BLACK); struct dyString *label = dyStringNew(0); @@ -2087,30 +2087,32 @@ for (rec = vcff->records, item = track->items; rec != NULL && item != NULL; rec = rec->next, item = item->next) { vcfPhasedDrawOneRecord(track, hvg, rec, item, hapOrder, gtCount * 2, xOff, yOffsets, sampleOrder, scale); } } static int vcfPhasedItemHeight(struct track *tg, void *item) { return tg->heightPer; } int vcfPhasedTrackHeight(struct track *tg, enum trackVisibility vis) { const struct vcfFile *vcff = tg->extraUiData; // when doing composite track height, vcfPhasedLoadItems won't have been called yet! +if (vis == tvDense) + return pgSnpHeight(tg, vis); if (!vcff || vcff->records == NULL) return 0; int totalSamples = slCount(vcfPhasedGetSampleOrder(cart, tg->tdb, FALSE)); tg->lineHeight = tl.fontHeight + 1; tg->heightPer = tl.fontHeight; // if all variants in view are phased, then 3 lines per sample, // else 4 lines. The extra 2 is for clear separation int heightPerSample; if (vcff->allPhased) heightPerSample = (3 * tg->lineHeight) + 2; else heightPerSample = (4 * tg->lineHeight) + 2; tg->height = totalSamples * heightPerSample; tg->itemHeight = vcfPhasedItemHeight; // custom int is reserved for doing pgSnp coloring but as far as I can tell is