Skip to content

Commit

Permalink
variantgrid_private#3497 - Convert c. HGVS to n. if they are non-codi…
Browse files Browse the repository at this point in the history
…ng transcripts
  • Loading branch information
davmlaw committed Aug 21, 2023
1 parent 3f9090f commit 9bbed80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion genes/hgvs/biocommons_hgvs/hgvs_converter_biocommons.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from genes.hgvs.biocommons_hgvs.data_provider import DjangoTranscriptDataProvider
from genes.hgvs.hgvs_converter import HGVSConverter, HgvsMatchRefAllele
from genes.models import TranscriptVersion
from genes.transcripts_utils import looks_like_transcript
from genes.transcripts_utils import looks_like_transcript, get_refseq_type
from snpdb.models import GenomeBuild, VariantCoordinate, Contig


Expand Down Expand Up @@ -205,6 +205,11 @@ def _hgvs_to_g_hgvs(self, hgvs_string: str) -> Tuple[SequenceVariant, HgvsMatchR
}

var_x = self._parser_hgvs(hgvs_string)
# We are occasionally passed c. HGVS for non-coding transcripts - convert them to n.
if var_x.type == 'c':
transcript_accession = self.get_transcript_accession(hgvs_string)
if get_refseq_type(transcript_accession) == 'RNA':
var_x.type = 'n'
matches_reference = None

try:
Expand Down

0 comments on commit 9bbed80

Please sign in to comment.