-
Notifications
You must be signed in to change notification settings - Fork 46
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
Multiple mutate fixes #565
Conversation
added run_system to annotate_mut_mod to get rid of undesired errors. Have broken the test.
if generic mutation is given to target all residues then need to check that the resspec actually contains a chain
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 for picking up this issue.
I'm not very happy with how much code duplication this solution produces though...
Maybe you can abstract the duplicated functionality in a separate function (maybe that would return the affected nodes?)? As alternative, make the resspecs-to-find attributes of the AnnotateMutMod Processor, and make sure you find each at least once when running run_system.
def run_system(system):
self.resspec_counts = ...
# Modify run_molecule to increment the resspec_counter(s)
super().run_system()
if any(self.resspec_counts == 0): warn
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.
Nice bit of cleanup :) I do think I spotted a (small) mistake though, and there are some small comments left over from before.
I forgot why the different behaviour for whether a chain is specified or not?
Updating the codecov action seems to have fixed the failing test thingie |
just to check, are you expecting any more changes from me? |
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 think this still gives erroneous warnings for chemically disconnected things. For example, protein with 2 chains (A and B) which are not connected by a chemical bond (and are thus separate Molecules), combined with a valid resspec that defines a chain.
If I've understood your concerns correctly, hopefully the two new tests satisfy them? |
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.
One more testcase: I think {'resname': 'GLY', 'resid: 1'}
will not print a warning even if it doesn't match anything.
After that I'm happy :)
So, I think those tests do what you expect them to, but I'm not sure they should work, as they don't pick up on the error identification correctly? Eg, GLU4:GLY should mutate any GLU at resid 4 on every chain, but if resid 4 is not GLU then there should be a warning, and there currently isn't. I'll have a think about how to address this. I'll also update the martinize2 help to add some more detail about what's possible with the mutate/modify flags? |
Exactly :)
This is always welcome. Documentation is not my strong suite |
Isn't this already captured by the warning raised? |
That warning works for single molecules, not the entire system, which is what's going wrong if you have a resspec that does not mention any chains but does not match anywhere |
I'm pretty sure that possibility's covered by this test though:
ie. two molecules in the system, target any GLY with resid 1 (of which there are none), and expect a warning to be raised |
Since the test was always running on a single Molecule (rather than a System of multiple molecules) it was hiding the issue I was trying to dig up. |
thanks for that additional test, I see what you mean now about what wasn't captured. Will fix in due course! |
run the processor as a system, and raise warnings if the mutmod is not found anywhere, or a warning if found in some places but not others one test expected outcome has been changed to reflect this.
True | ||
False |
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.
This test should raise a warning right? Since there is no GLY in chain A?
you're right, I think I had confused something between that and test 8 sorry. I think now this should address the different possible cases, it was a bit of a headache getting something that satisfied both test 7 and test 8 together. |
No worries. I know how these things can happen. |
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.
One last nitpick, LGTM otherwise!
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.
Nice work! Thanks for following through and dealing with all the small nitpicks!
re-addresses #553 in the case that mutations are given across multiple chains. This PR makes sure that in the case that multiple chains are targeted, the check for the target residue existing is not present across all chains. So warnings aren't raised when the 'missing' residue is encountered.