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

p type cannot be validated #727

Open
markgene opened this issue Feb 7, 2024 · 1 comment
Open

p type cannot be validated #727

markgene opened this issue Feb 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@markgene
Copy link

markgene commented Feb 7, 2024

Describe the bug

I get an error message of AttributeError: 'AARefAlt' object has no attribute 'ref_n' when using validate() against a protein variant.

To Reproduce
Steps to reproduce the behavior, invoke hgvs-shell (v1.5.4):

hgvs_t = hp.parse_hgvs_variant('NM_001330729.1(CTNNB1):c.15_398del')
hgvs_p = c_to_p(hgvs_t)
validate(hgvs_p)

It raised the error:

AttributeError: 'AARefAlt' object has no attribute 'ref_n'

Expected behavior
I expect a boolean returned value.

Additional context

The traceback pointed the error to posedit.py:

    101 # Check del length
    102 if self.edit.type in ["del", "delins"]:
--> 103     ref_len = self.edit.ref_n
    104     if ref_len is not None and ref_len != self.pos.end - self.pos.start + 1:
    105         return (
    106             ValidationLevel.ERROR,
    107             "Length implied by coordinates must equal sequence deletion length",
    108         )

It seems we can solve the problem by adding ref_n to AARefAltdecorated by@property`. I made a patch at here. It fixes the problem from my side, but am not sure if it fits well to the whole package. Thanks!

markgene added a commit to markgene/hgvs that referenced this issue Feb 7, 2024
I make the changes to fix the issue described at biocommons#727
Copy link

github-actions bot commented May 8, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale Issue is stale and subject to automatic closing label May 8, 2024
@jsstevenson jsstevenson added bug Something isn't working and removed stale Issue is stale and subject to automatic closing labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants