diff --git a/pyhgvs/models/hgvs_name.py b/pyhgvs/models/hgvs_name.py index 16b0df6..3d2b649 100644 --- a/pyhgvs/models/hgvs_name.py +++ b/pyhgvs/models/hgvs_name.py @@ -128,6 +128,7 @@ class HGVSRegex(object): # cDNA allele syntax CDNA_ALLELE = [ # No change + CDNA_START + EQUAL, CDNA_START + DNA_REF + EQUAL, # Substitution @@ -189,6 +190,7 @@ class HGVSRegex(object): # Genomic allele syntax GENOMIC_ALLELE = [ # No change + COORD_START + EQUAL, COORD_START + DNA_REF + EQUAL, # Substitution diff --git a/pyhgvs/tests/test_hgvs_names.py b/pyhgvs/tests/test_hgvs_names.py index 8f06237..06220de 100644 --- a/pyhgvs/tests/test_hgvs_names.py +++ b/pyhgvs/tests/test_hgvs_names.py @@ -358,6 +358,18 @@ def test_invalid_coordinates(): 'mutation_type': '=', }), + # cDNA no change, no provided base + ('BRCA1:c.101=', True, + { + 'gene': 'BRCA1', + 'kind': 'c', + 'cdna_start': CDNACoord(101), + 'cdna_end': CDNACoord(101), + 'ref_allele': '', + 'alt_allele': '', + 'mutation_type': '=', + }), + # cDNA 1bp mutations. ('BRCA1:c.101A>C', True, { @@ -542,6 +554,18 @@ def test_invalid_coordinates(): 'mutation_type': '=', }), + # Genomic no change + no ref base + ('BRCA1:g.101=', True, + { + 'gene': 'BRCA1', + 'kind': 'g', + 'start': 101, + 'end': 101, + 'ref_allele': '', + 'alt_allele': '', + 'mutation_type': '=', + }), + # Genomic 1bp mutations. ('BRCA1:g.101A>C', True, {