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

bioannotation.py - check for properly-formed EC numbers #27

Closed
jorvis opened this issue Jul 24, 2014 · 2 comments
Closed

bioannotation.py - check for properly-formed EC numbers #27

jorvis opened this issue Jul 24, 2014 · 2 comments

Comments

@jorvis
Copy link
Owner

jorvis commented Jul 24, 2014

There are sources in public HMM and BLAST libraries which assert EC numbers that are malformed, such as "1.2.1.n2". Due to the nature of how these are used, I think the proper thing to do is to warn when the user attempts to add a malformed EC number but don't throw an exception.

@mchibucos
Copy link

My suggestion is to do 1.2.1 or give the option to do that, rather than automatically discard. It is less granular, but still valid e.c.

@jorvis
Copy link
Owner Author

jorvis commented Jul 26, 2014

I checked into the code here, and the constructor method to create a bioannotation.ECAnnotation object already did have a check for the format of the passed EC number:

re_pattern = re.compile('(((([0-9\-]+)\.[0-9\-]+)\.[0-9\-]+)\.[a-z0-9\-]+)')

In that regex I noticed that I was specifically already allowing alpha-characters in the last position, but didn't remember why. So I looked into the release notes at ExPASy and found this:

ENZYME now includes entries with preliminary EC numbers. Preliminary EC numbers include an 'n' as part of the fourth (serial) digit (e.g. EC 3.5.1.n3).

Therefore, the current implementation is correct, and no changes need to be made.

@jorvis jorvis closed this as completed Jul 26, 2014
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

2 participants