-
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
Idp go #593
Idp go #593
Conversation
with the extra flag -idp-tune (probably a better name) martinize will add additional potentials as per the Go paper. This commit: 1) finds cross Go interactions between folded and idrs and removes them 2) identifies BB and SC1 beads in idrs
# Conflicts: # vermouth/data/force_fields/martini3001/citations.bib # vermouth/processors/water_bias.py # vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/citation # vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command # vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp # vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp # vermouth/tests/integration_tests/test_integration.py
bin/martinize2
Outdated
# apply idr specific bonded potentials if required | ||
if args.idr_tune: | ||
if args.to_ff == 'martini3001': |
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 would ideally like a better way of ensuring these parameters get used when needed and ignored when they shouldn't be used, but this is my best idea for now
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.
Some small code comments, and a conceptual suggestion.
You want to add some interactions to specific disordered regions of a protein, right? My suggestion would be to have a simple processor annotate nodes/residues that are in an IDR, and add the interactions using links
"version": 1} | ||
) | ||
|
||
def run_molecule(self, molecule): |
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.
Don't forget to attach the appropriate citation reference to the molecule
- processors/tune_idp_bonds.py now annotates residues which are disordered so that they can have their links added afterwards. Uses existing function from dssp for this purpose. - martinize2 edited to reflect new pipeline - removed now not needed function from rcsu/go_utils.py - addressed other comments
This is a much nicer solution, thanks for suggesting! |
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.
Much cleaner! <3
Still a few small comments
bin/martinize2
Outdated
raise argparse.ArgumentError(idr_tuning, | ||
message=("You are trying to apply IDR biasing to a force field which " | ||
"isn't martini3001, which this is not designed for.")) | ||
vermouth.IDRBonds(idr_regions = [(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) |
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.
vermouth.IDRBonds(idr_regions = [(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) | |
vermouth.IDRBonds(idr_regions=[(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) |
bin/martinize2
Outdated
message=("You are trying to apply IDR biasing to a force field which " | ||
"isn't martini3001, which this is not designed for.")) | ||
vermouth.IDRBonds(idr_regions = [(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) | ||
vermouth.DoLinks().run_system(system) |
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 don't think you actually want to run DoLinks a second time. Instead, move the IDRBonds annotator to just after the mapping
order_disorder_seq = [] | ||
|
||
for key, node in molecule.nodes.items(): | ||
if select_backbone(node): |
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 wouldn't tag just the backbone (or SC1), but rather just all nodes with the appropriate resid
if select_backbone(node): | ||
_old_resid = node['_old_resid'] | ||
if _in_resid_region(_old_resid, idr_regions): | ||
order_disorder_seq.append("D") # D for disordered |
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.
Why first build the list/string, and not just do molecule.nodes[key]['is_idr'] = True
here?
- changed processor function to annotate IDRs first before applying links in martinize. - moved cross go potential removal to water_bias.py - changed aminoacids.ff to reflect new naming - removed no longer needed import in dssp/__init__.py - changed name of import in processors/__init__.py
bin/martinize2
Outdated
@@ -170,7 +170,7 @@ def pdb_to_universal( | |||
return canonicalized | |||
|
|||
|
|||
def martinize(system, mappings, to_ff, delete_unknown=False): | |||
def martinize(system, mappings, to_ff, delete_unknown=False, idrs=False, disordered_regions = []): |
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.
def martinize(system, mappings, to_ff, delete_unknown=False, idrs=False, disordered_regions = []): | |
def martinize(system, mappings, to_ff, delete_unknown=False, idrs=False, disordered_regions=(,)): |
As before, no mutable types as default arguments
bin/martinize2
Outdated
# | ||
# # apply idr specific bonded potentials if required | ||
# if args.idr_tune: | ||
# if not target_ff.has_feature("idr"): | ||
# LOGGER.warning('Improved IDR potentials are not implemented ' | ||
# 'for this force field', | ||
# type="missing-feature") | ||
# else: | ||
# vermouth.IDRBonds(idr_regions=[(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) | ||
# vermouth.DoLinks().run_system(system) |
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.
# | |
# # apply idr specific bonded potentials if required | |
# if args.idr_tune: | |
# if not target_ff.has_feature("idr"): | |
# LOGGER.warning('Improved IDR potentials are not implemented ' | |
# 'for this force field', | |
# type="missing-feature") | |
# else: | |
# vermouth.IDRBonds(idr_regions=[(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) | |
# vermouth.DoLinks().run_system(system) |
vermouth/processors/annotate_idrs.py
Outdated
def annotate_disorder(molecule, idr_regions): | ||
""" | ||
annotate the disordered regions of the molecule | ||
""" |
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.
Docstring is incomplete.
Also, is it worth making the attribute used an argument (with default "cgidr")?
vermouth/processors/annotate_idrs.py
Outdated
|
||
""" | ||
|
||
def __init__(self, idr_regions = 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.
def __init__(self, idr_regions = None): | |
def __init__(self, idr_regions=None): |
vermouth/processors/annotate_idrs.py
Outdated
""" | ||
if not self.idr_regions: | ||
return system | ||
self.system = system |
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.
self.system = system |
Why do you need this?
- changed default argument in martinize - renamed 'idr_regions' to 'id_regions' throughout - exposed the name of the extra annotation in annotate_disorder with default argument "cgidr"
btw, in trying to write some tests to address the missing coverage I've found an error in the test here: vermouth-martinize/vermouth/tests/test_water_bias.py Lines 89 to 98 in e9bf1c9
in that the if statement is testing an atomtype against an atom index. Easy enough to fix, but it does now cause this test to fail once the the eps and sig assertions are actually reached! The failure is unrelated to the new removal functionality in water_bias as well. I'll fix here and you can have a look |
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.
LGTM! Was there anything still missing in this PR?
Thanks! Making a test for the folded/disordered go bond removal, should be done soon! |
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.
How much work would it be to add a test that removes some but not all go-bonds?
you mean in addition to what I've done here now? |
Yes :) |
This is proving more difficult than anticipated... I'm guessing in general you have something in mind like this. Ie. you have two folded domains connected by some linker, and you want to 1) keep intra-domain go bonds, 2) remove domain-linker bonds, and 3) remove inter-domain bonds? I this should be possible but I need to make some big edits to the removal functionality |
What I mean is that in |
- remove all bonds - remove some
ok, I think that addresses your point? |
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.
Yes, perfect
Adding -idp-tune to allow for addition of extra bonded potentials in IDRs