Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference HGVS without reference base leads to wrong coordinates and reference allele #61

Open
davmlaw opened this issue Dec 9, 2021 · 0 comments

Comments

@davmlaw
Copy link

davmlaw commented Dec 9, 2021

The current regex treats the last digit as a ref digit, ie it uses it to multiply "N" that many times. This makes the coordinate wrong as the last digit is cut off, eg:

In [6]: HGVSName("NC_000017.11:g.50199235=")                                                                                                                               
Out[6]: HGVSName('NC_000017.11:g.5019923NNNNN=')

In [7]: HGVSName("NM_018090.5:c.462=")                                                                                                                                     
Out[7]: HGVSName('NM_018090.5:c.46NN=')

Unit test test_hgvs_names.py

# Copy pasted from BRCA1:c.101A= test with "A" removed

    ('BRCA1:c.101=', True,
     {
         'gene': 'BRCA1',
         'kind': 'c',
         'cdna_start': CDNACoord(101),
         'cdna_end': CDNACoord(101),
         'ref_allele': '',
         'alt_allele': '',
         'mutation_type': '=',
     }),

# Copy pasted from BRCA1:g.101A= test with "A" removed

    ('BRCA1:g.101=', True,
     {
         'gene': 'BRCA1',
         'kind': 'g',
         'start': 101,
         'end': 101,
         'ref_allele': '',
         'alt_allele': '',
         'mutation_type': '=',
     }),


Currently fails with:

AssertionError: CDNACoord(10, 0) != CDNACoord(101, 0)

Fix is to add a new regex just above the existing "No change" regexes, ie in HGVSRegex:

CDNA_ALLELE = [
    CDNA_START + EQUAL, 
    # old regexes
]

GENOMIC_ALLELE = [
    COORD_START + EQUAL,
    # old regexes
]

I am not sure whether the protein HGVS is affected, and if need to specify the ref ie whether "p.1000=" is valid or not

davmlaw added a commit to SACGF/hgvs that referenced this issue Dec 9, 2021
…o wrong coordinates and reference allele as it treats last digit as ref digit multiplying N that many times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant