-
Notifications
You must be signed in to change notification settings - Fork 22
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
Added support for NetMHCstabpan (GH Issue #64) #167
Conversation
Thanks for this contribution @dhuvik . Looks reasonable to me. Could you add a unit test for it? |
tests/test_netmhc_stabpan.py
Outdated
for i, (expected, actual) in enumerate(zip(web_server_predictions, stability_predictions)): | ||
# Check to make sure that the stability predictions are within 0.01 of the webserver values. | ||
# This could be the result of different versions of dependencies or the nature of the ANN itself. | ||
approx_(expected, actual, tol=0.01, msg="Peptide %d: expected %f but got %f" % (i, expected, actual)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest using numpy.testing.assert_allclose here rather than writing your own function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhuvik I've been mercilessly rolling my own testing helpers so might be setting a bad precedent but agree with Tim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Tim! Will go ahead and make that change
Also @timodonnell I still need to add a netmhc-bundle access token to secrets to make the GH Actions unit tests work, it's on my TODO list for this week. |
tests/common.py
Outdated
@@ -24,6 +24,12 @@ def eq_(x, y, msg=None): | |||
else: | |||
assert x == y, msg | |||
|
|||
def approx_(x, y, tol=1e-6, msg=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to oblige @timodonnell and call numpy.testing.assert_allclose here?
Files changed - 2
netmhcstabpan.py:
Added a NetMHCstabpan class that inherits from the BaseCommandlinePredictor parent class. The program_name is set to "netMHCstabpan". All other attributes are the same as as in other NetMHC* instances.
parsing.py:
Added a parse_netmhcstabpan function. Maps the Thalf_life to the score index, the identity to the key index, and the %Rank_Stab to the rank_index.