From 253cc0b2934004cf038ac4e9cb167b41ee799685 Mon Sep 17 00:00:00 2001
From: Riley Grant
Date: Tue, 14 Jan 2025 14:04:00 -0600
Subject: [PATCH] feat(browser): update gene page variant note
Update the warning/note on the gene page to explicitly state that the
valid coding exons that define the padded regions to display variants
for the gene only includes CDS exons, not UTRs.
Clarifies the text in the case of genes with only non-coding transcripts.
---
browser/src/GenePage/GenePage.tsx | 1 +
browser/src/GenePage/VariantsInGene.tsx | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/browser/src/GenePage/GenePage.tsx b/browser/src/GenePage/GenePage.tsx
index f93a8712b..ad5cca082 100644
--- a/browser/src/GenePage/GenePage.tsx
+++ b/browser/src/GenePage/GenePage.tsx
@@ -574,6 +574,7 @@ const GenePage = ({ datasetId, gene, geneId }: Props) => {
includeNonCodingTranscripts={includeNonCodingTranscripts}
includeUTRs={includeUTRs}
zoomRegion={zoomRegion}
+ hasOnlyNonCodingTranscripts={!hasCodingExons && hasNonCodingTranscripts}
/>
)}
diff --git a/browser/src/GenePage/VariantsInGene.tsx b/browser/src/GenePage/VariantsInGene.tsx
index da367cf91..ebff5cadc 100644
--- a/browser/src/GenePage/VariantsInGene.tsx
+++ b/browser/src/GenePage/VariantsInGene.tsx
@@ -82,6 +82,7 @@ type OwnVariantsInGeneProps = {
start: number
stop: number
}
+ hasOnlyNonCodingTranscripts?: boolean
}
// @ts-expect-error TS(2456) FIXME: Type alias 'VariantsInGeneProps' circularly refere... Remove this comment to see the full error message
@@ -97,6 +98,7 @@ const VariantsInGene = ({
includeUTRs,
variants,
zoomRegion,
+ hasOnlyNonCodingTranscripts,
}: VariantsInGeneProps) => {
const datasetLabel = labelForDataset(datasetId)
@@ -134,9 +136,12 @@ const VariantsInGene = ({
{includeNonCodingTranscripts || includeUTRs ? 'Warning' : 'Note'}
{' '}
- Only variants located in or within 75 base pairs of a coding exon are shown here. To see
- variants in UTRs or introns, use the{' '}
- region view.
+ {hasOnlyNonCodingTranscripts && <>This gene has no coding transcripts. >}
+ Only variants located in or within 75 base pairs of{' '}
+ {!hasOnlyNonCodingTranscripts ? <>a coding exon (CDS)> : <>an exon>} are shown here.
+ To see variants {!hasOnlyNonCodingTranscripts ? <>in UTRs or introns> : <>in introns>}
+ , use the region view
+ .
The table below shows the HGVS consequence and VEP annotation for each variant's most