vermouth-martinize icon indicating copy to clipboard operation
vermouth-martinize copied to clipboard

Raise warning if mutation not found

Open csbrasnett opened this issue 9 months ago • 8 comments

At the moment, if a -mutate flag is given, but the target residue is not found, then martinize will process the input structure as given without raising a warning.

Eg, taking the martinize tutorial:

martinize2 -f 181L_clean.pdb -o t4l_only.top -x t4l_cg.pdb -dssp /usr/bin/dssp -p backbone -ff martini3001 -mutate A-MET1:LYS

will correctly mutate the first residue from MET to LYS, but

martinize2 -f 181L_clean.pdb -o t4l_only.top -x t4l_cg.pdb -dssp /usr/bin/dssp -p backbone -ff martini3001 -mutate A-MET2:LYS

will do nothing (ie. keep residue 1, 2 as MET, ASN as in the input structure). If a user is expecting the mutation (eg the above could easily be a typo) and uses the topology naively (even though they should really check...) then that's a problem.

It's probably about time I put in a PR here, so I can try and do something about it this week, just thought I'd open the issue first, or in case I don't get to it as soon as I'd like.

vermouth 0.9.6

csbrasnett avatar Oct 17 '23 14:10 csbrasnett

I think this would be a great first PR :) The best place is probably in vermouth/processors/annotate_mut_mod.py. Beyond that, good luck, have fun, and feel free to ask for help/advice/whatever!

pckroon avatar Oct 18 '23 11:10 pckroon

@pckroon Noticed one minor issue with how this was fixed. In the case where we have >1 chain in the protein, the mutation is looked for across all chains and raises a warning for each of the chains where the mutation isn't found. Then nothing is written, even though the mutation has been specified correctly. I'll come up with a fix asap...

csbrasnett avatar Dec 07 '23 10:12 csbrasnett

Good find. I don't think the issue is chains per se, but rather molecules, since the AnnotateMutMod processor has a run_molecule method rather than a run_system method.

pckroon avatar Dec 07 '23 11:12 pckroon

Thanks, not sure I have time to address this week but I'll try to start next. It would be good to try and address #512 at the same time, but I'm less sure about where to start on that one.

csbrasnett avatar Dec 07 '23 12:12 csbrasnett

Don't. That will be a separate PR for sure, because #512, #17, #307 is a huge feature. The open choice is whether you want to rebuild coordinates/atoms at the atomistic level or the CG level. Once you can do that for mutated residues (#512) you can do it for any atom without coordinates in the input (#17)

pckroon avatar Dec 07 '23 13:12 pckroon

ha, understood! I'll address this soon then, and maybe we could work something out for the rebuilding issue in the new year?

csbrasnett avatar Dec 07 '23 13:12 csbrasnett

IMNSHO the rebuilding is one of the biggest missing features we have, so yes please!

pckroon avatar Dec 07 '23 13:12 pckroon

sweet, I'll drop you a message then

csbrasnett avatar Dec 07 '23 13:12 csbrasnett