Skip to content

Commit

Permalink
Make sure non-coding doesn't have 5' or 3' UTR offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Sep 7, 2021
1 parent a6e238e commit 957d25c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyhgvs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,11 @@ def parse_allele(self, allele):

if kind in ("c", 'n'):
self.parse_cdna(details)
if kind == 'n': # Ensure no 3'UTR or 5'UTR coords in non-coding
if self.cdna_start.coord < 0:
raise InvalidHGVSName(allele, 'allele', "Non-coding transcript cannot contain negative (5'UTR) coordinates")
if self.cdna_start.landmark == 'cdna_stop' or self.cdna_end and self.cdna_end.landmark == 'cdna_stop':
raise InvalidHGVSName(allele, 'allele', "Non-coding transcript cannot contain '*' (3'UTR) coordinates")
elif kind == "p":
self.parse_protein(details)
elif kind == "g":
Expand Down

0 comments on commit 957d25c

Please sign in to comment.