Skip to content

Commit

Permalink
Merge pull request #520 from marrink-lab/fix/Go
Browse files Browse the repository at this point in the history
do not sort when Go
  • Loading branch information
pckroon committed May 16, 2023
2 parents fb4fc36 + d5bea7c commit cc49fc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,12 @@ def entry():
old_resids = nx.get_node_attributes(molecule, "_old_resid")
nx.set_node_attributes(molecule, old_resids, "resid")

LOGGER.info("Sorting atomids", type='step')
vermouth.SortMoleculeAtoms().run_system(system)
# The Martini Go model assumes that we do not mess with the order of
# particles in any way especially the virtual sites needed for the Go
# model, thus we skip the sorting here altogether.
if not args.govs_includes:
LOGGER.info("Sorting atomids", type='step')
vermouth.SortMoleculeAtoms().run_system(system)

LOGGER.info('Writing output.', type='step')
for molecule in system.molecules:
Expand Down
1 change: 1 addition & 0 deletions vermouth/processors/go_vs_includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def add_virtual_sites(molecule, prefix, backbone='BB', atomname='CA', charge=0):
new_charge_group += 1
virtual_site_nodes.append((new_node_id, {
'resid': atom['resid'],
'_old_resid': atom['_old_resid'],
'resname': atom['resname'],
'atype': '{}_{}'.format(prefix, atom['resid']),
'charge_group': new_charge_group,
Expand Down
1 change: 1 addition & 0 deletions vermouth/tests/test_go_vs_includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def molecule_for_go(request):
molecule.add_node(
base_atom_idx + relative_atom_idx,
resid=residue_idx,
_old_resid=residue_idx,
resname='XX',
atomname=atomname,
charge_group=base_atom_idx,
Expand Down

0 comments on commit cc49fc2

Please sign in to comment.