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

Support for circular genomic identifiers #650

Open
mbiokyle29 opened this issue Apr 3, 2023 · 4 comments
Open

Support for circular genomic identifiers #650

mbiokyle29 opened this issue Apr 3, 2023 · 4 comments
Labels
keep alive exempt issue from staleness checks

Comments

@mbiokyle29
Copy link

I am currently getting a parser error when using the o. genomic DNA identifier (from https://varnomen.hgvs.org/bg-material/refseq/). The error can be reproduced with the following code:

from hgvs.easy import parse

# parse a variant from a plasmid using the circular genome
parse('plasmid:o.10A>G')
---------------------------------------------------------------------------
ParseError                                Traceback (most recent call last)
~/Dev/project/.venv/lib/python3.7/site-packages/hgvs/parser.py in rule_fxn(s)
    124                 try:
--> 125                     return self._grammar(s).__getattr__(rule_name)()
    126                 except ometa.runtime.ParseError as exc:

~/Dev/project/.venv/lib/python3.7/site-packages/parsley.py in invokeRule(*args, **kwargs)
     97                                      [["message", "expected EOF"]], err.trail)
---> 98             raise err
     99         return invokeRule

~/Dev/project/.venv/lib/python3.7/site-packages/parsley.py in invokeRule(*args, **kwargs)
     84             try:
---> 85                 ret, err = self._grammar.apply(name, *args)
     86             except ParseError as e:

~/Dev/project/.venv/lib/python3.7/site-packages/ometa/runtime.py in apply(self, ruleName, *args)
    461         if r is not None:
--> 462             val, err = self._apply(r, ruleName, args)
    463             return val, err

~/Dev/project/.venv/lib/python3.7/site-packages/ometa/runtime.py in _apply(self, rule, ruleName, args)
    494                 memoRec = self.input.setMemo(ruleName,
--> 495                                          [rule(), self.input])
    496             except ParseError as e:

/pymeta_generated_code/pymeta_grammar__Grammar.py in rule_hgvs_variant(self)
     37                 return (_G_apply_12, self.currentError)
---> 38             _G_or_13, lastError = self._or([_G_or_1, _G_or_3, _G_or_5, _G_or_7, _G_or_9, _G_or_11])
     39             self.considerError(lastError, 'hgvs_variant')

~/Dev/project/.venv/lib/python3.7/site-packages/ometa/runtime.py in _or(self, fns)
    603                 self.input = m
--> 604         raise joinErrors(errors)
    605

ParseError:
plasmid:o.10A>G
        ^
Parse error at line 1, column 8: expected one of 'c', 'g', 'm', 'n', 'p', or 'r'. trail: [p_variant hgvs_variant]


During handling of the above exception, another exception occurred:

HGVSParseError                            Traceback (most recent call last)
~/Dev/project/.venv/lib/python3.7/site-packages/hgvs/shell.py in <module>
----> 1 parse('plasmid:o.10A>G')

~/Dev/project/.venv/lib/python3.7/site-packages/hgvs/parser.py in parse(self, v)
    105
    106         """
--> 107         return self.parse_hgvs_variant(v)
    108
    109     def _expose_rule_functions(self, expose_all_rules=False):

~/Dev/project/.venv/lib/python3.7/site-packages/hgvs/parser.py in rule_fxn(s)
    126                 except ometa.runtime.ParseError as exc:
    127                     raise HGVSParseError(
--> 128                         "{s}: char {exc.position}: {reason}".format(s=s, exc=exc, reason=exc.formatReason())
    129                     )
    130

HGVSParseError: plasmid:o.10A>G: char 8: expected one of 'c', 'g', 'm', 'n', 'p', or 'r'

Seems like o. is not supported by the package. This is not a huge deal, but thought it was worth opening an issue. I'd be interested in providing a PR assuming I could get a little bit of guidance on the changes required. Seems like at a bare minimum I would need too:

I am guessing there are other things that I am not aware of. Either way thanks for all the hard work on this package. It has been great to work with, the shell and .easy module are both great!

Copy link

github-actions bot commented Dec 8, 2023

This issue is stale because it has been open 30 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 Dec 8, 2023
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2023
@reece reece reopened this Feb 19, 2024
@reece reece added resurrected and removed stale Issue is stale and subject to automatic closing labels Feb 19, 2024
@reece
Copy link
Member

reece commented Feb 19, 2024

This issue was closed by stalebot. It has been reopened to give more time for community review. See biocommons coding guidelines for stale issue and pull request policies. This resurrection is expected to be a one-time event.

Copy link

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 20, 2024
@jsstevenson jsstevenson added keep alive exempt issue from staleness checks and removed stale Issue is stale and subject to automatic closing resurrected labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep alive exempt issue from staleness checks
Projects
None yet
Development

No branches or pull requests

3 participants