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

Raise an exception when there's extra text at the end of an allele name #21

Merged
merged 2 commits into from
Jul 26, 2017

Conversation

iskandr
Copy link
Collaborator

@iskandr iskandr commented Jul 26, 2017

mhcnames seems to currently silently parse "HLA-A*02:01 C30S mutant" as just "HLA-A*02:01" (see #20). This branch makes it so any extra text at the end causes an AlleleParseError exception to be raised.

Future plan: support parsing of mutations at the end of an allele (related: #19)

@@ -131,7 +131,13 @@ def parse_allele_name(name, species_prefix=None):

sep, name = parse_separator(name)

allele_code, name = parse_numbers(name)
allele_code, rest_of_text = parse_numbers(name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the variable name on the left was incorrectly named previously?

If so, LGTM!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the name just to clarify that at this point we don't expect any subsequent characters in the allele name.

I'm on a phone, any chance you can push the new version to PyPI after I merge?

@iskandr iskandr merged commit 85985b9 into master Jul 26, 2017
@iskandr iskandr deleted the raise-exception-on-unparsed-text branch July 26, 2017 17:26
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

Successfully merging this pull request may close these issues.

2 participants