Skip to content

Commit 957d25c

Browse files
committed
Make sure non-coding doesn't have 5' or 3' UTR offsets
1 parent a6e238e commit 957d25c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pyhgvs/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,11 @@ def parse_allele(self, allele):
851851

852852
if kind in ("c", 'n'):
853853
self.parse_cdna(details)
854+
if kind == 'n': # Ensure no 3'UTR or 5'UTR coords in non-coding
855+
if self.cdna_start.coord < 0:
856+
raise InvalidHGVSName(allele, 'allele', "Non-coding transcript cannot contain negative (5'UTR) coordinates")
857+
if self.cdna_start.landmark == 'cdna_stop' or self.cdna_end and self.cdna_end.landmark == 'cdna_stop':
858+
raise InvalidHGVSName(allele, 'allele', "Non-coding transcript cannot contain '*' (3'UTR) coordinates")
854859
elif kind == "p":
855860
self.parse_protein(details)
856861
elif kind == "g":

0 commit comments

Comments
 (0)