Skip to content

Commit 46f6012

Browse files
authored
Fix display of gene segments in TranscriptVariantDiagram (#1117)
This commit fixes the bug where, for transcripts on the reverse strand, the TranscriptVariantDiagram component was failing to draw the remainder of the gene on either side of the transcript.
1 parent 70b4ac1 commit 46f6012

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/content/app/entity-viewer/variant-view/transcript-consequences/transcript-variant-diagram/TranscriptVariantDiagram.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const Diagram = (
6868

6969
const scale = scaleLinear()
7070
.domain([1, geneLength])
71-
.range([1, width])
71+
.range([0, width])
7272
.interpolate(interpolateRound)
7373
.clamp(true);
7474

@@ -82,10 +82,9 @@ const Diagram = (
8282
const transcriptWidth = width - distanceFromGeneStart - distanceToGeneEnd;
8383
const variantX = scale(variantRelativeStart);
8484

85-
const shouldRenderLeftGeneSegment =
86-
transcript.slice.location.start !== geneStart;
85+
const shouldRenderLeftGeneSegment = transcript.relative_location.start !== 1;
8786
const shouldRenderRightGeneSegment =
88-
transcript.slice.location.end !== geneEnd;
87+
transcript.relative_location.start !== geneLength;
8988

9089
return (
9190
<svg

0 commit comments

Comments
 (0)