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

Implementation of the Martini3 Go-model #550

Merged
merged 102 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
8891cc5
init draft for Go model
fgrunewald Oct 6, 2023
ae818e3
first implementation Go model
fgrunewald Oct 8, 2023
d2ed0f6
implement structural bias processor
fgrunewald Oct 12, 2023
ab9303b
have some handy utilites for the Go pipeline
fgrunewald Oct 12, 2023
b315603
add water bias functionality
fgrunewald Oct 12, 2023
77d7c70
use new contact map format
fgrunewald Oct 12, 2023
96be469
rename get go
fgrunewald Oct 12, 2023
6e05c09
add licensce header
fgrunewald Oct 12, 2023
92fb9b9
move the go_vs_includes
fgrunewald Oct 12, 2023
462d033
add go_pipeline
fgrunewald Oct 12, 2023
01b617b
implement go_pipeline
fgrunewald Oct 12, 2023
f0bc07f
move logging to processor
fgrunewald Oct 12, 2023
1fd451a
lining
fgrunewald Oct 12, 2023
e60e120
refactor topology writing
fgrunewald Oct 13, 2023
e01dc30
some clean up
fgrunewald Oct 13, 2023
b0b4b6c
refactor water bias
fgrunewald Oct 16, 2023
5cd2c82
make water bias workflow worl
fgrunewald Oct 16, 2023
c7eb8c9
baseline for including tests
fgrunewald Oct 16, 2023
f7e4338
working Go flow
fgrunewald Oct 16, 2023
f06b290
contact map tes
fgrunewald Oct 16, 2023
7231e69
Merge branch 'Go' of https://github.com/marrink-lab/vermouth-martiniz…
fgrunewald Oct 16, 2023
257600a
test for reading and error in go map
fgrunewald Oct 16, 2023
4f45d81
test for go utils
fgrunewald Oct 16, 2023
0d7cc94
add test for atomtypes
fgrunewald Oct 16, 2023
90fca98
add test for atomtypes
fgrunewald Oct 16, 2023
31fa775
change name test atomtypes
fgrunewald Oct 16, 2023
b96113e
add tests nonbond_params
fgrunewald Oct 16, 2023
6f59271
fix comment handling
fgrunewald Oct 16, 2023
7e11ddc
use resid function from go_utils
fgrunewald Oct 16, 2023
c072b92
idot safe in resid handling
fgrunewald Oct 16, 2023
cba5f78
update dummy molecule
fgrunewald Oct 16, 2023
7fc412d
topology writing test
fgrunewald Oct 17, 2023
f368a38
do writing test in tmp dir
fgrunewald Oct 17, 2023
82ca6af
address comment in topology file writing
fgrunewald Oct 17, 2023
af6de49
update doc-string
fgrunewald Oct 17, 2023
403ec92
test-water bias
fgrunewald Oct 17, 2023
8ed3e84
refactor water bias test
fgrunewald Oct 17, 2023
f4f97a9
fix go processor chain accounting
fgrunewald Oct 17, 2023
65106b0
test for go processor structure bias
fgrunewald Oct 17, 2023
fbbf8f5
fix indent in vs creator
fgrunewald Oct 17, 2023
71a8d2e
fix some more issues
fgrunewald Oct 17, 2023
cae03e9
adjust test to skip no OV/rCSU contacts
fgrunewald Oct 17, 2023
f01261b
remove debug
fgrunewald Oct 17, 2023
293b73e
add test for symmetric contact
fgrunewald Oct 17, 2023
c87d245
VirtualSideCreator to VirtualSiteCreator
Lp0lp Oct 19, 2023
662ecfa
Moved create_sys_all_attrs to helperfunctions
Lp0lp Oct 19, 2023
56c87bb
move test_molecule to helper_functions
Lp0lp Oct 19, 2023
0056f7f
More fixes
Lp0lp Oct 19, 2023
6ee5107
Merge pull request #555 from Lp0lp/Go
fgrunewald Oct 19, 2023
7a85e44
Keep only symmetrical go contacts.
Lp0lp Oct 20, 2023
7adc157
Fix go_struct_bias tests & add some more.
Lp0lp Oct 20, 2023
6e361d2
use _old_resid in water bias for identifying ID regions
fgrunewald Oct 23, 2023
7f00195
add nx to go_pipeline
fgrunewald Oct 23, 2023
82df118
use _old_resid in structure bias for finding the atomtype
fgrunewald Oct 23, 2023
47cf186
Merge branch 'Go' of https://github.com/marrink-lab/vermouth-martiniz…
fgrunewald Oct 23, 2023
546ac15
Merge branch 'master' into Go
fgrunewald Oct 25, 2023
28359a0
test self interaction nb params
fgrunewald Oct 27, 2023
3182111
add tests for high level errors in water generatoin
fgrunewald Nov 1, 2023
24662f8
remove unneccesary post_section_lines feature
fgrunewald Nov 1, 2023
2f48e61
radd calls to super for run_system
fgrunewald Nov 1, 2023
2b5853c
radd calls to super for run_system
fgrunewald Nov 1, 2023
01483d4
Apply suggestions from code review
fgrunewald Nov 3, 2023
23323a3
properly implement renaming of convert_sigma_to_epsilon
fgrunewald Nov 3, 2023
e535717
add test for go utilitz error
fgrunewald Nov 3, 2023
54ba9d9
more tests
fgrunewald Nov 3, 2023
f66d202
more tests water bias
fgrunewald Nov 3, 2023
7d0727e
fix docstring
fgrunewald Nov 3, 2023
e3cf4ad
loop over lines from buffer when reading contact map
fgrunewald Nov 3, 2023
a1c52ba
address some comments
fgrunewald Nov 3, 2023
bd785f4
fix docstring
fgrunewald Nov 3, 2023
cb223e5
Added go suport in tests. First GO integ test.
Nov 23, 2023
89c292d
Added more integ tests.
Nov 23, 2023
9f4cb17
use -go for map parsing
fgrunewald Nov 30, 2023
911b3a6
fix docs
fgrunewald Nov 30, 2023
23138d6
Update vermouth/processors/water_bias.py
fgrunewald Dec 5, 2023
f31201b
Update vermouth/processors/water_bias.py
fgrunewald Dec 5, 2023
486c13e
Update martinize2_workflow.rst
fgrunewald Dec 5, 2023
b6ca0a1
add doi for c-code
fgrunewald Dec 5, 2023
1699276
fix docs according to new go
fgrunewald Dec 5, 2023
507b36c
Merge branch 'master' into Go
fgrunewald Dec 5, 2023
dacbdf8
Create __init__.py
fgrunewald Dec 5, 2023
6e8382d
Update contact_map.py
fgrunewald Dec 5, 2023
806d1f5
Fix sphinx references
pckroon Dec 5, 2023
6f0f20b
Fix sphinx references
pckroon Dec 5, 2023
0f31eed
fix CLI typo
pckroon Dec 6, 2023
71f19aa
Update bin/martinize2
fgrunewald Dec 6, 2023
317f813
Apply suggestions from code review
fgrunewald Dec 11, 2023
484f904
Apply suggestions from code review
fgrunewald Dec 11, 2023
372f226
Apply suggestions from code review
fgrunewald Dec 11, 2023
01b32b5
Update vermouth/tests/rcsu/test_go_utils.py
fgrunewald Dec 14, 2023
023e457
Update vermouth/tests/helper_functions.py
fgrunewald Dec 14, 2023
cf40022
Update vermouth/tests/rcsu/test_go_structure_bias.py
fgrunewald Dec 14, 2023
aaf8ee2
Update vermouth/tests/integration_tests/test_integration.py
fgrunewald Dec 14, 2023
69ae011
Update vermouth/tests/integration_tests/test_integration.py
fgrunewald Dec 14, 2023
393e1bb
put comment
fgrunewald Dec 14, 2023
72a3817
fix docstring go vs includes
fgrunewald Dec 14, 2023
e2491d0
fix spelling
fgrunewald Dec 14, 2023
012c1c9
Merge branch 'master' into Go
pckroon Dec 14, 2023
2a36e63
make itp_paths dict in write_gmx_topology
fgrunewald Dec 14, 2023
daa792b
fix error type in test
fgrunewald Dec 14, 2023
f5f5dea
fix bug in topology regarding itp_paths
fgrunewald Dec 14, 2023
2fb2821
fix bug in topology regarding itp_paths
fgrunewald Dec 14, 2023
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
7 changes: 5 additions & 2 deletions bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def martinize(system, mappings, to_ff, delete_unknown=False):
vermouth.LocateChargeDummies().run_system(system)
return system


def _cys_argument(value):
"""
Convert and validate the value of the cys option for argparse.
Expand Down Expand Up @@ -960,7 +961,8 @@ def entry():
res_dist=args.go_res_dist,)

defines = ("GO_VIRT",)
itp_paths = ["go_atomtypes.itp", "go_nbparams.itp"]
itp_paths = {"atomtypes": "go_atomtypes.itp",
"nonbond_params": "go_nbparams.itp"}
else:
# don't write non-bonded interactions
itp_paths = []
Expand Down Expand Up @@ -1028,7 +1030,8 @@ def entry():
# sites for the biasing
if not args.go:
vermouth.rcsu.go_vs_includes.VirtualSiteCreator().run_system(system)
itp_paths = ["virtual_sites_atomtypes.itp", "virtual_sites_nonbond_params.itp"]
itp_paths = {"atomtypes": "virtual_sites_atomtypes.itp",
"nonbond_params": "virtual_sites_nonbond_params.itp"}
# now we add a bias by defining specific virtual-site water interactions
vermouth.processors.ComputeWaterBias(args.water_bias,
{ s:float(eps) for s, eps in args.water_bias_eps},
Expand Down
18 changes: 12 additions & 6 deletions vermouth/gmx/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@
comments = ""
itp_file.write(f"{a1} {a2} 1 {nb1:3.8F} {nb2:3.8F} {comments}\n")

def write_gmx_topology(system, top_path, itp_paths=[], C6C12=False, defines=(), header=()):
def write_gmx_topology(system,
top_path,
itp_paths={"nonbond_params": "extra_nbparams.itp",
"atomtypes": "extra_atomtypes.itp"},
fgrunewald marked this conversation as resolved.
Show resolved Hide resolved
C6C12=False,
defines=(),
header=()):
"""
Writes a Gromacs .top file for the specified system. Gromacs topology
files are defined by directives for example `[ atomtypes ]`. However,
Expand All @@ -126,9 +132,10 @@
system: vermouth.system.System
top_path: pathlib.Path
path for topology file
itp_paths: list[pathlib.Path]
itp_paths: dict[str, pathlib.Path]
list of paths for writing the topology parameters
like atomtypes.
like atomtypes with the key being the name of the
directive.
C6C12: bool
write non-bonded interaction parameters using LJ
C6C12 form
Expand All @@ -138,18 +145,17 @@
any comment lines to include at the beginning
"""
if not system.molecules:
raise ValueError("No molecule in the system. Nothing to write.")

Check warning on line 148 in vermouth/gmx/topology.py

View check run for this annotation

Codecov / codecov/patch

vermouth/gmx/topology.py#L148

Added line #L148 was not covered by tests

itp_paths = itp_paths[::-1]
include_string = ""
# First we write the atomtypes directive
if "atomtypes" in system.gmx_topology_params:
_path = itp_paths.pop()
_path = itp_paths['atomtypes']
write_atomtypes(system, _path, C6C12)
include_string += f'\n #include "{_path}"'
# Next we write the nonbond_params directive
if "nonbond_params" in system.gmx_topology_params:
_path = itp_paths.pop()
_path = itp_paths['nonbond_params']
write_nonbond_params(system, _path, C6C12)
include_string += f'\n #include "{_path}"\n'
# Write the ITP files for the molecule types, and prepare writing the
Expand Down Expand Up @@ -184,11 +190,11 @@
header[-1] = header[-1] + "\n"
header.append("Please cite the following papers:")
for citation in molecule.citations:
cite_string = citation_formatter(

Check warning on line 193 in vermouth/gmx/topology.py

View check run for this annotation

Codecov / codecov/patch

vermouth/gmx/topology.py#L193

Added line #L193 was not covered by tests
molecule.force_field.citations[citation]
)
LOGGER.info("Please cite: " + cite_string)
header.append(cite_string)

Check warning on line 197 in vermouth/gmx/topology.py

View check run for this annotation

Codecov / codecov/patch

vermouth/gmx/topology.py#L196-L197

Added lines #L196 - L197 were not covered by tests
vermouth.gmx.itp.write_molecule_itp(molecule, outfile, header=header)
this_moltype_len = len(molecule.meta["moltype"])
if this_moltype_len > max_name_length:
Expand Down
2 changes: 1 addition & 1 deletion vermouth/tests/gmx/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_toplevel_topology(tmp_path, dummy_molecule):
outpath,
header=['first header comment', 'second header comment'],
defines=('random', ),
itp_paths=[atompath, nbpath],
itp_paths={"atomtypes": atompath, "nonbond_params": nbpath},
# at this level C6C12 doesn't matter; it gets
# checked in previous texts
C6C12=False)
Expand Down
2 changes: 1 addition & 1 deletion vermouth/tests/test_vs_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_no_system_error(test_molecule):
processor = VirtualSiteCreator()
test_molecule.meta['moltype'] = "random"
# no system
with pytest.raises(IOError):
with pytest.raises(ValueError):
processor.run_molecule(test_molecule)

def test_return_no_nodes():
Expand Down
Loading