From a034b7bf3b3955bd13815a18b9a0ec8016a09054 Mon Sep 17 00:00:00 2001 From: jrobinso <933148+jrobinso@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:26:39 -0700 Subject: [PATCH] Fix whole genome view for variant track --- js/variant/variantTrack.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/variant/variantTrack.js b/js/variant/variantTrack.js index 87b8866f9..42e0dd70f 100644 --- a/js/variant/variantTrack.js +++ b/js/variant/variantTrack.js @@ -296,17 +296,16 @@ class VariantTrack extends TrackBase { // Loop through variants. A variant == a row in a VCF file for (let v of features) { - const variant = v._f || v // Unwrap whole gnom - if (variant.end < bpStart) continue - if (variant.start > bpEnd) break + if (v.end < bpStart) continue + if (v.start > bpEnd) break const variantHeight = ("SQUISHED" === this.displayMode) ? this.squishedVariantHeight : this.expandedVariantHeight - const y = TOP_MARGIN + ("COLLAPSED" === this.displayMode ? 0 : variant.row * (variantHeight + vGap)) + const y = TOP_MARGIN + ("COLLAPSED" === this.displayMode ? 0 : v.row * (variantHeight + vGap)) const h = variantHeight // Compute pixel width. Minimum width is 3 pixels, if > 5 pixels create gap between variants - let x = (variant.start - bpStart) / bpPerPixel - let x1 = (variant.end - bpStart) / bpPerPixel + let x = (v.start - bpStart) / bpPerPixel + let x1 = (v.end - bpStart) / bpPerPixel let w = Math.max(1, x1 - x) if (w < 3) { @@ -317,6 +316,7 @@ class VariantTrack extends TrackBase { w -= 2 } + const variant = v._f || v // True variant record, used for whole genome view and SV mate records let af try { af = variant.alleleFreq()