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

Martini3-IDP #647

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ LOGGER = StyleAdapter(LOGGER)

VERSION = "martinize with vermouth {}".format(vermouth.__version__)

SS_CG = {'1': 'H', '2': 'H', '3': 'H', 'H': 'H', 'G': 'H', 'I': 'H',
'B': 'E', 'E': 'E', 'T': 'T', 'S': 'S', 'C': 'C'}


def read_system(path, ignore_resnames=(), ignh=None, modelidx=None):
"""
Expand Down Expand Up @@ -952,16 +955,6 @@ def entry():
'for this force field',
type="missing-feature")

ss_sequence = list(
itertools.chain(
*(
dssp.sequence_from_residues(molecule, "secstruct")
for molecule in system.molecules
if selectors.is_protein(molecule)
)
)
)

if args.cystein_bridge == "none":
vermouth.RemoveCysteinBridgeEdges().run_system(system)
elif args.cystein_bridge != "auto":
Expand All @@ -977,6 +970,17 @@ def entry():
disordered_regions=args.water_idrs
)

ss_sequence = list(
itertools.chain(
*(
SS_CG[i]
for i in dssp.sequence_from_residues(molecule, "cgsecstruct")
for molecule in system.molecules
if selectors.is_protein(molecule) if i is not None
)
)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This translation to CG is too simplistic, no?

Suggested change
ss_sequence = list(
itertools.chain(
*(
SS_CG[i]
for i in dssp.sequence_from_residues(molecule, "cgsecstruct")
for molecule in system.molecules
if selectors.is_protein(molecule) if i is not None
)
)
)
ss_sequence = list(
itertools.chain(
*(
dssp.convert_dssp_to_martini(dssp.sequence_from_residues(molecule, "cgsecstruct"))
for molecule in system.molecules
if selectors.is_protein(molecule) if i is not None
)
)
)

Also, how does this interact with the "normal" dssp processing, and people providing a secondary structure on the cli?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't affect the "normal" processing, the annotation is done for both ways before martinize() is called. The dssp/ss flags are dealt with at that point, and this is only to make sure that the cg secondary structure is determined correctly. The ss_sequence needs to be moved here to align with the overwriting that happens in the idr annotation, otherwise the 'uncorrected' string is written out

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern with this is that it becomes ambiguous what's atomistic SS and whats CG SS. The idea of printing the found SS structure is so that users can pass it to the -ss flag to reproduce the behaviour. However, if that only works if the SS flavour that's expected is the same as the one printed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point taken. However, for the purposes of the current IDP models, ensuring the ss used when the links are applied doesn't intersect in a nasty way with the -idr flags is fairly important.

Perhaps the way around is if the string gets changed, print it in the itp twice? first what was found by dssp, second what was actually applied in the links?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable


# Apply position restraints if required.
if args.posres != "none":
LOGGER.info("Applying position restraints.", type="step")
Expand Down Expand Up @@ -1004,6 +1008,12 @@ def entry():
defines = ("GO_VIRT",)
itp_paths = {"atomtypes": "go_atomtypes.itp",
"nonbond_params": "go_nbparams.itp"}
if not args.water_bias:
# this ensures that disordered-folded go bonds get removed regardless of force field.
vermouth.processors.ComputeWaterBias(args.water_bias,
{s: float(eps) for s, eps in args.water_bias_eps},
[(int(start), int(stop)) for start, stop in args.water_idrs],
).run_system(system)
Comment on lines +1039 to +1044
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do args.water_bias_eps and args.water_idrs have sane defaults?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False and [] respectively.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s: float(eps) for s, eps in args.water_bias_eps will cause an error then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah wait, args.water_bias_eps and args.water_idrsboth default to [], it's args.water_bias that defaults to []. As the comment says, this is intended to run empty so that cross domain Go bonds are removed. It can be changed to be explicitly empty though

else:
# don't write non-bonded interactions
itp_paths = []
Expand Down
Loading
Loading