From f8fd2f01bb848d255fda31478d0ae8662cc78eb6 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sat, 2 Apr 2022 21:15:13 +0200 Subject: [PATCH 001/275] better record of missing links --- polyply/src/gen_itp.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 3f8f6619..73c7d085 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -28,6 +28,7 @@ deferred_open = open from vermouth.file_writer import DeferredFileWriter from vermouth.citation_parser import citation_formatter +from vermouth.graph_utils import make_residue_graph from polyply import (MetaMolecule, ApplyLinks, Monomer, MapToMolecule) from .load_library import load_library @@ -56,6 +57,29 @@ def split_seq_string(sequence): monomers.append(Monomer(resname=resname, n_blocks=n_blocks)) return monomers +def _are_connected(graph, origin_nodes, target_nodes): + for node in origin_nodes: + for neigh in graph.neighbors(node): + if neigh in target_nodes: + return True + return False + +def find_missing_links(meta_molecule): + """ + Given a connected meta_molecule graph and a disconnected + molecule, figure out which residue connections are missing. + """ + for origin, target in meta_molecule.edges: + origin_nodes = meta_molecule.nodes[origin]['graph'].nodes + target_nodes = meta_molecule.nodes[target]['graph'].nodes + if not _are_connected(meta_molecule.molecule, origin_nodes, target_nodes): + resA = meta_molecule.nodes[origin]["resname"] + resB = meta_molecule.nodes[target]["resname"] + idxA = meta_molecule.nodes[origin]["resid"] + idxB = meta_molecule.nodes[target]["resid"] + yield {"resA": resA, "idxA": idxA, "resB": resB, "idxB": idxB} + + def gen_params(args): # Import of Itp and FF files LOGGER.info("reading input and library files", type="step") @@ -80,9 +104,9 @@ def gen_params(args): # Raise warning if molecule is disconnected if not nx.is_connected(meta_molecule.molecule): - n_components = len(list(nx.connected_components(meta_molecule.molecule))) - msg = "You molecule consists of {:d} disjoint parts. Perhaps links were not applied correctly." - LOGGER.warning(msg, (n_components)) + msg = "Missing link between resiude {idxA} {resA} and residue {idxB} {resB}" + for missing in find_missing_links(meta_molecule): + LOGGER.warning(msg, **missing) with deferred_open(args.outpath, 'w') as outpath: header = [ ' '.join(sys.argv) + "\n" ] From b0ff41568c13a701c6553deac277854a22c7d027 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 3 Apr 2022 13:49:13 +0200 Subject: [PATCH 002/275] add doc_strings --- polyply/src/gen_itp.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 73c7d085..84f802e9 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -58,6 +58,10 @@ def split_seq_string(sequence): return monomers def _are_connected(graph, origin_nodes, target_nodes): + """ + Given a list of origin nodes check if any of these + nodes is neighbor to any of the target nodes. + """ for node in origin_nodes: for neigh in graph.neighbors(node): if neigh in target_nodes: @@ -68,6 +72,16 @@ def find_missing_links(meta_molecule): """ Given a connected meta_molecule graph and a disconnected molecule, figure out which residue connections are missing. + + Parameters + ---------- + meta_molecule: `:class:polyply.MetaMolecule` + + Yields: + -------- + dict + dict containing the resnams and resids of the + nodes corresponding to the missing links """ for origin, target in meta_molecule.edges: origin_nodes = meta_molecule.nodes[origin]['graph'].nodes @@ -104,6 +118,8 @@ def gen_params(args): # Raise warning if molecule is disconnected if not nx.is_connected(meta_molecule.molecule): + LOGGER.warning("Your molecule consists of disjoint parts." + "Perhaps links were not applied correctly.") msg = "Missing link between resiude {idxA} {resA} and residue {idxB} {resB}" for missing in find_missing_links(meta_molecule): LOGGER.warning(msg, **missing) From b6ff25150655301d446027f11aeb6af26a978794 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 3 Apr 2022 16:25:43 +0200 Subject: [PATCH 003/275] use read_itp instead of read_polyply; difference is edges are now only made from bonds, angles, constraints --- polyply/src/gen_itp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 84f802e9..26241423 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -57,6 +57,10 @@ def split_seq_string(sequence): monomers.append(Monomer(resname=resname, n_blocks=n_blocks)) return monomers +# TODO move the two functions below to meta-molecule +# and generalize to a function that returns edges +# replacing the equivalent function in graph_utils + def _are_connected(graph, origin_nodes, target_nodes): """ Given a list of origin nodes check if any of these From 7c689d9144b777f94043c1dcd78005bc4a9c4f98 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 3 Apr 2022 16:26:05 +0200 Subject: [PATCH 004/275] use read_itp instead of read_polyply; difference is edges are now only made from bonds, angles, constraints --- polyply/src/meta_molecule.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/polyply/src/meta_molecule.py b/polyply/src/meta_molecule.py index db6a5d63..7a8a09ad 100644 --- a/polyply/src/meta_molecule.py +++ b/polyply/src/meta_molecule.py @@ -15,7 +15,7 @@ import networkx as nx from vermouth.graph_utils import make_residue_graph from vermouth.log_helpers import StyleAdapter, get_logger -from .polyply_parser import read_polyply +from vermouth.gmx.itp_read import read_itp from .graph_utils import find_nodes_with_attributes from .simple_seq_parsers import parse_txt, parse_ig, parse_fasta, parse_json @@ -322,7 +322,9 @@ def from_itp(cls, force_field, itp_file, mol_name): """ with open(itp_file) as file_: lines = file_.readlines() - read_polyply(lines, force_field) + read_itp(lines, force_field) + + _make_edges(force_field) graph = MetaMolecule._block_graph_to_res_graph(force_field.blocks[mol_name]) meta_mol = cls(graph, force_field=force_field, mol_name=mol_name) From 0850b295b8c54c88721b4ada20c73598d1a29120 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 3 Apr 2022 16:26:22 +0200 Subject: [PATCH 005/275] add test for logger warning --- polyply/tests/test_gen_params.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index aa0fa78b..8e0d9844 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -20,7 +20,8 @@ import vermouth.forcefield import vermouth.molecule import vermouth.gmx.itp_read -from polyply import gen_params, TEST_DATA +from polyply import gen_params, TEST_DATA, MetaMolecule +from polyply.src.gen_itp import find_missing_links class TestGenParams(): @staticmethod @@ -112,7 +113,19 @@ def test_gen_params(args_in, ref_file): assert int_types_ref == int_types_new for key in force_field.blocks[ref_name].interactions: - print(key) for term in force_field.blocks[ref_name].interactions[key]: - print(term) assert term in force_field.blocks[args.name].interactions[key] + +def test_find_missing_links(): + fname = TEST_DATA + "/gen_params/ref/P3HT_10.itp" + ff = vermouth.forcefield.ForceField("test") + meta_mol = MetaMolecule.from_itp(ff, fname, "P3HTref") + meta_mol.molecule.remove_edge(39, 45) # resid 7,8 + meta_mol.molecule.remove_edge(15, 21) # resid 3,4 + missing = list(find_missing_links(meta_mol)) + assert len(missing) == 2 + for edge in missing: + assert edge["resA"] == "P3HTref" + assert edge["resB"] == "P3HTref" + assert edge["idxA"] in [3, 4, 7, 8] + assert edge["idxB"] in [3, 4, 7, 8] From 068f7ce9c95995eafca93ab689bd6489d98cc61b Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Apr 2022 17:07:17 +0200 Subject: [PATCH 006/275] fix typo --- polyply/src/gen_itp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 26241423..77ae5080 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -124,7 +124,7 @@ def gen_params(args): if not nx.is_connected(meta_molecule.molecule): LOGGER.warning("Your molecule consists of disjoint parts." "Perhaps links were not applied correctly.") - msg = "Missing link between resiude {idxA} {resA} and residue {idxB} {resB}" + msg = "Missing link between residue {idxA} {resA} and residue {idxB} {resB}" for missing in find_missing_links(meta_molecule): LOGGER.warning(msg, **missing) From 2e0eb70e032837c7d4d1820383d9857b10db3f3a Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 22 Apr 2022 15:19:18 +0200 Subject: [PATCH 007/275] FixType2016H66 The residue name in block PMAM was not correct for atom 6 --- polyply/data/2016H66/polyvinyl_blocks.ff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/data/2016H66/polyvinyl_blocks.ff b/polyply/data/2016H66/polyvinyl_blocks.ff index 6d873158..aa58308d 100644 --- a/polyply/data/2016H66/polyvinyl_blocks.ff +++ b/polyply/data/2016H66/polyvinyl_blocks.ff @@ -286,7 +286,7 @@ PMAM 3 5 N 1 PMAM SC3 5 -0.76 14.0067 6 H 1 PMAM SC4 6 0.38 1.0080 7 H 1 PMAM SC5 7 0.38 1.0080 -8 CH3 1 PMMA SB1 6 0.00 15.0350 +8 CH3 1 PMAM SB1 6 0.00 15.0350 [ bonds ] 1 2 2 gb_27 {"comment":"C,CHn-CHn,C"} 2 3 2 gb_27 {"comment":"C,CHn-CHn,C"} From 888a2058877cfa4f31b26df921542826f3087134 Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Fri, 29 Apr 2022 15:16:08 -0500 Subject: [PATCH 008/275] Small improv error message top_parser --- polyply/src/top_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polyply/src/top_parser.py b/polyply/src/top_parser.py index c8052f8c..e085ca3b 100644 --- a/polyply/src/top_parser.py +++ b/polyply/src/top_parser.py @@ -435,8 +435,9 @@ def parse_include(self, line): if not os.path.exists(filename): msg = ("Cannot find file {}. This can happen when you " + "1) typed the path to the file wrongly or 2) when you " "try to include force-field files from the GMX " - "library (e.g. #incldue \"gromos\"). Instead provide " + "library (e.g. #include \"gromos\"). Instead provide " "the full path. Another source for this error can be " "that you have a #ifdef section with an #include but " "your include file does not exist. In that case if you " From 5bfa2d76a7370d82fff6ecb65a6d3a608cf2ec4c Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Fri, 17 Jun 2022 11:35:21 +0200 Subject: [PATCH 009/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 82 +++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 polyply/data/martini3/PPE.martini3.ff diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff new file mode 100644 index 00000000..52ece2c2 --- /dev/null +++ b/polyply/data/martini3/PPE.martini3.ff @@ -0,0 +1,82 @@ +; General remarks: +; After "polyplying" PPE to the desired polymer length, some manual adjustments are recommended: +; 1) PPE ends with an aromatic ring and not with a triple bond: Delete last bead of topology and coordinate file and all respective potentials using that bead. +; 2) To prevent bending over of last and first aromatic ring: Add an additional bond angle potential at both polymer ends. (k=50,phi0=165) +; (e.g. bond angle potential between 1-4-8 and between End-(End-4)-(End-8) ). +; 3) For furher explanation, please look at https://doi.org/10.1039/D1CP04237H. + +[ citations ] +Martini3 +polyply + +[ moleculetype ] +PPE 4 + +[ atoms ] +; nr type resnr residu atom cgnr charge + 1 TC4 1 PPE BB1 1 0.0 + 2 TC4 1 PPE BB2 2 0.0 + 3 TC4 1 PPE BB3 3 0.0 + 4 TC5 1 PPE BB4 4 0.0 + +[ bonds ] +; ai aj funct + 3 4 1 0.234 9000 {"comment": "Aromatic ring - triple bond"} + +[ constraints ] +; ai aj funct + 1 2 1 0.325 {"comment": "Aromatic ring"} + 1 3 1 0.325 {"comment": "Aromatic ring"} + 2 3 1 0.325 {"comment": "Aromatic ring"} + +[ angles ] + 1 3 4 1 143 550 {"comment": "Aromatic ring - triple bond"} + 2 3 4 1 83 650 {"comment": "Aromatic ring - triple bond"} + +[ dihedrals ] + 4 2 1 3 2 0.0 50 {"comment": "Aromatic ring - triple bond"} + +[ link ] +resname "PPE" +[ atoms ] +BB4 { } ++BB1 { } +[ bonds ] ++BB1 BB4 1 0.234 9000 {"comment": "Aromatic ring - triple bond"} + +[ link ] +resname "PPE" +[ atoms ] +BB4 { } ++BB1 { } ++BB2 { } +[ angles ] +BB4 +BB1 +BB2 1 83 650 {"comment": "Aromatic ring - triple bond"} + +[ link ] +resname "PPE" +[ atoms ] +BB4 { } ++BB1 { } ++BB3 { } +[ angles ] +BB4 +BB1 +BB3 1 143 550 {"comment": "Aromatic ring - triple bond"} + +[ link ] +resname "PPE" +[ atoms ] +BB4 { } ++BB1 { } ++BB2 { } ++BB3 { } +[ dihedrals ] +BB4 +BB1 +BB2 +BB3 2 0.0 50 {"comment": "Aromatic ring - triple bond"} + +[ link ] +resname "PPE" +[ atoms ] +BB4 { } ++BB4 { } +++BB4 { } +[ angles ] +BB4 +BB4 ++BB4 1 180 50 {"comment": "Triple bond - triple bond - triple bond" } From e9356986595994aa89112df06d2ae76e23c07fdf Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Fri, 17 Jun 2022 13:34:14 +0200 Subject: [PATCH 010/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 47 ++++++++++++++------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index 52ece2c2..a5a950a7 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -14,27 +14,27 @@ PPE 4 [ atoms ] ; nr type resnr residu atom cgnr charge - 1 TC4 1 PPE BB1 1 0.0 - 2 TC4 1 PPE BB2 2 0.0 - 3 TC4 1 PPE BB3 3 0.0 - 4 TC5 1 PPE BB4 4 0.0 + 1 TC5 1 PPE BB1 1 0.0 + 2 TC5 1 PPE BB2 2 0.0 + 3 TC5 1 PPE BB3 3 0.0 + 4 TC4 1 PPE BB4 4 0.0 [ bonds ] ; ai aj funct - 3 4 1 0.234 9000 {"comment": "Aromatic ring - triple bond"} + 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ constraints ] ; ai aj funct - 1 2 1 0.325 {"comment": "Aromatic ring"} - 1 3 1 0.325 {"comment": "Aromatic ring"} - 2 3 1 0.325 {"comment": "Aromatic ring"} + 1 2 1 0.325 {"comment": "constr. aromatic ring"} + 1 3 1 0.325 {"comment": "constr. aromatic ring"} + 2 3 1 0.325 {"comment": "constr. aromatic ring"} [ angles ] - 1 3 4 1 143 550 {"comment": "Aromatic ring - triple bond"} - 2 3 4 1 83 650 {"comment": "Aromatic ring - triple bond"} + 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} [ dihedrals ] - 4 2 1 3 2 0.0 50 {"comment": "Aromatic ring - triple bond"} + 4 2 1 3 2 0 50 {"comment": "improper aromatic ring-triple bond-left"} [ link ] resname "PPE" @@ -42,7 +42,7 @@ resname "PPE" BB4 { } +BB1 { } [ bonds ] -+BB1 BB4 1 0.234 9000 {"comment": "Aromatic ring - triple bond"} ++BB1 BB4 1 0.234 9000 {"comment": "angle aromatic ring-triple bond"} [ link ] resname "PPE" @@ -51,7 +51,7 @@ BB4 { } +BB1 { } +BB2 { } [ angles ] -BB4 +BB1 +BB2 1 83 650 {"comment": "Aromatic ring - triple bond"} +BB4 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} [ link ] resname "PPE" @@ -60,23 +60,24 @@ BB4 { } +BB1 { } +BB3 { } [ angles ] -BB4 +BB1 +BB3 1 143 550 {"comment": "Aromatic ring - triple bond"} +BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} [ link ] resname "PPE" [ atoms ] BB4 { } -+BB1 { } -+BB2 { } -+BB3 { } -[ dihedrals ] -BB4 +BB1 +BB2 +BB3 2 0.0 50 {"comment": "Aromatic ring - triple bond"} ++BB4 { } +++BB4 { } +[ angles ] +BB4 +BB4 ++BB4 1 180 50 {"comment": "triple bond-triple bond-triple bond" } [ link ] resname "PPE" [ atoms ] BB4 { } -+BB4 { } -++BB4 { } -[ angles ] -BB4 +BB4 ++BB4 1 180 50 {"comment": "Triple bond - triple bond - triple bond" } ++BB1 { } ++BB2 { } ++BB3 { } +[ dihedrals ] +BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper aromatic ring-triple bond-right"} + From b55fa6d27096c1867a4bce25c1ae1739537d462a Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Fri, 17 Jun 2022 14:05:30 +0200 Subject: [PATCH 011/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 57 ++++++--------------------- 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index a5a950a7..4415ad08 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -21,63 +21,32 @@ PPE 4 [ bonds ] ; ai aj funct - 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ constraints ] ; ai aj funct - 1 2 1 0.325 {"comment": "constr. aromatic ring"} - 1 3 1 0.325 {"comment": "constr. aromatic ring"} - 2 3 1 0.325 {"comment": "constr. aromatic ring"} + 1 2 1 0.325 {"comment": "constr. aromatic ring"} + 1 3 1 0.325 {"comment": "constr. aromatic ring"} + 2 3 1 0.325 {"comment": "constr. aromatic ring"} [ angles ] - 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} [ dihedrals ] - 4 2 1 3 2 0 50 {"comment": "improper aromatic ring-triple bond-left"} + 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} [ link ] resname "PPE" -[ atoms ] -BB4 { } -+BB1 { } + [ bonds ] -+BB1 BB4 1 0.234 9000 {"comment": "angle aromatic ring-triple bond"} ++BB1 BB4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} -[ link ] -resname "PPE" -[ atoms ] -BB4 { } -+BB1 { } -+BB2 { } [ angles ] -BB4 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} - -[ link ] -resname "PPE" -[ atoms ] -BB4 { } -+BB1 { } -+BB3 { } -[ angles ] -BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB4 ++BB4 1 180 50 {"comment": "stiffness between triple bond beads" } -[ link ] -resname "PPE" -[ atoms ] -BB4 { } -+BB4 { } -++BB4 { } -[ angles ] -BB4 +BB4 ++BB4 1 180 50 {"comment": "triple bond-triple bond-triple bond" } - -[ link ] -resname "PPE" -[ atoms ] -BB4 { } -+BB1 { } -+BB2 { } -+BB3 { } [ dihedrals ] -BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper aromatic ring-triple bond-right"} +BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} From ccf1b6e470dcd90d330d3b88cc0bae208b0d9c12 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Mon, 20 Jun 2022 09:38:39 +0200 Subject: [PATCH 012/275] Update citations.bib --- polyply/data/martini3/citations.bib | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index aaf0e640..47806d47 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -19,3 +19,17 @@ @article{polyply volume={13}, pages={68} } + +@article{PPEs, + title={Martini 3 coarse-grained force field for poly(para-phenylene ethynylene)s", + author={Brosz, Matthias and Michelarakis, Nicholas and Bunz, Uwe H. F. and Aponte-Santamaría, Camilo and Gräter, Frauke}, + journal={Phys. Chem. Chem. Phys.}, + doi={10.1039/D1CP04237H}, + year={2022}, + volume={24}, + issue={17}, + pages={9998--10010}, + publisher={The Royal Society of Chemistry}, + url={http://dx.doi.org/10.1039/D1CP04237H}, + abstract={Poly(para-phenylene ethynylene)s, or short PPEs, are a class of conjugated and semi-flexible polymers with a strongly delocalized π electron system and increased chain stiffness. Due to this, PPEs have a wide range of technological applications. Although the material properties of single-chains or mixtures of few PPE chains have been studied in detail, the properties of large assemblies remain to be fully explored. Here, we developed a coarse-grained model for PPEs with the Martini 3 force field to enable computational studies of PPEs in large-scale assembly. We used an optimization geometrical approach to take the shape of the π conjugated backbone into account and also applied an additional angular potential to tune the mechanical bending stiffness of the polymer. Our Martini 3 model reproduces key structural and thermodynamic observables of single PPE chains and mixtures, such as persistence length, density, packing and stacking. We show that chain entanglement increases with the expense of nematic ordering with growing PPE chain length. With the Martini 3 PPE model at hand, we are now able to cover large spatio-temporal scales and thereby to uncover key aspects for the structural organization of PPE bulk systems. The model is also predicted to be of high applicability to investigate out-of-equilibrium behavior of PPEs under mechanical force.} +} From a36e9d715ce04f92fde152f41c889a7de48f9c96 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Mon, 20 Jun 2022 09:39:07 +0200 Subject: [PATCH 013/275] Update citations.bib --- polyply/data/martini3/citations.bib | 1 - 1 file changed, 1 deletion(-) diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index 47806d47..33d49ef3 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -19,7 +19,6 @@ @article{polyply volume={13}, pages={68} } - @article{PPEs, title={Martini 3 coarse-grained force field for poly(para-phenylene ethynylene)s", author={Brosz, Matthias and Michelarakis, Nicholas and Bunz, Uwe H. F. and Aponte-Santamaría, Camilo and Gräter, Frauke}, From 138d47af2ebb0063fc631696045360f04279a8ca Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Mon, 20 Jun 2022 10:36:24 +0200 Subject: [PATCH 014/275] Update PPE.martini3.ff --- polyply/data/martini3/PPE.martini3.ff | 1 + 1 file changed, 1 insertion(+) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index 4415ad08..3449c2a5 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -8,6 +8,7 @@ [ citations ] Martini3 polyply +PPEs [ moleculetype ] PPE 4 From 8647d813c5d951ee9e5a2598f9b9b2070b10930c Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Mon, 20 Jun 2022 12:04:30 +0200 Subject: [PATCH 015/275] Update citations.bib --- polyply/data/martini3/citations.bib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index 33d49ef3..9c0ad5a8 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -20,7 +20,7 @@ @article{polyply pages={68} } @article{PPEs, - title={Martini 3 coarse-grained force field for poly(para-phenylene ethynylene)s", + title={Martini 3 coarse-grained force field for poly(para-phenylene ethynylene)s}, author={Brosz, Matthias and Michelarakis, Nicholas and Bunz, Uwe H. F. and Aponte-Santamaría, Camilo and Gräter, Frauke}, journal={Phys. Chem. Chem. Phys.}, doi={10.1039/D1CP04237H}, From f300096605b969814a28bf377d236b7fafdfc1bd Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:59:37 +0200 Subject: [PATCH 016/275] Create test --- polyply/tests/test_data/library_tests/martini3/PPE/test | 1 + 1 file changed, 1 insertion(+) create mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/test diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/test b/polyply/tests/test_data/library_tests/martini3/PPE/test new file mode 100644 index 00000000..a7f8d9e5 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PPE/test @@ -0,0 +1 @@ +bla From 751f2c038f5607f4fb65a5c1e2e6b10ffc3f857b Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:59:52 +0200 Subject: [PATCH 017/275] Add files via upload --- .../library_tests/martini3/PPE/PPE_20mers.itp | 442 ++++++++++++++++++ 1 file changed, 442 insertions(+) create mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp b/polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp new file mode 100644 index 00000000..cf238b8c --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp @@ -0,0 +1,442 @@ +[ moleculetype ] +PPE 1 +[ atoms ] +1 TC5 1 PPE BB 1 0.0000 ; +2 TC5 1 PPE BB 2 0.0000 ; +3 TC5 1 PPE BB 3 0.0000 ; +4 TC4 1 PPE BB 4 0.0000 ; +5 TC5 2 PPE BB 5 0.0000 ; +6 TC5 2 PPE BB 6 0.0000 ; +7 TC5 2 PPE BB 7 0.0000 ; +8 TC4 2 PPE BB 8 0.0000 ; +9 TC5 3 PPE BB 9 0.0000 ; +10 TC5 3 PPE BB 10 0.0000 ; +11 TC5 3 PPE BB 11 0.0000 ; +12 TC4 3 PPE BB 12 0.0000 ; +13 TC5 4 PPE BB 13 0.0000 ; +14 TC5 4 PPE BB 14 0.0000 ; +15 TC5 4 PPE BB 15 0.0000 ; +16 TC4 4 PPE BB 16 0.0000 ; +17 TC5 5 PPE BB 17 0.0000 ; +18 TC5 5 PPE BB 18 0.0000 ; +19 TC5 5 PPE BB 19 0.0000 ; +20 TC4 5 PPE BB 20 0.0000 ; +21 TC5 6 PPE BB 21 0.0000 ; +22 TC5 6 PPE BB 22 0.0000 ; +23 TC5 6 PPE BB 23 0.0000 ; +24 TC4 6 PPE BB 24 0.0000 ; +25 TC5 7 PPE BB 25 0.0000 ; +26 TC5 7 PPE BB 26 0.0000 ; +27 TC5 7 PPE BB 27 0.0000 ; +28 TC4 7 PPE BB 28 0.0000 ; +29 TC5 8 PPE BB 29 0.0000 ; +30 TC5 8 PPE BB 30 0.0000 ; +31 TC5 8 PPE BB 31 0.0000 ; +32 TC4 8 PPE BB 32 0.0000 ; +33 TC5 9 PPE BB 33 0.0000 ; +34 TC5 9 PPE BB 34 0.0000 ; +35 TC5 9 PPE BB 35 0.0000 ; +36 TC4 9 PPE BB 36 0.0000 ; +37 TC5 10 PPE BB 37 0.0000 ; +38 TC5 10 PPE BB 38 0.0000 ; +39 TC5 10 PPE BB 39 0.0000 ; +40 TC4 10 PPE BB 40 0.0000 ; +41 TC5 11 PPE BB 41 0.0000 ; +42 TC5 11 PPE BB 42 0.0000 ; +43 TC5 11 PPE BB 43 0.0000 ; +44 TC4 11 PPE BB 44 0.0000 ; +45 TC5 12 PPE BB 45 0.0000 ; +46 TC5 12 PPE BB 46 0.0000 ; +47 TC5 12 PPE BB 47 0.0000 ; +48 TC4 12 PPE BB 48 0.0000 ; +49 TC5 13 PPE BB 49 0.0000 ; +50 TC5 13 PPE BB 50 0.0000 ; +51 TC5 13 PPE BB 51 0.0000 ; +52 TC4 13 PPE BB 52 0.0000 ; +53 TC5 14 PPE BB 53 0.0000 ; +54 TC5 14 PPE BB 54 0.0000 ; +55 TC5 14 PPE BB 55 0.0000 ; +56 TC4 14 PPE BB 56 0.0000 ; +57 TC5 15 PPE BB 57 0.0000 ; +58 TC5 15 PPE BB 58 0.0000 ; +59 TC5 15 PPE BB 59 0.0000 ; +60 TC4 15 PPE BB 60 0.0000 ; +61 TC5 16 PPE BB 61 0.0000 ; +62 TC5 16 PPE BB 62 0.0000 ; +63 TC5 16 PPE BB 63 0.0000 ; +64 TC4 16 PPE BB 64 0.0000 ; +65 TC5 17 PPE BB 65 0.0000 ; +66 TC5 17 PPE BB 66 0.0000 ; +67 TC5 17 PPE BB 67 0.0000 ; +68 TC4 17 PPE BB 68 0.0000 ; +69 TC5 18 PPE BB 69 0.0000 ; +70 TC5 18 PPE BB 70 0.0000 ; +71 TC5 18 PPE BB 71 0.0000 ; +72 TC4 18 PPE BB 72 0.0000 ; +73 TC5 19 PPE BB 73 0.0000 ; +74 TC5 19 PPE BB 74 0.0000 ; +75 TC5 19 PPE BB 75 0.0000 ; +76 TC4 19 PPE BB 76 0.0000 ; +77 TC5 20 PPE BB 77 0.0000 ; +78 TC5 20 PPE BB 78 0.0000 ; +79 TC5 20 PPE BB 79 0.0000 ; +80 TC4 20 PPE BB 80 0.0000 ; +81 TC5 21 PPE BB 81 0.0000 ; +82 TC5 21 PPE BB 82 0.0000 ; +83 TC5 21 PPE BB 83 0.0000 ; +84 TC4 21 PPE BB 84 0.0000 ; +85 TC5 22 PPE BB 85 0.0000 ; +86 TC5 22 PPE BB 86 0.0000 ; +87 TC5 22 PPE BB 87 0.0000 ; +[ bonds ] +3 4 1 0.23400 9000 +4 5 1 0.23400 9000 +7 8 1 0.23400 9000 +8 9 1 0.23400 9000 +11 12 1 0.23400 9000 +12 13 1 0.23400 9000 +15 16 1 0.23400 9000 +16 17 1 0.23400 9000 +19 20 1 0.23400 9000 +20 21 1 0.23400 9000 +23 24 1 0.23400 9000 +24 25 1 0.23400 9000 +27 28 1 0.23400 9000 +28 29 1 0.23400 9000 +31 32 1 0.23400 9000 +32 33 1 0.23400 9000 +35 36 1 0.23400 9000 +36 37 1 0.23400 9000 +39 40 1 0.23400 9000 +40 41 1 0.23400 9000 +43 44 1 0.23400 9000 +44 45 1 0.23400 9000 +47 48 1 0.23400 9000 +48 49 1 0.23400 9000 +51 52 1 0.23400 9000 +52 53 1 0.23400 9000 +55 56 1 0.23400 9000 +56 57 1 0.23400 9000 +59 60 1 0.23400 9000 +60 61 1 0.23400 9000 +63 64 1 0.23400 9000 +64 65 1 0.23400 9000 +67 68 1 0.23400 9000 +68 69 1 0.23400 9000 +71 72 1 0.23400 9000 +72 73 1 0.23400 9000 +75 76 1 0.23400 9000 +76 77 1 0.23400 9000 +79 80 1 0.23400 9000 +80 81 1 0.23400 9000 +83 84 1 0.23400 9000 +84 85 1 0.23400 9000 +[ angles ] +1 3 4 1 143 550 +2 3 4 2 83 650 +4 5 6 2 83 650 +4 5 7 1 143 550 +4 8 12 1 180 50 +5 7 8 1 143 550 +6 7 8 2 83 650 +8 9 10 2 83 650 +8 9 11 1 143 550 +8 12 16 1 180 50 +9 11 12 1 143 550 +10 11 12 2 83 650 +12 13 14 2 83 650 +12 13 15 1 143 550 +12 16 20 1 180 50 +13 15 16 1 143 550 +14 15 16 2 83 650 +16 17 18 2 83 650 +16 17 19 1 143 550 +16 20 24 1 180 50 +17 19 20 1 143 550 +18 19 20 2 83 650 +20 21 22 2 83 650 +20 21 23 1 143 550 +20 24 28 1 180 50 +21 23 24 1 143 550 +22 23 24 2 83 650 +24 25 26 2 83 650 +24 25 27 1 143 550 +24 28 32 1 180 50 +25 27 28 1 143 550 +26 27 28 2 83 650 +28 29 30 2 83 650 +28 29 31 1 143 550 +28 32 36 1 180 50 +29 31 32 1 143 550 +30 31 32 2 83 650 +32 33 34 2 83 650 +32 33 35 1 143 550 +32 36 40 1 180 50 +33 35 36 1 143 550 +34 35 36 2 83 650 +36 37 38 2 83 650 +36 37 39 1 143 550 +36 40 44 1 180 50 +37 39 40 1 143 550 +38 39 40 2 83 650 +40 41 42 2 83 650 +40 41 43 1 143 550 +40 44 48 1 180 50 +41 43 44 1 143 550 +42 43 44 2 83 650 +44 45 46 2 83 650 +44 45 47 1 143 550 +44 48 52 1 180 50 +45 47 48 1 143 550 +46 47 48 2 83 650 +48 49 50 2 83 650 +48 49 51 1 143 550 +48 52 56 1 180 50 +49 51 52 1 143 550 +50 51 52 2 83 650 +52 53 54 2 83 650 +52 53 55 1 143 550 +52 56 60 1 180 50 +53 55 56 1 143 550 +54 55 56 2 83 650 +56 57 58 2 83 650 +56 57 59 1 143 550 +56 60 64 1 180 50 +57 59 60 1 143 550 +58 59 60 2 83 650 +60 61 62 2 83 650 +60 61 63 1 143 550 +60 64 68 1 180 50 +61 63 64 1 143 550 +62 63 64 2 83 650 +64 65 66 2 83 650 +64 65 67 1 143 550 +64 68 72 1 180 50 +65 67 68 1 143 550 +66 67 68 2 83 650 +68 69 70 2 83 650 +68 69 71 1 143 550 +68 72 76 1 180 50 +69 71 72 1 143 550 +70 71 72 2 83 650 +72 73 74 2 83 650 +72 73 75 1 143 550 +72 76 80 1 180 50 +73 75 76 1 143 550 +74 75 76 2 83 650 +76 77 78 2 83 650 +76 77 79 1 143 550 +76 80 84 1 180 50 +77 79 80 1 143 550 +78 79 80 2 83 650 +80 81 82 2 83 650 +80 81 83 1 143 550 +81 83 84 1 143 550 +82 83 84 2 83 650 +84 85 86 2 83 650 +84 85 87 1 143 550 +1 4 7 1 165 50 +80 84 87 1 165 50 +[ dihedrals ] +4 2 1 3 2 0.0 50.0 +4 6 7 5 2 0.0 50.0 +8 6 5 7 2 0.0 50.0 +8 10 11 9 2 0.0 50.0 +12 10 9 11 2 0.0 50.0 +12 14 15 13 2 0.0 50.0 +16 14 13 15 2 0.0 50.0 +16 18 19 17 2 0.0 50.0 +20 18 17 19 2 0.0 50.0 +20 22 23 21 2 0.0 50.0 +24 22 21 23 2 0.0 50.0 +24 26 27 25 2 0.0 50.0 +28 26 25 27 2 0.0 50.0 +28 30 31 29 2 0.0 50.0 +32 30 29 31 2 0.0 50.0 +32 34 35 33 2 0.0 50.0 +36 34 33 35 2 0.0 50.0 +36 38 39 37 2 0.0 50.0 +40 38 37 39 2 0.0 50.0 +40 42 43 41 2 0.0 50.0 +44 42 41 43 2 0.0 50.0 +44 46 47 45 2 0.0 50.0 +48 46 45 47 2 0.0 50.0 +48 50 51 49 2 0.0 50.0 +52 50 49 51 2 0.0 50.0 +52 54 55 53 2 0.0 50.0 +56 54 53 55 2 0.0 50.0 +56 58 59 57 2 0.0 50.0 +60 58 57 59 2 0.0 50.0 +60 62 63 61 2 0.0 50.0 +64 62 61 63 2 0.0 50.0 +64 66 67 65 2 0.0 50.0 +68 66 65 67 2 0.0 50.0 +68 70 71 69 2 0.0 50.0 +72 70 69 71 2 0.0 50.0 +72 74 75 73 2 0.0 50.0 +76 74 73 75 2 0.0 50.0 +76 78 79 77 2 0.0 50.0 +80 78 77 79 2 0.0 50.0 +80 82 83 81 2 0.0 50.0 +84 82 81 83 2 0.0 50.0 +84 86 87 85 2 0.0 50.0 +[ constraints ] +1 2 1 0.32500 +1 3 1 0.32500 +2 3 1 0.32500 +5 6 1 0.32500 +5 7 1 0.32500 +6 7 1 0.32500 +9 10 1 0.32500 +9 11 1 0.32500 +10 11 1 0.32500 +13 14 1 0.32500 +13 15 1 0.32500 +14 15 1 0.32500 +17 18 1 0.32500 +17 19 1 0.32500 +18 19 1 0.32500 +21 22 1 0.32500 +21 23 1 0.32500 +22 23 1 0.32500 +25 26 1 0.32500 +25 27 1 0.32500 +26 27 1 0.32500 +29 30 1 0.32500 +29 31 1 0.32500 +30 31 1 0.32500 +33 34 1 0.32500 +33 35 1 0.32500 +34 35 1 0.32500 +37 38 1 0.32500 +37 39 1 0.32500 +38 39 1 0.32500 +41 42 1 0.32500 +41 43 1 0.32500 +42 43 1 0.32500 +45 46 1 0.32500 +45 47 1 0.32500 +46 47 1 0.32500 +49 50 1 0.32500 +49 51 1 0.32500 +50 51 1 0.32500 +53 54 1 0.32500 +53 55 1 0.32500 +54 55 1 0.32500 +57 58 1 0.32500 +57 59 1 0.32500 +58 59 1 0.32500 +61 62 1 0.32500 +61 63 1 0.32500 +62 63 1 0.32500 +65 66 1 0.32500 +65 67 1 0.32500 +66 67 1 0.32500 +69 70 1 0.32500 +69 71 1 0.32500 +70 71 1 0.32500 +73 74 1 0.32500 +73 75 1 0.32500 +74 75 1 0.32500 +77 78 1 0.32500 +77 79 1 0.32500 +78 79 1 0.32500 +81 82 1 0.32500 +81 83 1 0.32500 +82 83 1 0.32500 +85 86 1 0.32500 +85 87 1 0.32500 +86 87 1 0.32500 +#ifdef POSRES +#define POSRES_FC 150.00 +#ifndef POSRES_FC +#endif +[ position_restraints ] +1 1 POSRES_FC POSRES_FC POSRES_FC +2 1 POSRES_FC POSRES_FC POSRES_FC +3 1 POSRES_FC POSRES_FC POSRES_FC +4 1 POSRES_FC POSRES_FC POSRES_FC +5 1 POSRES_FC POSRES_FC POSRES_FC +6 1 POSRES_FC POSRES_FC POSRES_FC +7 1 POSRES_FC POSRES_FC POSRES_FC +8 1 POSRES_FC POSRES_FC POSRES_FC +9 1 POSRES_FC POSRES_FC POSRES_FC +10 1 POSRES_FC POSRES_FC POSRES_FC +11 1 POSRES_FC POSRES_FC POSRES_FC +12 1 POSRES_FC POSRES_FC POSRES_FC +13 1 POSRES_FC POSRES_FC POSRES_FC +14 1 POSRES_FC POSRES_FC POSRES_FC +15 1 POSRES_FC POSRES_FC POSRES_FC +16 1 POSRES_FC POSRES_FC POSRES_FC +17 1 POSRES_FC POSRES_FC POSRES_FC +18 1 POSRES_FC POSRES_FC POSRES_FC +19 1 POSRES_FC POSRES_FC POSRES_FC +20 1 POSRES_FC POSRES_FC POSRES_FC +21 1 POSRES_FC POSRES_FC POSRES_FC +22 1 POSRES_FC POSRES_FC POSRES_FC +23 1 POSRES_FC POSRES_FC POSRES_FC +24 1 POSRES_FC POSRES_FC POSRES_FC +25 1 POSRES_FC POSRES_FC POSRES_FC +26 1 POSRES_FC POSRES_FC POSRES_FC +27 1 POSRES_FC POSRES_FC POSRES_FC +28 1 POSRES_FC POSRES_FC POSRES_FC +29 1 POSRES_FC POSRES_FC POSRES_FC +30 1 POSRES_FC POSRES_FC POSRES_FC +31 1 POSRES_FC POSRES_FC POSRES_FC +32 1 POSRES_FC POSRES_FC POSRES_FC +33 1 POSRES_FC POSRES_FC POSRES_FC +34 1 POSRES_FC POSRES_FC POSRES_FC +35 1 POSRES_FC POSRES_FC POSRES_FC +36 1 POSRES_FC POSRES_FC POSRES_FC +37 1 POSRES_FC POSRES_FC POSRES_FC +38 1 POSRES_FC POSRES_FC POSRES_FC +39 1 POSRES_FC POSRES_FC POSRES_FC +40 1 POSRES_FC POSRES_FC POSRES_FC +41 1 POSRES_FC POSRES_FC POSRES_FC +42 1 POSRES_FC POSRES_FC POSRES_FC +43 1 POSRES_FC POSRES_FC POSRES_FC +44 1 POSRES_FC POSRES_FC POSRES_FC +45 1 POSRES_FC POSRES_FC POSRES_FC +46 1 POSRES_FC POSRES_FC POSRES_FC +47 1 POSRES_FC POSRES_FC POSRES_FC +48 1 POSRES_FC POSRES_FC POSRES_FC +49 1 POSRES_FC POSRES_FC POSRES_FC +50 1 POSRES_FC POSRES_FC POSRES_FC +51 1 POSRES_FC POSRES_FC POSRES_FC +52 1 POSRES_FC POSRES_FC POSRES_FC +53 1 POSRES_FC POSRES_FC POSRES_FC +54 1 POSRES_FC POSRES_FC POSRES_FC +55 1 POSRES_FC POSRES_FC POSRES_FC +56 1 POSRES_FC POSRES_FC POSRES_FC +57 1 POSRES_FC POSRES_FC POSRES_FC +58 1 POSRES_FC POSRES_FC POSRES_FC +59 1 POSRES_FC POSRES_FC POSRES_FC +60 1 POSRES_FC POSRES_FC POSRES_FC +61 1 POSRES_FC POSRES_FC POSRES_FC +62 1 POSRES_FC POSRES_FC POSRES_FC +63 1 POSRES_FC POSRES_FC POSRES_FC +64 1 POSRES_FC POSRES_FC POSRES_FC +65 1 POSRES_FC POSRES_FC POSRES_FC +66 1 POSRES_FC POSRES_FC POSRES_FC +67 1 POSRES_FC POSRES_FC POSRES_FC +68 1 POSRES_FC POSRES_FC POSRES_FC +69 1 POSRES_FC POSRES_FC POSRES_FC +70 1 POSRES_FC POSRES_FC POSRES_FC +71 1 POSRES_FC POSRES_FC POSRES_FC +72 1 POSRES_FC POSRES_FC POSRES_FC +73 1 POSRES_FC POSRES_FC POSRES_FC +74 1 POSRES_FC POSRES_FC POSRES_FC +75 1 POSRES_FC POSRES_FC POSRES_FC +76 1 POSRES_FC POSRES_FC POSRES_FC +77 1 POSRES_FC POSRES_FC POSRES_FC +78 1 POSRES_FC POSRES_FC POSRES_FC +79 1 POSRES_FC POSRES_FC POSRES_FC +80 1 POSRES_FC POSRES_FC POSRES_FC +81 1 POSRES_FC POSRES_FC POSRES_FC +82 1 POSRES_FC POSRES_FC POSRES_FC +83 1 POSRES_FC POSRES_FC POSRES_FC +84 1 POSRES_FC POSRES_FC POSRES_FC +85 1 POSRES_FC POSRES_FC POSRES_FC +86 1 POSRES_FC POSRES_FC POSRES_FC +87 1 POSRES_FC POSRES_FC POSRES_FC +#endif From 2386969297243a19f4b278540e97992e86292c20 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:01:07 +0200 Subject: [PATCH 018/275] Create test2 --- polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 | 1 + 1 file changed, 1 insertion(+) create mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 new file mode 100644 index 00000000..86831545 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 @@ -0,0 +1 @@ +bla2 From dde773635911c6e07a4a582892c71ec0c11c71c1 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:01:44 +0200 Subject: [PATCH 019/275] Delete PPE_20mers.itp --- .../library_tests/martini3/PPE/PPE_20mers.itp | 442 ------------------ 1 file changed, 442 deletions(-) delete mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp b/polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp deleted file mode 100644 index cf238b8c..00000000 --- a/polyply/tests/test_data/library_tests/martini3/PPE/PPE_20mers.itp +++ /dev/null @@ -1,442 +0,0 @@ -[ moleculetype ] -PPE 1 -[ atoms ] -1 TC5 1 PPE BB 1 0.0000 ; -2 TC5 1 PPE BB 2 0.0000 ; -3 TC5 1 PPE BB 3 0.0000 ; -4 TC4 1 PPE BB 4 0.0000 ; -5 TC5 2 PPE BB 5 0.0000 ; -6 TC5 2 PPE BB 6 0.0000 ; -7 TC5 2 PPE BB 7 0.0000 ; -8 TC4 2 PPE BB 8 0.0000 ; -9 TC5 3 PPE BB 9 0.0000 ; -10 TC5 3 PPE BB 10 0.0000 ; -11 TC5 3 PPE BB 11 0.0000 ; -12 TC4 3 PPE BB 12 0.0000 ; -13 TC5 4 PPE BB 13 0.0000 ; -14 TC5 4 PPE BB 14 0.0000 ; -15 TC5 4 PPE BB 15 0.0000 ; -16 TC4 4 PPE BB 16 0.0000 ; -17 TC5 5 PPE BB 17 0.0000 ; -18 TC5 5 PPE BB 18 0.0000 ; -19 TC5 5 PPE BB 19 0.0000 ; -20 TC4 5 PPE BB 20 0.0000 ; -21 TC5 6 PPE BB 21 0.0000 ; -22 TC5 6 PPE BB 22 0.0000 ; -23 TC5 6 PPE BB 23 0.0000 ; -24 TC4 6 PPE BB 24 0.0000 ; -25 TC5 7 PPE BB 25 0.0000 ; -26 TC5 7 PPE BB 26 0.0000 ; -27 TC5 7 PPE BB 27 0.0000 ; -28 TC4 7 PPE BB 28 0.0000 ; -29 TC5 8 PPE BB 29 0.0000 ; -30 TC5 8 PPE BB 30 0.0000 ; -31 TC5 8 PPE BB 31 0.0000 ; -32 TC4 8 PPE BB 32 0.0000 ; -33 TC5 9 PPE BB 33 0.0000 ; -34 TC5 9 PPE BB 34 0.0000 ; -35 TC5 9 PPE BB 35 0.0000 ; -36 TC4 9 PPE BB 36 0.0000 ; -37 TC5 10 PPE BB 37 0.0000 ; -38 TC5 10 PPE BB 38 0.0000 ; -39 TC5 10 PPE BB 39 0.0000 ; -40 TC4 10 PPE BB 40 0.0000 ; -41 TC5 11 PPE BB 41 0.0000 ; -42 TC5 11 PPE BB 42 0.0000 ; -43 TC5 11 PPE BB 43 0.0000 ; -44 TC4 11 PPE BB 44 0.0000 ; -45 TC5 12 PPE BB 45 0.0000 ; -46 TC5 12 PPE BB 46 0.0000 ; -47 TC5 12 PPE BB 47 0.0000 ; -48 TC4 12 PPE BB 48 0.0000 ; -49 TC5 13 PPE BB 49 0.0000 ; -50 TC5 13 PPE BB 50 0.0000 ; -51 TC5 13 PPE BB 51 0.0000 ; -52 TC4 13 PPE BB 52 0.0000 ; -53 TC5 14 PPE BB 53 0.0000 ; -54 TC5 14 PPE BB 54 0.0000 ; -55 TC5 14 PPE BB 55 0.0000 ; -56 TC4 14 PPE BB 56 0.0000 ; -57 TC5 15 PPE BB 57 0.0000 ; -58 TC5 15 PPE BB 58 0.0000 ; -59 TC5 15 PPE BB 59 0.0000 ; -60 TC4 15 PPE BB 60 0.0000 ; -61 TC5 16 PPE BB 61 0.0000 ; -62 TC5 16 PPE BB 62 0.0000 ; -63 TC5 16 PPE BB 63 0.0000 ; -64 TC4 16 PPE BB 64 0.0000 ; -65 TC5 17 PPE BB 65 0.0000 ; -66 TC5 17 PPE BB 66 0.0000 ; -67 TC5 17 PPE BB 67 0.0000 ; -68 TC4 17 PPE BB 68 0.0000 ; -69 TC5 18 PPE BB 69 0.0000 ; -70 TC5 18 PPE BB 70 0.0000 ; -71 TC5 18 PPE BB 71 0.0000 ; -72 TC4 18 PPE BB 72 0.0000 ; -73 TC5 19 PPE BB 73 0.0000 ; -74 TC5 19 PPE BB 74 0.0000 ; -75 TC5 19 PPE BB 75 0.0000 ; -76 TC4 19 PPE BB 76 0.0000 ; -77 TC5 20 PPE BB 77 0.0000 ; -78 TC5 20 PPE BB 78 0.0000 ; -79 TC5 20 PPE BB 79 0.0000 ; -80 TC4 20 PPE BB 80 0.0000 ; -81 TC5 21 PPE BB 81 0.0000 ; -82 TC5 21 PPE BB 82 0.0000 ; -83 TC5 21 PPE BB 83 0.0000 ; -84 TC4 21 PPE BB 84 0.0000 ; -85 TC5 22 PPE BB 85 0.0000 ; -86 TC5 22 PPE BB 86 0.0000 ; -87 TC5 22 PPE BB 87 0.0000 ; -[ bonds ] -3 4 1 0.23400 9000 -4 5 1 0.23400 9000 -7 8 1 0.23400 9000 -8 9 1 0.23400 9000 -11 12 1 0.23400 9000 -12 13 1 0.23400 9000 -15 16 1 0.23400 9000 -16 17 1 0.23400 9000 -19 20 1 0.23400 9000 -20 21 1 0.23400 9000 -23 24 1 0.23400 9000 -24 25 1 0.23400 9000 -27 28 1 0.23400 9000 -28 29 1 0.23400 9000 -31 32 1 0.23400 9000 -32 33 1 0.23400 9000 -35 36 1 0.23400 9000 -36 37 1 0.23400 9000 -39 40 1 0.23400 9000 -40 41 1 0.23400 9000 -43 44 1 0.23400 9000 -44 45 1 0.23400 9000 -47 48 1 0.23400 9000 -48 49 1 0.23400 9000 -51 52 1 0.23400 9000 -52 53 1 0.23400 9000 -55 56 1 0.23400 9000 -56 57 1 0.23400 9000 -59 60 1 0.23400 9000 -60 61 1 0.23400 9000 -63 64 1 0.23400 9000 -64 65 1 0.23400 9000 -67 68 1 0.23400 9000 -68 69 1 0.23400 9000 -71 72 1 0.23400 9000 -72 73 1 0.23400 9000 -75 76 1 0.23400 9000 -76 77 1 0.23400 9000 -79 80 1 0.23400 9000 -80 81 1 0.23400 9000 -83 84 1 0.23400 9000 -84 85 1 0.23400 9000 -[ angles ] -1 3 4 1 143 550 -2 3 4 2 83 650 -4 5 6 2 83 650 -4 5 7 1 143 550 -4 8 12 1 180 50 -5 7 8 1 143 550 -6 7 8 2 83 650 -8 9 10 2 83 650 -8 9 11 1 143 550 -8 12 16 1 180 50 -9 11 12 1 143 550 -10 11 12 2 83 650 -12 13 14 2 83 650 -12 13 15 1 143 550 -12 16 20 1 180 50 -13 15 16 1 143 550 -14 15 16 2 83 650 -16 17 18 2 83 650 -16 17 19 1 143 550 -16 20 24 1 180 50 -17 19 20 1 143 550 -18 19 20 2 83 650 -20 21 22 2 83 650 -20 21 23 1 143 550 -20 24 28 1 180 50 -21 23 24 1 143 550 -22 23 24 2 83 650 -24 25 26 2 83 650 -24 25 27 1 143 550 -24 28 32 1 180 50 -25 27 28 1 143 550 -26 27 28 2 83 650 -28 29 30 2 83 650 -28 29 31 1 143 550 -28 32 36 1 180 50 -29 31 32 1 143 550 -30 31 32 2 83 650 -32 33 34 2 83 650 -32 33 35 1 143 550 -32 36 40 1 180 50 -33 35 36 1 143 550 -34 35 36 2 83 650 -36 37 38 2 83 650 -36 37 39 1 143 550 -36 40 44 1 180 50 -37 39 40 1 143 550 -38 39 40 2 83 650 -40 41 42 2 83 650 -40 41 43 1 143 550 -40 44 48 1 180 50 -41 43 44 1 143 550 -42 43 44 2 83 650 -44 45 46 2 83 650 -44 45 47 1 143 550 -44 48 52 1 180 50 -45 47 48 1 143 550 -46 47 48 2 83 650 -48 49 50 2 83 650 -48 49 51 1 143 550 -48 52 56 1 180 50 -49 51 52 1 143 550 -50 51 52 2 83 650 -52 53 54 2 83 650 -52 53 55 1 143 550 -52 56 60 1 180 50 -53 55 56 1 143 550 -54 55 56 2 83 650 -56 57 58 2 83 650 -56 57 59 1 143 550 -56 60 64 1 180 50 -57 59 60 1 143 550 -58 59 60 2 83 650 -60 61 62 2 83 650 -60 61 63 1 143 550 -60 64 68 1 180 50 -61 63 64 1 143 550 -62 63 64 2 83 650 -64 65 66 2 83 650 -64 65 67 1 143 550 -64 68 72 1 180 50 -65 67 68 1 143 550 -66 67 68 2 83 650 -68 69 70 2 83 650 -68 69 71 1 143 550 -68 72 76 1 180 50 -69 71 72 1 143 550 -70 71 72 2 83 650 -72 73 74 2 83 650 -72 73 75 1 143 550 -72 76 80 1 180 50 -73 75 76 1 143 550 -74 75 76 2 83 650 -76 77 78 2 83 650 -76 77 79 1 143 550 -76 80 84 1 180 50 -77 79 80 1 143 550 -78 79 80 2 83 650 -80 81 82 2 83 650 -80 81 83 1 143 550 -81 83 84 1 143 550 -82 83 84 2 83 650 -84 85 86 2 83 650 -84 85 87 1 143 550 -1 4 7 1 165 50 -80 84 87 1 165 50 -[ dihedrals ] -4 2 1 3 2 0.0 50.0 -4 6 7 5 2 0.0 50.0 -8 6 5 7 2 0.0 50.0 -8 10 11 9 2 0.0 50.0 -12 10 9 11 2 0.0 50.0 -12 14 15 13 2 0.0 50.0 -16 14 13 15 2 0.0 50.0 -16 18 19 17 2 0.0 50.0 -20 18 17 19 2 0.0 50.0 -20 22 23 21 2 0.0 50.0 -24 22 21 23 2 0.0 50.0 -24 26 27 25 2 0.0 50.0 -28 26 25 27 2 0.0 50.0 -28 30 31 29 2 0.0 50.0 -32 30 29 31 2 0.0 50.0 -32 34 35 33 2 0.0 50.0 -36 34 33 35 2 0.0 50.0 -36 38 39 37 2 0.0 50.0 -40 38 37 39 2 0.0 50.0 -40 42 43 41 2 0.0 50.0 -44 42 41 43 2 0.0 50.0 -44 46 47 45 2 0.0 50.0 -48 46 45 47 2 0.0 50.0 -48 50 51 49 2 0.0 50.0 -52 50 49 51 2 0.0 50.0 -52 54 55 53 2 0.0 50.0 -56 54 53 55 2 0.0 50.0 -56 58 59 57 2 0.0 50.0 -60 58 57 59 2 0.0 50.0 -60 62 63 61 2 0.0 50.0 -64 62 61 63 2 0.0 50.0 -64 66 67 65 2 0.0 50.0 -68 66 65 67 2 0.0 50.0 -68 70 71 69 2 0.0 50.0 -72 70 69 71 2 0.0 50.0 -72 74 75 73 2 0.0 50.0 -76 74 73 75 2 0.0 50.0 -76 78 79 77 2 0.0 50.0 -80 78 77 79 2 0.0 50.0 -80 82 83 81 2 0.0 50.0 -84 82 81 83 2 0.0 50.0 -84 86 87 85 2 0.0 50.0 -[ constraints ] -1 2 1 0.32500 -1 3 1 0.32500 -2 3 1 0.32500 -5 6 1 0.32500 -5 7 1 0.32500 -6 7 1 0.32500 -9 10 1 0.32500 -9 11 1 0.32500 -10 11 1 0.32500 -13 14 1 0.32500 -13 15 1 0.32500 -14 15 1 0.32500 -17 18 1 0.32500 -17 19 1 0.32500 -18 19 1 0.32500 -21 22 1 0.32500 -21 23 1 0.32500 -22 23 1 0.32500 -25 26 1 0.32500 -25 27 1 0.32500 -26 27 1 0.32500 -29 30 1 0.32500 -29 31 1 0.32500 -30 31 1 0.32500 -33 34 1 0.32500 -33 35 1 0.32500 -34 35 1 0.32500 -37 38 1 0.32500 -37 39 1 0.32500 -38 39 1 0.32500 -41 42 1 0.32500 -41 43 1 0.32500 -42 43 1 0.32500 -45 46 1 0.32500 -45 47 1 0.32500 -46 47 1 0.32500 -49 50 1 0.32500 -49 51 1 0.32500 -50 51 1 0.32500 -53 54 1 0.32500 -53 55 1 0.32500 -54 55 1 0.32500 -57 58 1 0.32500 -57 59 1 0.32500 -58 59 1 0.32500 -61 62 1 0.32500 -61 63 1 0.32500 -62 63 1 0.32500 -65 66 1 0.32500 -65 67 1 0.32500 -66 67 1 0.32500 -69 70 1 0.32500 -69 71 1 0.32500 -70 71 1 0.32500 -73 74 1 0.32500 -73 75 1 0.32500 -74 75 1 0.32500 -77 78 1 0.32500 -77 79 1 0.32500 -78 79 1 0.32500 -81 82 1 0.32500 -81 83 1 0.32500 -82 83 1 0.32500 -85 86 1 0.32500 -85 87 1 0.32500 -86 87 1 0.32500 -#ifdef POSRES -#define POSRES_FC 150.00 -#ifndef POSRES_FC -#endif -[ position_restraints ] -1 1 POSRES_FC POSRES_FC POSRES_FC -2 1 POSRES_FC POSRES_FC POSRES_FC -3 1 POSRES_FC POSRES_FC POSRES_FC -4 1 POSRES_FC POSRES_FC POSRES_FC -5 1 POSRES_FC POSRES_FC POSRES_FC -6 1 POSRES_FC POSRES_FC POSRES_FC -7 1 POSRES_FC POSRES_FC POSRES_FC -8 1 POSRES_FC POSRES_FC POSRES_FC -9 1 POSRES_FC POSRES_FC POSRES_FC -10 1 POSRES_FC POSRES_FC POSRES_FC -11 1 POSRES_FC POSRES_FC POSRES_FC -12 1 POSRES_FC POSRES_FC POSRES_FC -13 1 POSRES_FC POSRES_FC POSRES_FC -14 1 POSRES_FC POSRES_FC POSRES_FC -15 1 POSRES_FC POSRES_FC POSRES_FC -16 1 POSRES_FC POSRES_FC POSRES_FC -17 1 POSRES_FC POSRES_FC POSRES_FC -18 1 POSRES_FC POSRES_FC POSRES_FC -19 1 POSRES_FC POSRES_FC POSRES_FC -20 1 POSRES_FC POSRES_FC POSRES_FC -21 1 POSRES_FC POSRES_FC POSRES_FC -22 1 POSRES_FC POSRES_FC POSRES_FC -23 1 POSRES_FC POSRES_FC POSRES_FC -24 1 POSRES_FC POSRES_FC POSRES_FC -25 1 POSRES_FC POSRES_FC POSRES_FC -26 1 POSRES_FC POSRES_FC POSRES_FC -27 1 POSRES_FC POSRES_FC POSRES_FC -28 1 POSRES_FC POSRES_FC POSRES_FC -29 1 POSRES_FC POSRES_FC POSRES_FC -30 1 POSRES_FC POSRES_FC POSRES_FC -31 1 POSRES_FC POSRES_FC POSRES_FC -32 1 POSRES_FC POSRES_FC POSRES_FC -33 1 POSRES_FC POSRES_FC POSRES_FC -34 1 POSRES_FC POSRES_FC POSRES_FC -35 1 POSRES_FC POSRES_FC POSRES_FC -36 1 POSRES_FC POSRES_FC POSRES_FC -37 1 POSRES_FC POSRES_FC POSRES_FC -38 1 POSRES_FC POSRES_FC POSRES_FC -39 1 POSRES_FC POSRES_FC POSRES_FC -40 1 POSRES_FC POSRES_FC POSRES_FC -41 1 POSRES_FC POSRES_FC POSRES_FC -42 1 POSRES_FC POSRES_FC POSRES_FC -43 1 POSRES_FC POSRES_FC POSRES_FC -44 1 POSRES_FC POSRES_FC POSRES_FC -45 1 POSRES_FC POSRES_FC POSRES_FC -46 1 POSRES_FC POSRES_FC POSRES_FC -47 1 POSRES_FC POSRES_FC POSRES_FC -48 1 POSRES_FC POSRES_FC POSRES_FC -49 1 POSRES_FC POSRES_FC POSRES_FC -50 1 POSRES_FC POSRES_FC POSRES_FC -51 1 POSRES_FC POSRES_FC POSRES_FC -52 1 POSRES_FC POSRES_FC POSRES_FC -53 1 POSRES_FC POSRES_FC POSRES_FC -54 1 POSRES_FC POSRES_FC POSRES_FC -55 1 POSRES_FC POSRES_FC POSRES_FC -56 1 POSRES_FC POSRES_FC POSRES_FC -57 1 POSRES_FC POSRES_FC POSRES_FC -58 1 POSRES_FC POSRES_FC POSRES_FC -59 1 POSRES_FC POSRES_FC POSRES_FC -60 1 POSRES_FC POSRES_FC POSRES_FC -61 1 POSRES_FC POSRES_FC POSRES_FC -62 1 POSRES_FC POSRES_FC POSRES_FC -63 1 POSRES_FC POSRES_FC POSRES_FC -64 1 POSRES_FC POSRES_FC POSRES_FC -65 1 POSRES_FC POSRES_FC POSRES_FC -66 1 POSRES_FC POSRES_FC POSRES_FC -67 1 POSRES_FC POSRES_FC POSRES_FC -68 1 POSRES_FC POSRES_FC POSRES_FC -69 1 POSRES_FC POSRES_FC POSRES_FC -70 1 POSRES_FC POSRES_FC POSRES_FC -71 1 POSRES_FC POSRES_FC POSRES_FC -72 1 POSRES_FC POSRES_FC POSRES_FC -73 1 POSRES_FC POSRES_FC POSRES_FC -74 1 POSRES_FC POSRES_FC POSRES_FC -75 1 POSRES_FC POSRES_FC POSRES_FC -76 1 POSRES_FC POSRES_FC POSRES_FC -77 1 POSRES_FC POSRES_FC POSRES_FC -78 1 POSRES_FC POSRES_FC POSRES_FC -79 1 POSRES_FC POSRES_FC POSRES_FC -80 1 POSRES_FC POSRES_FC POSRES_FC -81 1 POSRES_FC POSRES_FC POSRES_FC -82 1 POSRES_FC POSRES_FC POSRES_FC -83 1 POSRES_FC POSRES_FC POSRES_FC -84 1 POSRES_FC POSRES_FC POSRES_FC -85 1 POSRES_FC POSRES_FC POSRES_FC -86 1 POSRES_FC POSRES_FC POSRES_FC -87 1 POSRES_FC POSRES_FC POSRES_FC -#endif From f4c3400a156c72a88216f1adc1c6a20a6bbda031 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:01:51 +0200 Subject: [PATCH 020/275] Delete test --- polyply/tests/test_data/library_tests/martini3/PPE/test | 1 - 1 file changed, 1 deletion(-) delete mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/test diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/test b/polyply/tests/test_data/library_tests/martini3/PPE/test deleted file mode 100644 index a7f8d9e5..00000000 --- a/polyply/tests/test_data/library_tests/martini3/PPE/test +++ /dev/null @@ -1 +0,0 @@ -bla From 5c5747f5982a1ff9a2260c0a468241850182908f Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:02:10 +0200 Subject: [PATCH 021/275] Add files via upload --- .../martini3/PPE/polyply/PPE_20mers.itp | 442 ++++++++++++++++++ 1 file changed, 442 insertions(+) create mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp new file mode 100644 index 00000000..cf238b8c --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp @@ -0,0 +1,442 @@ +[ moleculetype ] +PPE 1 +[ atoms ] +1 TC5 1 PPE BB 1 0.0000 ; +2 TC5 1 PPE BB 2 0.0000 ; +3 TC5 1 PPE BB 3 0.0000 ; +4 TC4 1 PPE BB 4 0.0000 ; +5 TC5 2 PPE BB 5 0.0000 ; +6 TC5 2 PPE BB 6 0.0000 ; +7 TC5 2 PPE BB 7 0.0000 ; +8 TC4 2 PPE BB 8 0.0000 ; +9 TC5 3 PPE BB 9 0.0000 ; +10 TC5 3 PPE BB 10 0.0000 ; +11 TC5 3 PPE BB 11 0.0000 ; +12 TC4 3 PPE BB 12 0.0000 ; +13 TC5 4 PPE BB 13 0.0000 ; +14 TC5 4 PPE BB 14 0.0000 ; +15 TC5 4 PPE BB 15 0.0000 ; +16 TC4 4 PPE BB 16 0.0000 ; +17 TC5 5 PPE BB 17 0.0000 ; +18 TC5 5 PPE BB 18 0.0000 ; +19 TC5 5 PPE BB 19 0.0000 ; +20 TC4 5 PPE BB 20 0.0000 ; +21 TC5 6 PPE BB 21 0.0000 ; +22 TC5 6 PPE BB 22 0.0000 ; +23 TC5 6 PPE BB 23 0.0000 ; +24 TC4 6 PPE BB 24 0.0000 ; +25 TC5 7 PPE BB 25 0.0000 ; +26 TC5 7 PPE BB 26 0.0000 ; +27 TC5 7 PPE BB 27 0.0000 ; +28 TC4 7 PPE BB 28 0.0000 ; +29 TC5 8 PPE BB 29 0.0000 ; +30 TC5 8 PPE BB 30 0.0000 ; +31 TC5 8 PPE BB 31 0.0000 ; +32 TC4 8 PPE BB 32 0.0000 ; +33 TC5 9 PPE BB 33 0.0000 ; +34 TC5 9 PPE BB 34 0.0000 ; +35 TC5 9 PPE BB 35 0.0000 ; +36 TC4 9 PPE BB 36 0.0000 ; +37 TC5 10 PPE BB 37 0.0000 ; +38 TC5 10 PPE BB 38 0.0000 ; +39 TC5 10 PPE BB 39 0.0000 ; +40 TC4 10 PPE BB 40 0.0000 ; +41 TC5 11 PPE BB 41 0.0000 ; +42 TC5 11 PPE BB 42 0.0000 ; +43 TC5 11 PPE BB 43 0.0000 ; +44 TC4 11 PPE BB 44 0.0000 ; +45 TC5 12 PPE BB 45 0.0000 ; +46 TC5 12 PPE BB 46 0.0000 ; +47 TC5 12 PPE BB 47 0.0000 ; +48 TC4 12 PPE BB 48 0.0000 ; +49 TC5 13 PPE BB 49 0.0000 ; +50 TC5 13 PPE BB 50 0.0000 ; +51 TC5 13 PPE BB 51 0.0000 ; +52 TC4 13 PPE BB 52 0.0000 ; +53 TC5 14 PPE BB 53 0.0000 ; +54 TC5 14 PPE BB 54 0.0000 ; +55 TC5 14 PPE BB 55 0.0000 ; +56 TC4 14 PPE BB 56 0.0000 ; +57 TC5 15 PPE BB 57 0.0000 ; +58 TC5 15 PPE BB 58 0.0000 ; +59 TC5 15 PPE BB 59 0.0000 ; +60 TC4 15 PPE BB 60 0.0000 ; +61 TC5 16 PPE BB 61 0.0000 ; +62 TC5 16 PPE BB 62 0.0000 ; +63 TC5 16 PPE BB 63 0.0000 ; +64 TC4 16 PPE BB 64 0.0000 ; +65 TC5 17 PPE BB 65 0.0000 ; +66 TC5 17 PPE BB 66 0.0000 ; +67 TC5 17 PPE BB 67 0.0000 ; +68 TC4 17 PPE BB 68 0.0000 ; +69 TC5 18 PPE BB 69 0.0000 ; +70 TC5 18 PPE BB 70 0.0000 ; +71 TC5 18 PPE BB 71 0.0000 ; +72 TC4 18 PPE BB 72 0.0000 ; +73 TC5 19 PPE BB 73 0.0000 ; +74 TC5 19 PPE BB 74 0.0000 ; +75 TC5 19 PPE BB 75 0.0000 ; +76 TC4 19 PPE BB 76 0.0000 ; +77 TC5 20 PPE BB 77 0.0000 ; +78 TC5 20 PPE BB 78 0.0000 ; +79 TC5 20 PPE BB 79 0.0000 ; +80 TC4 20 PPE BB 80 0.0000 ; +81 TC5 21 PPE BB 81 0.0000 ; +82 TC5 21 PPE BB 82 0.0000 ; +83 TC5 21 PPE BB 83 0.0000 ; +84 TC4 21 PPE BB 84 0.0000 ; +85 TC5 22 PPE BB 85 0.0000 ; +86 TC5 22 PPE BB 86 0.0000 ; +87 TC5 22 PPE BB 87 0.0000 ; +[ bonds ] +3 4 1 0.23400 9000 +4 5 1 0.23400 9000 +7 8 1 0.23400 9000 +8 9 1 0.23400 9000 +11 12 1 0.23400 9000 +12 13 1 0.23400 9000 +15 16 1 0.23400 9000 +16 17 1 0.23400 9000 +19 20 1 0.23400 9000 +20 21 1 0.23400 9000 +23 24 1 0.23400 9000 +24 25 1 0.23400 9000 +27 28 1 0.23400 9000 +28 29 1 0.23400 9000 +31 32 1 0.23400 9000 +32 33 1 0.23400 9000 +35 36 1 0.23400 9000 +36 37 1 0.23400 9000 +39 40 1 0.23400 9000 +40 41 1 0.23400 9000 +43 44 1 0.23400 9000 +44 45 1 0.23400 9000 +47 48 1 0.23400 9000 +48 49 1 0.23400 9000 +51 52 1 0.23400 9000 +52 53 1 0.23400 9000 +55 56 1 0.23400 9000 +56 57 1 0.23400 9000 +59 60 1 0.23400 9000 +60 61 1 0.23400 9000 +63 64 1 0.23400 9000 +64 65 1 0.23400 9000 +67 68 1 0.23400 9000 +68 69 1 0.23400 9000 +71 72 1 0.23400 9000 +72 73 1 0.23400 9000 +75 76 1 0.23400 9000 +76 77 1 0.23400 9000 +79 80 1 0.23400 9000 +80 81 1 0.23400 9000 +83 84 1 0.23400 9000 +84 85 1 0.23400 9000 +[ angles ] +1 3 4 1 143 550 +2 3 4 2 83 650 +4 5 6 2 83 650 +4 5 7 1 143 550 +4 8 12 1 180 50 +5 7 8 1 143 550 +6 7 8 2 83 650 +8 9 10 2 83 650 +8 9 11 1 143 550 +8 12 16 1 180 50 +9 11 12 1 143 550 +10 11 12 2 83 650 +12 13 14 2 83 650 +12 13 15 1 143 550 +12 16 20 1 180 50 +13 15 16 1 143 550 +14 15 16 2 83 650 +16 17 18 2 83 650 +16 17 19 1 143 550 +16 20 24 1 180 50 +17 19 20 1 143 550 +18 19 20 2 83 650 +20 21 22 2 83 650 +20 21 23 1 143 550 +20 24 28 1 180 50 +21 23 24 1 143 550 +22 23 24 2 83 650 +24 25 26 2 83 650 +24 25 27 1 143 550 +24 28 32 1 180 50 +25 27 28 1 143 550 +26 27 28 2 83 650 +28 29 30 2 83 650 +28 29 31 1 143 550 +28 32 36 1 180 50 +29 31 32 1 143 550 +30 31 32 2 83 650 +32 33 34 2 83 650 +32 33 35 1 143 550 +32 36 40 1 180 50 +33 35 36 1 143 550 +34 35 36 2 83 650 +36 37 38 2 83 650 +36 37 39 1 143 550 +36 40 44 1 180 50 +37 39 40 1 143 550 +38 39 40 2 83 650 +40 41 42 2 83 650 +40 41 43 1 143 550 +40 44 48 1 180 50 +41 43 44 1 143 550 +42 43 44 2 83 650 +44 45 46 2 83 650 +44 45 47 1 143 550 +44 48 52 1 180 50 +45 47 48 1 143 550 +46 47 48 2 83 650 +48 49 50 2 83 650 +48 49 51 1 143 550 +48 52 56 1 180 50 +49 51 52 1 143 550 +50 51 52 2 83 650 +52 53 54 2 83 650 +52 53 55 1 143 550 +52 56 60 1 180 50 +53 55 56 1 143 550 +54 55 56 2 83 650 +56 57 58 2 83 650 +56 57 59 1 143 550 +56 60 64 1 180 50 +57 59 60 1 143 550 +58 59 60 2 83 650 +60 61 62 2 83 650 +60 61 63 1 143 550 +60 64 68 1 180 50 +61 63 64 1 143 550 +62 63 64 2 83 650 +64 65 66 2 83 650 +64 65 67 1 143 550 +64 68 72 1 180 50 +65 67 68 1 143 550 +66 67 68 2 83 650 +68 69 70 2 83 650 +68 69 71 1 143 550 +68 72 76 1 180 50 +69 71 72 1 143 550 +70 71 72 2 83 650 +72 73 74 2 83 650 +72 73 75 1 143 550 +72 76 80 1 180 50 +73 75 76 1 143 550 +74 75 76 2 83 650 +76 77 78 2 83 650 +76 77 79 1 143 550 +76 80 84 1 180 50 +77 79 80 1 143 550 +78 79 80 2 83 650 +80 81 82 2 83 650 +80 81 83 1 143 550 +81 83 84 1 143 550 +82 83 84 2 83 650 +84 85 86 2 83 650 +84 85 87 1 143 550 +1 4 7 1 165 50 +80 84 87 1 165 50 +[ dihedrals ] +4 2 1 3 2 0.0 50.0 +4 6 7 5 2 0.0 50.0 +8 6 5 7 2 0.0 50.0 +8 10 11 9 2 0.0 50.0 +12 10 9 11 2 0.0 50.0 +12 14 15 13 2 0.0 50.0 +16 14 13 15 2 0.0 50.0 +16 18 19 17 2 0.0 50.0 +20 18 17 19 2 0.0 50.0 +20 22 23 21 2 0.0 50.0 +24 22 21 23 2 0.0 50.0 +24 26 27 25 2 0.0 50.0 +28 26 25 27 2 0.0 50.0 +28 30 31 29 2 0.0 50.0 +32 30 29 31 2 0.0 50.0 +32 34 35 33 2 0.0 50.0 +36 34 33 35 2 0.0 50.0 +36 38 39 37 2 0.0 50.0 +40 38 37 39 2 0.0 50.0 +40 42 43 41 2 0.0 50.0 +44 42 41 43 2 0.0 50.0 +44 46 47 45 2 0.0 50.0 +48 46 45 47 2 0.0 50.0 +48 50 51 49 2 0.0 50.0 +52 50 49 51 2 0.0 50.0 +52 54 55 53 2 0.0 50.0 +56 54 53 55 2 0.0 50.0 +56 58 59 57 2 0.0 50.0 +60 58 57 59 2 0.0 50.0 +60 62 63 61 2 0.0 50.0 +64 62 61 63 2 0.0 50.0 +64 66 67 65 2 0.0 50.0 +68 66 65 67 2 0.0 50.0 +68 70 71 69 2 0.0 50.0 +72 70 69 71 2 0.0 50.0 +72 74 75 73 2 0.0 50.0 +76 74 73 75 2 0.0 50.0 +76 78 79 77 2 0.0 50.0 +80 78 77 79 2 0.0 50.0 +80 82 83 81 2 0.0 50.0 +84 82 81 83 2 0.0 50.0 +84 86 87 85 2 0.0 50.0 +[ constraints ] +1 2 1 0.32500 +1 3 1 0.32500 +2 3 1 0.32500 +5 6 1 0.32500 +5 7 1 0.32500 +6 7 1 0.32500 +9 10 1 0.32500 +9 11 1 0.32500 +10 11 1 0.32500 +13 14 1 0.32500 +13 15 1 0.32500 +14 15 1 0.32500 +17 18 1 0.32500 +17 19 1 0.32500 +18 19 1 0.32500 +21 22 1 0.32500 +21 23 1 0.32500 +22 23 1 0.32500 +25 26 1 0.32500 +25 27 1 0.32500 +26 27 1 0.32500 +29 30 1 0.32500 +29 31 1 0.32500 +30 31 1 0.32500 +33 34 1 0.32500 +33 35 1 0.32500 +34 35 1 0.32500 +37 38 1 0.32500 +37 39 1 0.32500 +38 39 1 0.32500 +41 42 1 0.32500 +41 43 1 0.32500 +42 43 1 0.32500 +45 46 1 0.32500 +45 47 1 0.32500 +46 47 1 0.32500 +49 50 1 0.32500 +49 51 1 0.32500 +50 51 1 0.32500 +53 54 1 0.32500 +53 55 1 0.32500 +54 55 1 0.32500 +57 58 1 0.32500 +57 59 1 0.32500 +58 59 1 0.32500 +61 62 1 0.32500 +61 63 1 0.32500 +62 63 1 0.32500 +65 66 1 0.32500 +65 67 1 0.32500 +66 67 1 0.32500 +69 70 1 0.32500 +69 71 1 0.32500 +70 71 1 0.32500 +73 74 1 0.32500 +73 75 1 0.32500 +74 75 1 0.32500 +77 78 1 0.32500 +77 79 1 0.32500 +78 79 1 0.32500 +81 82 1 0.32500 +81 83 1 0.32500 +82 83 1 0.32500 +85 86 1 0.32500 +85 87 1 0.32500 +86 87 1 0.32500 +#ifdef POSRES +#define POSRES_FC 150.00 +#ifndef POSRES_FC +#endif +[ position_restraints ] +1 1 POSRES_FC POSRES_FC POSRES_FC +2 1 POSRES_FC POSRES_FC POSRES_FC +3 1 POSRES_FC POSRES_FC POSRES_FC +4 1 POSRES_FC POSRES_FC POSRES_FC +5 1 POSRES_FC POSRES_FC POSRES_FC +6 1 POSRES_FC POSRES_FC POSRES_FC +7 1 POSRES_FC POSRES_FC POSRES_FC +8 1 POSRES_FC POSRES_FC POSRES_FC +9 1 POSRES_FC POSRES_FC POSRES_FC +10 1 POSRES_FC POSRES_FC POSRES_FC +11 1 POSRES_FC POSRES_FC POSRES_FC +12 1 POSRES_FC POSRES_FC POSRES_FC +13 1 POSRES_FC POSRES_FC POSRES_FC +14 1 POSRES_FC POSRES_FC POSRES_FC +15 1 POSRES_FC POSRES_FC POSRES_FC +16 1 POSRES_FC POSRES_FC POSRES_FC +17 1 POSRES_FC POSRES_FC POSRES_FC +18 1 POSRES_FC POSRES_FC POSRES_FC +19 1 POSRES_FC POSRES_FC POSRES_FC +20 1 POSRES_FC POSRES_FC POSRES_FC +21 1 POSRES_FC POSRES_FC POSRES_FC +22 1 POSRES_FC POSRES_FC POSRES_FC +23 1 POSRES_FC POSRES_FC POSRES_FC +24 1 POSRES_FC POSRES_FC POSRES_FC +25 1 POSRES_FC POSRES_FC POSRES_FC +26 1 POSRES_FC POSRES_FC POSRES_FC +27 1 POSRES_FC POSRES_FC POSRES_FC +28 1 POSRES_FC POSRES_FC POSRES_FC +29 1 POSRES_FC POSRES_FC POSRES_FC +30 1 POSRES_FC POSRES_FC POSRES_FC +31 1 POSRES_FC POSRES_FC POSRES_FC +32 1 POSRES_FC POSRES_FC POSRES_FC +33 1 POSRES_FC POSRES_FC POSRES_FC +34 1 POSRES_FC POSRES_FC POSRES_FC +35 1 POSRES_FC POSRES_FC POSRES_FC +36 1 POSRES_FC POSRES_FC POSRES_FC +37 1 POSRES_FC POSRES_FC POSRES_FC +38 1 POSRES_FC POSRES_FC POSRES_FC +39 1 POSRES_FC POSRES_FC POSRES_FC +40 1 POSRES_FC POSRES_FC POSRES_FC +41 1 POSRES_FC POSRES_FC POSRES_FC +42 1 POSRES_FC POSRES_FC POSRES_FC +43 1 POSRES_FC POSRES_FC POSRES_FC +44 1 POSRES_FC POSRES_FC POSRES_FC +45 1 POSRES_FC POSRES_FC POSRES_FC +46 1 POSRES_FC POSRES_FC POSRES_FC +47 1 POSRES_FC POSRES_FC POSRES_FC +48 1 POSRES_FC POSRES_FC POSRES_FC +49 1 POSRES_FC POSRES_FC POSRES_FC +50 1 POSRES_FC POSRES_FC POSRES_FC +51 1 POSRES_FC POSRES_FC POSRES_FC +52 1 POSRES_FC POSRES_FC POSRES_FC +53 1 POSRES_FC POSRES_FC POSRES_FC +54 1 POSRES_FC POSRES_FC POSRES_FC +55 1 POSRES_FC POSRES_FC POSRES_FC +56 1 POSRES_FC POSRES_FC POSRES_FC +57 1 POSRES_FC POSRES_FC POSRES_FC +58 1 POSRES_FC POSRES_FC POSRES_FC +59 1 POSRES_FC POSRES_FC POSRES_FC +60 1 POSRES_FC POSRES_FC POSRES_FC +61 1 POSRES_FC POSRES_FC POSRES_FC +62 1 POSRES_FC POSRES_FC POSRES_FC +63 1 POSRES_FC POSRES_FC POSRES_FC +64 1 POSRES_FC POSRES_FC POSRES_FC +65 1 POSRES_FC POSRES_FC POSRES_FC +66 1 POSRES_FC POSRES_FC POSRES_FC +67 1 POSRES_FC POSRES_FC POSRES_FC +68 1 POSRES_FC POSRES_FC POSRES_FC +69 1 POSRES_FC POSRES_FC POSRES_FC +70 1 POSRES_FC POSRES_FC POSRES_FC +71 1 POSRES_FC POSRES_FC POSRES_FC +72 1 POSRES_FC POSRES_FC POSRES_FC +73 1 POSRES_FC POSRES_FC POSRES_FC +74 1 POSRES_FC POSRES_FC POSRES_FC +75 1 POSRES_FC POSRES_FC POSRES_FC +76 1 POSRES_FC POSRES_FC POSRES_FC +77 1 POSRES_FC POSRES_FC POSRES_FC +78 1 POSRES_FC POSRES_FC POSRES_FC +79 1 POSRES_FC POSRES_FC POSRES_FC +80 1 POSRES_FC POSRES_FC POSRES_FC +81 1 POSRES_FC POSRES_FC POSRES_FC +82 1 POSRES_FC POSRES_FC POSRES_FC +83 1 POSRES_FC POSRES_FC POSRES_FC +84 1 POSRES_FC POSRES_FC POSRES_FC +85 1 POSRES_FC POSRES_FC POSRES_FC +86 1 POSRES_FC POSRES_FC POSRES_FC +87 1 POSRES_FC POSRES_FC POSRES_FC +#endif From 1708a608b26f2b7980d6cd4d5ec19aec15b7d653 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:03:17 +0200 Subject: [PATCH 022/275] Delete test2 --- polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 | 1 - 1 file changed, 1 deletion(-) delete mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 deleted file mode 100644 index 86831545..00000000 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/test2 +++ /dev/null @@ -1 +0,0 @@ -bla2 From e87c8d3b957593788f0ec243944b2770de381fd6 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:04:26 +0200 Subject: [PATCH 023/275] Create command --- .../tests/test_data/library_tests/martini3/PPE/polyply/command | 1 + 1 file changed, 1 insertion(+) create mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/polyply/command diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command new file mode 100644 index 00000000..9caf5db8 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command @@ -0,0 +1 @@ +polyply gen_params -lib martini3 -seq PPEinit:1 PPE:20 PPEend:1 -o out.itp -name PPE From b768f0d7a5562ca1f0dc3827fd186f069c9d9dd6 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:06:29 +0200 Subject: [PATCH 024/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 9 ++- polyply/data/martini3/PPEinit.martini3.ff | 68 +++++++++++++++++++++++ polyply/data/martini3/PPEter.martini3.ff | 63 +++++++++++++++++++++ 3 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 polyply/data/martini3/PPEinit.martini3.ff create mode 100644 polyply/data/martini3/PPEter.martini3.ff diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index 3449c2a5..06b7f2c5 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -11,7 +11,7 @@ polyply PPEs [ moleculetype ] -PPE 4 +PPE 3 [ atoms ] ; nr type resnr residu atom cgnr charge @@ -41,13 +41,12 @@ PPE 4 resname "PPE" [ bonds ] -+BB1 BB4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} +BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] BB4 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 +BB4 ++BB4 1 180 50 {"comment": "stiffness between triple bond beads" } +BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] -BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} - +BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} diff --git a/polyply/data/martini3/PPEinit.martini3.ff b/polyply/data/martini3/PPEinit.martini3.ff new file mode 100644 index 00000000..04e1646c --- /dev/null +++ b/polyply/data/martini3/PPEinit.martini3.ff @@ -0,0 +1,68 @@ +; General remarks: +; After "polyplying" PPE to the desired polymer length, some manual adjustments are recommended: +; 1) PPE ends with an aromatic ring and not with a triple bond: Delete last bead of topology and coordinate file and all respective potentials using that bead. +; 2) To prevent bending over of last and first aromatic ring: Add an additional bond angle potential at both polymer ends. (k=50,phi0=165) +; (e.g. bond angle potential between 1-4-8 and between End-(End-4)-(End-8) ). +; 3) For furher explanation, please look at https://doi.org/10.1039/D1CP04237H. + +[ citations ] +Martini3 +polyply +PPEs + +[ moleculetype ] +PPEinit 3 + +[ atoms ] +; nr type resnr residu atom cgnr charge + 1 TC5 1 PPEinit BB1 1 0.0 + 2 TC5 1 PPEinit BB2 2 0.0 + 3 TC5 1 PPEinit BB3 3 0.0 + 4 TC4 1 PPEinit BB4 4 0.0 + 5 TC5 1 PPEinit BB5 5 0.0 + 6 TC5 1 PPEinit BB6 6 0.0 + 7 TC5 1 PPEinit BB7 7 0.0 + 8 TC4 1 PPEinit BB8 8 0.0 + +[ bonds ] +; ai aj funct + 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 7 8 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ constraints ] +; ai aj funct + 1 2 1 0.325 {"comment": "constr. aromatic ring"} + 1 3 1 0.325 {"comment": "constr. aromatic ring"} + 2 3 1 0.325 {"comment": "constr. aromatic ring"} + 5 6 1 0.325 {"comment": "constr. aromatic ring"} + 5 7 1 0.325 {"comment": "constr. aromatic ring"} + 6 7 1 0.325 {"comment": "constr. aromatic ring"} + +[ angles ] + 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 4 5 6 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 5 7 8 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 6 7 8 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 1 4 8 1 165 50 {"comment": "prevent start from bending over"} + +[ dihedrals ] + 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} + 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} + +[ link ] +resname "PPE|PPEinit" + +[ bonds ] +BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ angles ] +BB8 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +BB8 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 BB8 +BB4 2 180 50 {"comment": "bending stiffness backbone" } +BB8 +BB4 ++BB4 2 180 50 {"comment": "bending stiffness backbone" } + +[ dihedrals ] +BB8 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} diff --git a/polyply/data/martini3/PPEter.martini3.ff b/polyply/data/martini3/PPEter.martini3.ff new file mode 100644 index 00000000..b1a1235c --- /dev/null +++ b/polyply/data/martini3/PPEter.martini3.ff @@ -0,0 +1,63 @@ +; General remarks: +; After "polyplying" PPE to the desired polymer length, some manual adjustments are recommended: +; 1) PPE ends with an aromatic ring and not with a triple bond: Delete last bead of topology and coordinate file and all respective potentials using that bead. +; 2) To prevent bending over of last and first aromatic ring: Add an additional bond angle potential at both polymer ends. (k=50,phi0=165) +; (e.g. bond angle potential between 1-4-8 and between End-(End-4)-(End-8) ). +; 3) For furher explanation, please look at https://doi.org/10.1039/D1CP04237H. + +[ citations ] +Martini3 +polyply +PPEs + +[ moleculetype ] +PPEter 3 + +[ atoms ] +; nr type resnr residu atom cgnr charge + 1 TC5 1 PPEter BB1 1 0.0 + 2 TC5 1 PPEter BB2 2 0.0 + 3 TC5 1 PPEter BB3 3 0.0 + 4 TC4 1 PPEter BB4 4 0.0 + 5 TC5 1 PPEter BB5 5 0.0 + 6 TC5 1 PPEter BB6 6 0.0 + 7 TC5 1 PPEter BB7 7 0.0 + +[ bonds ] +; ai aj funct + 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ constraints ] +; ai aj funct + 1 2 1 0.325 {"comment": "constr. aromatic ring"} + 1 3 1 0.325 {"comment": "constr. aromatic ring"} + 2 3 1 0.325 {"comment": "constr. aromatic ring"} + 5 6 1 0.325 {"comment": "constr. aromatic ring"} + 5 7 1 0.325 {"comment": "constr. aromatic ring"} + 6 7 1 0.325 {"comment": "constr. aromatic ring"} + +[ angles ] + 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 4 5 6 2 83 650 {"comment": "angle aromatic ring-triple bond"} + +[ dihedrals ] + 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} + 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} + +[ link ] +resname "PPE|PPEter" + +[ bonds ] +-BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ angles ] +-BB4 BB1 BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +-BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +-BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } +--BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } + +[ dihedrals ] +-BB4 BB2 BB3 BB1 2 0 50 {"comment": "improper dihedral right turn"} From bf9529566860774bdf22116b03539ff0c281e4b5 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:08:47 +0200 Subject: [PATCH 025/275] Update test_lib_files.py --- polyply/tests/test_lib_files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/polyply/tests/test_lib_files.py b/polyply/tests/test_lib_files.py index 25ab4839..5edace37 100644 --- a/polyply/tests/test_lib_files.py +++ b/polyply/tests/test_lib_files.py @@ -174,6 +174,7 @@ def _interaction_equal(interaction1, interaction2, inter_type): ['2016H66', 'C12E4'], ['2016H66', 'PE'], ['2016H66', 'PVA'], + ['2016H66', 'PPE'], ['2016H66', 'PMA'], ['2016H66', 'PS'], ['gromos53A6', 'P3HT'], From 3d6edfee78662c0a036f24d87f88c7d10b1bb340 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:09:37 +0200 Subject: [PATCH 026/275] Update test_lib_files.py --- polyply/tests/test_lib_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_lib_files.py b/polyply/tests/test_lib_files.py index 5edace37..56b5ec5f 100644 --- a/polyply/tests/test_lib_files.py +++ b/polyply/tests/test_lib_files.py @@ -174,7 +174,6 @@ def _interaction_equal(interaction1, interaction2, inter_type): ['2016H66', 'C12E4'], ['2016H66', 'PE'], ['2016H66', 'PVA'], - ['2016H66', 'PPE'], ['2016H66', 'PMA'], ['2016H66', 'PS'], ['gromos53A6', 'P3HT'], @@ -185,6 +184,7 @@ def _interaction_equal(interaction1, interaction2, inter_type): ['martini3', 'PE'], ['martini3', 'DEX'], ['martini3', 'P3HT'], + ['martini3', 'PPE'], ['martini2', 'PEO'], ['martini2', 'PS'], ['martini2', 'PEL'], From e891fe87c3fd49e65303ddbedeb7e6c8cff809f2 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:30:36 +0200 Subject: [PATCH 027/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 4 ++-- polyply/data/martini3/PPEinit.martini3.ff | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index 06b7f2c5..da4b4ec6 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -38,10 +38,10 @@ PPE 3 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} [ link ] -resname "PPE" +resname "PPE|PPEter" [ bonds ] -BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} +BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] BB4 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} diff --git a/polyply/data/martini3/PPEinit.martini3.ff b/polyply/data/martini3/PPEinit.martini3.ff index 04e1646c..0d3f01a8 100644 --- a/polyply/data/martini3/PPEinit.martini3.ff +++ b/polyply/data/martini3/PPEinit.martini3.ff @@ -51,9 +51,9 @@ PPEinit 3 [ dihedrals ] 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} - + 8 6 5 7 2 0 50 {"comment": "improper dihedral left turn"} [ link ] -resname "PPE|PPEinit" +resname "PPEinit|PPE" [ bonds ] BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} From 5161f70cd14556e01dbe17260b4ae2695a9dece3 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:33:13 +0200 Subject: [PATCH 028/275] Update command --- .../tests/test_data/library_tests/martini3/PPE/polyply/command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command index 9caf5db8..b974dfca 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command @@ -1 +1 @@ -polyply gen_params -lib martini3 -seq PPEinit:1 PPE:20 PPEend:1 -o out.itp -name PPE +polyply gen_params -lib martini3 -seq PPEinit:1 PPE:18 PPEend:1 -o PPE.itp -name PPE From 083aadec6f2725100e7ea1ab11ac166cd33a33e1 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:23:19 +0200 Subject: [PATCH 029/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 4 ++-- polyply/data/martini3/PPEinit.martini3.ff | 4 ++-- polyply/data/martini3/PPEter.martini3.ff | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index da4b4ec6..fd58127f 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -32,7 +32,7 @@ PPE 3 [ angles ] 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} [ dihedrals ] 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} @@ -44,7 +44,7 @@ resname "PPE|PPEter" BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] -BB4 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } diff --git a/polyply/data/martini3/PPEinit.martini3.ff b/polyply/data/martini3/PPEinit.martini3.ff index 0d3f01a8..2a05a7b7 100644 --- a/polyply/data/martini3/PPEinit.martini3.ff +++ b/polyply/data/martini3/PPEinit.martini3.ff @@ -41,9 +41,9 @@ PPEinit 3 [ angles ] 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 4 5 6 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} 5 7 8 1 143 550 {"comment": "angle aromatic ring-triple bond"} 6 7 8 1 83 650 {"comment": "angle aromatic ring-triple bond"} 1 4 8 1 165 50 {"comment": "prevent start from bending over"} diff --git a/polyply/data/martini3/PPEter.martini3.ff b/polyply/data/martini3/PPEter.martini3.ff index b1a1235c..fcaf176b 100644 --- a/polyply/data/martini3/PPEter.martini3.ff +++ b/polyply/data/martini3/PPEter.martini3.ff @@ -39,9 +39,9 @@ PPEter 3 [ angles ] 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 2 3 4 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 4 5 6 2 83 650 {"comment": "angle aromatic ring-triple bond"} + 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} [ dihedrals ] 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} @@ -54,7 +54,7 @@ resname "PPE|PPEter" -BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] --BB4 BB1 BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +-BB4 BB1 BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} -BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } --BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } From 9b861d8946681cdee85857e566701e969ab63ba2 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:24:31 +0200 Subject: [PATCH 030/275] Add files via upload --- .../martini3/PPE/polyply/PPE.itp | 442 ++++++++++++++++++ .../martini3/PPE/polyply/command | 2 +- 2 files changed, 443 insertions(+), 1 deletion(-) create mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp new file mode 100644 index 00000000..44ab2462 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp @@ -0,0 +1,442 @@ +[ moleculetype ] +PPE 4 +[ atoms ] +1 TC5 1 PPE BB 1 0.0000 ; +2 TC5 1 PPE BB 2 0.0000 ; +3 TC5 1 PPE BB 3 0.0000 ; +4 TC4 1 PPE BB 4 0.0000 ; +5 TC5 2 PPE BB 5 0.0000 ; +6 TC5 2 PPE BB 6 0.0000 ; +7 TC5 2 PPE BB 7 0.0000 ; +8 TC4 2 PPE BB 8 0.0000 ; +9 TC5 3 PPE BB 9 0.0000 ; +10 TC5 3 PPE BB 10 0.0000 ; +11 TC5 3 PPE BB 11 0.0000 ; +12 TC4 3 PPE BB 12 0.0000 ; +13 TC5 4 PPE BB 13 0.0000 ; +14 TC5 4 PPE BB 14 0.0000 ; +15 TC5 4 PPE BB 15 0.0000 ; +16 TC4 4 PPE BB 16 0.0000 ; +17 TC5 5 PPE BB 17 0.0000 ; +18 TC5 5 PPE BB 18 0.0000 ; +19 TC5 5 PPE BB 19 0.0000 ; +20 TC4 5 PPE BB 20 0.0000 ; +21 TC5 6 PPE BB 21 0.0000 ; +22 TC5 6 PPE BB 22 0.0000 ; +23 TC5 6 PPE BB 23 0.0000 ; +24 TC4 6 PPE BB 24 0.0000 ; +25 TC5 7 PPE BB 25 0.0000 ; +26 TC5 7 PPE BB 26 0.0000 ; +27 TC5 7 PPE BB 27 0.0000 ; +28 TC4 7 PPE BB 28 0.0000 ; +29 TC5 8 PPE BB 29 0.0000 ; +30 TC5 8 PPE BB 30 0.0000 ; +31 TC5 8 PPE BB 31 0.0000 ; +32 TC4 8 PPE BB 32 0.0000 ; +33 TC5 9 PPE BB 33 0.0000 ; +34 TC5 9 PPE BB 34 0.0000 ; +35 TC5 9 PPE BB 35 0.0000 ; +36 TC4 9 PPE BB 36 0.0000 ; +37 TC5 10 PPE BB 37 0.0000 ; +38 TC5 10 PPE BB 38 0.0000 ; +39 TC5 10 PPE BB 39 0.0000 ; +40 TC4 10 PPE BB 40 0.0000 ; +41 TC5 11 PPE BB 41 0.0000 ; +42 TC5 11 PPE BB 42 0.0000 ; +43 TC5 11 PPE BB 43 0.0000 ; +44 TC4 11 PPE BB 44 0.0000 ; +45 TC5 12 PPE BB 45 0.0000 ; +46 TC5 12 PPE BB 46 0.0000 ; +47 TC5 12 PPE BB 47 0.0000 ; +48 TC4 12 PPE BB 48 0.0000 ; +49 TC5 13 PPE BB 49 0.0000 ; +50 TC5 13 PPE BB 50 0.0000 ; +51 TC5 13 PPE BB 51 0.0000 ; +52 TC4 13 PPE BB 52 0.0000 ; +53 TC5 14 PPE BB 53 0.0000 ; +54 TC5 14 PPE BB 54 0.0000 ; +55 TC5 14 PPE BB 55 0.0000 ; +56 TC4 14 PPE BB 56 0.0000 ; +57 TC5 15 PPE BB 57 0.0000 ; +58 TC5 15 PPE BB 58 0.0000 ; +59 TC5 15 PPE BB 59 0.0000 ; +60 TC4 15 PPE BB 60 0.0000 ; +61 TC5 16 PPE BB 61 0.0000 ; +62 TC5 16 PPE BB 62 0.0000 ; +63 TC5 16 PPE BB 63 0.0000 ; +64 TC4 16 PPE BB 64 0.0000 ; +65 TC5 17 PPE BB 65 0.0000 ; +66 TC5 17 PPE BB 66 0.0000 ; +67 TC5 17 PPE BB 67 0.0000 ; +68 TC4 17 PPE BB 68 0.0000 ; +69 TC5 18 PPE BB 69 0.0000 ; +70 TC5 18 PPE BB 70 0.0000 ; +71 TC5 18 PPE BB 71 0.0000 ; +72 TC4 18 PPE BB 72 0.0000 ; +73 TC5 19 PPE BB 73 0.0000 ; +74 TC5 19 PPE BB 74 0.0000 ; +75 TC5 19 PPE BB 75 0.0000 ; +76 TC4 19 PPE BB 76 0.0000 ; +77 TC5 20 PPE BB 77 0.0000 ; +78 TC5 20 PPE BB 78 0.0000 ; +79 TC5 20 PPE BB 79 0.0000 ; +80 TC4 20 PPE BB 80 0.0000 ; +81 TC5 21 PPE BB 81 0.0000 ; +82 TC5 21 PPE BB 82 0.0000 ; +83 TC5 21 PPE BB 83 0.0000 ; +84 TC4 21 PPE BB 84 0.0000 ; +85 TC5 22 PPE BB 85 0.0000 ; +86 TC5 22 PPE BB 86 0.0000 ; +87 TC5 22 PPE BB 87 0.0000 ; +[ bonds ] +3 4 1 0.23400 9000 +4 5 1 0.23400 9000 +7 8 1 0.23400 9000 +8 9 1 0.23400 9000 +11 12 1 0.23400 9000 +12 13 1 0.23400 9000 +15 16 1 0.23400 9000 +16 17 1 0.23400 9000 +19 20 1 0.23400 9000 +20 21 1 0.23400 9000 +23 24 1 0.23400 9000 +24 25 1 0.23400 9000 +27 28 1 0.23400 9000 +28 29 1 0.23400 9000 +31 32 1 0.23400 9000 +32 33 1 0.23400 9000 +35 36 1 0.23400 9000 +36 37 1 0.23400 9000 +39 40 1 0.23400 9000 +40 41 1 0.23400 9000 +43 44 1 0.23400 9000 +44 45 1 0.23400 9000 +47 48 1 0.23400 9000 +48 49 1 0.23400 9000 +51 52 1 0.23400 9000 +52 53 1 0.23400 9000 +55 56 1 0.23400 9000 +56 57 1 0.23400 9000 +59 60 1 0.23400 9000 +60 61 1 0.23400 9000 +63 64 1 0.23400 9000 +64 65 1 0.23400 9000 +67 68 1 0.23400 9000 +68 69 1 0.23400 9000 +71 72 1 0.23400 9000 +72 73 1 0.23400 9000 +75 76 1 0.23400 9000 +76 77 1 0.23400 9000 +79 80 1 0.23400 9000 +80 81 1 0.23400 9000 +83 84 1 0.23400 9000 +84 85 1 0.23400 9000 +[ angles ] +1 3 4 1 143 550 +2 3 4 2 83 650 +4 5 6 2 83 650 +4 5 7 1 143 550 +4 8 12 1 180 50 +5 7 8 1 143 550 +6 7 8 2 83 650 +8 9 10 2 83 650 +8 9 11 1 143 550 +8 12 16 1 180 50 +9 11 12 1 143 550 +10 11 12 2 83 650 +12 13 14 2 83 650 +12 13 15 1 143 550 +12 16 20 1 180 50 +13 15 16 1 143 550 +14 15 16 2 83 650 +16 17 18 2 83 650 +16 17 19 1 143 550 +16 20 24 1 180 50 +17 19 20 1 143 550 +18 19 20 2 83 650 +20 21 22 2 83 650 +20 21 23 1 143 550 +20 24 28 1 180 50 +21 23 24 1 143 550 +22 23 24 2 83 650 +24 25 26 2 83 650 +24 25 27 1 143 550 +24 28 32 1 180 50 +25 27 28 1 143 550 +26 27 28 2 83 650 +28 29 30 2 83 650 +28 29 31 1 143 550 +28 32 36 1 180 50 +29 31 32 1 143 550 +30 31 32 2 83 650 +32 33 34 2 83 650 +32 33 35 1 143 550 +32 36 40 1 180 50 +33 35 36 1 143 550 +34 35 36 2 83 650 +36 37 38 2 83 650 +36 37 39 1 143 550 +36 40 44 1 180 50 +37 39 40 1 143 550 +38 39 40 2 83 650 +40 41 42 2 83 650 +40 41 43 1 143 550 +40 44 48 1 180 50 +41 43 44 1 143 550 +42 43 44 2 83 650 +44 45 46 2 83 650 +44 45 47 1 143 550 +44 48 52 1 180 50 +45 47 48 1 143 550 +46 47 48 2 83 650 +48 49 50 2 83 650 +48 49 51 1 143 550 +48 52 56 1 180 50 +49 51 52 1 143 550 +50 51 52 2 83 650 +52 53 54 2 83 650 +52 53 55 1 143 550 +52 56 60 1 180 50 +53 55 56 1 143 550 +54 55 56 2 83 650 +56 57 58 2 83 650 +56 57 59 1 143 550 +56 60 64 1 180 50 +57 59 60 1 143 550 +58 59 60 2 83 650 +60 61 62 2 83 650 +60 61 63 1 143 550 +60 64 68 1 180 50 +61 63 64 1 143 550 +62 63 64 2 83 650 +64 65 66 2 83 650 +64 65 67 1 143 550 +64 68 72 1 180 50 +65 67 68 1 143 550 +66 67 68 2 83 650 +68 69 70 2 83 650 +68 69 71 1 143 550 +68 72 76 1 180 50 +69 71 72 1 143 550 +70 71 72 2 83 650 +72 73 74 2 83 650 +72 73 75 1 143 550 +72 76 80 1 180 50 +73 75 76 1 143 550 +74 75 76 2 83 650 +76 77 78 2 83 650 +76 77 79 1 143 550 +76 80 84 1 180 50 +77 79 80 1 143 550 +78 79 80 2 83 650 +80 81 82 2 83 650 +80 81 83 1 143 550 +81 83 84 1 143 550 +82 83 84 2 83 650 +84 85 86 2 83 650 +84 85 87 1 143 550 +1 4 7 1 165 50 +80 84 87 1 165 50 +[ dihedrals ] +4 2 1 3 2 0.0 50.0 +4 6 7 5 2 0.0 50.0 +8 6 5 7 2 0.0 50.0 +8 10 11 9 2 0.0 50.0 +12 10 9 11 2 0.0 50.0 +12 14 15 13 2 0.0 50.0 +16 14 13 15 2 0.0 50.0 +16 18 19 17 2 0.0 50.0 +20 18 17 19 2 0.0 50.0 +20 22 23 21 2 0.0 50.0 +24 22 21 23 2 0.0 50.0 +24 26 27 25 2 0.0 50.0 +28 26 25 27 2 0.0 50.0 +28 30 31 29 2 0.0 50.0 +32 30 29 31 2 0.0 50.0 +32 34 35 33 2 0.0 50.0 +36 34 33 35 2 0.0 50.0 +36 38 39 37 2 0.0 50.0 +40 38 37 39 2 0.0 50.0 +40 42 43 41 2 0.0 50.0 +44 42 41 43 2 0.0 50.0 +44 46 47 45 2 0.0 50.0 +48 46 45 47 2 0.0 50.0 +48 50 51 49 2 0.0 50.0 +52 50 49 51 2 0.0 50.0 +52 54 55 53 2 0.0 50.0 +56 54 53 55 2 0.0 50.0 +56 58 59 57 2 0.0 50.0 +60 58 57 59 2 0.0 50.0 +60 62 63 61 2 0.0 50.0 +64 62 61 63 2 0.0 50.0 +64 66 67 65 2 0.0 50.0 +68 66 65 67 2 0.0 50.0 +68 70 71 69 2 0.0 50.0 +72 70 69 71 2 0.0 50.0 +72 74 75 73 2 0.0 50.0 +76 74 73 75 2 0.0 50.0 +76 78 79 77 2 0.0 50.0 +80 78 77 79 2 0.0 50.0 +80 82 83 81 2 0.0 50.0 +84 82 81 83 2 0.0 50.0 +84 86 87 85 2 0.0 50.0 +[ constraints ] +1 2 1 0.32500 +1 3 1 0.32500 +2 3 1 0.32500 +5 6 1 0.32500 +5 7 1 0.32500 +6 7 1 0.32500 +9 10 1 0.32500 +9 11 1 0.32500 +10 11 1 0.32500 +13 14 1 0.32500 +13 15 1 0.32500 +14 15 1 0.32500 +17 18 1 0.32500 +17 19 1 0.32500 +18 19 1 0.32500 +21 22 1 0.32500 +21 23 1 0.32500 +22 23 1 0.32500 +25 26 1 0.32500 +25 27 1 0.32500 +26 27 1 0.32500 +29 30 1 0.32500 +29 31 1 0.32500 +30 31 1 0.32500 +33 34 1 0.32500 +33 35 1 0.32500 +34 35 1 0.32500 +37 38 1 0.32500 +37 39 1 0.32500 +38 39 1 0.32500 +41 42 1 0.32500 +41 43 1 0.32500 +42 43 1 0.32500 +45 46 1 0.32500 +45 47 1 0.32500 +46 47 1 0.32500 +49 50 1 0.32500 +49 51 1 0.32500 +50 51 1 0.32500 +53 54 1 0.32500 +53 55 1 0.32500 +54 55 1 0.32500 +57 58 1 0.32500 +57 59 1 0.32500 +58 59 1 0.32500 +61 62 1 0.32500 +61 63 1 0.32500 +62 63 1 0.32500 +65 66 1 0.32500 +65 67 1 0.32500 +66 67 1 0.32500 +69 70 1 0.32500 +69 71 1 0.32500 +70 71 1 0.32500 +73 74 1 0.32500 +73 75 1 0.32500 +74 75 1 0.32500 +77 78 1 0.32500 +77 79 1 0.32500 +78 79 1 0.32500 +81 82 1 0.32500 +81 83 1 0.32500 +82 83 1 0.32500 +85 86 1 0.32500 +85 87 1 0.32500 +86 87 1 0.32500 +#ifdef POSRES +#define POSRES_FC 150.00 +#ifndef POSRES_FC +#endif +[ position_restraints ] +1 1 POSRES_FC POSRES_FC POSRES_FC +2 1 POSRES_FC POSRES_FC POSRES_FC +3 1 POSRES_FC POSRES_FC POSRES_FC +4 1 POSRES_FC POSRES_FC POSRES_FC +5 1 POSRES_FC POSRES_FC POSRES_FC +6 1 POSRES_FC POSRES_FC POSRES_FC +7 1 POSRES_FC POSRES_FC POSRES_FC +8 1 POSRES_FC POSRES_FC POSRES_FC +9 1 POSRES_FC POSRES_FC POSRES_FC +10 1 POSRES_FC POSRES_FC POSRES_FC +11 1 POSRES_FC POSRES_FC POSRES_FC +12 1 POSRES_FC POSRES_FC POSRES_FC +13 1 POSRES_FC POSRES_FC POSRES_FC +14 1 POSRES_FC POSRES_FC POSRES_FC +15 1 POSRES_FC POSRES_FC POSRES_FC +16 1 POSRES_FC POSRES_FC POSRES_FC +17 1 POSRES_FC POSRES_FC POSRES_FC +18 1 POSRES_FC POSRES_FC POSRES_FC +19 1 POSRES_FC POSRES_FC POSRES_FC +20 1 POSRES_FC POSRES_FC POSRES_FC +21 1 POSRES_FC POSRES_FC POSRES_FC +22 1 POSRES_FC POSRES_FC POSRES_FC +23 1 POSRES_FC POSRES_FC POSRES_FC +24 1 POSRES_FC POSRES_FC POSRES_FC +25 1 POSRES_FC POSRES_FC POSRES_FC +26 1 POSRES_FC POSRES_FC POSRES_FC +27 1 POSRES_FC POSRES_FC POSRES_FC +28 1 POSRES_FC POSRES_FC POSRES_FC +29 1 POSRES_FC POSRES_FC POSRES_FC +30 1 POSRES_FC POSRES_FC POSRES_FC +31 1 POSRES_FC POSRES_FC POSRES_FC +32 1 POSRES_FC POSRES_FC POSRES_FC +33 1 POSRES_FC POSRES_FC POSRES_FC +34 1 POSRES_FC POSRES_FC POSRES_FC +35 1 POSRES_FC POSRES_FC POSRES_FC +36 1 POSRES_FC POSRES_FC POSRES_FC +37 1 POSRES_FC POSRES_FC POSRES_FC +38 1 POSRES_FC POSRES_FC POSRES_FC +39 1 POSRES_FC POSRES_FC POSRES_FC +40 1 POSRES_FC POSRES_FC POSRES_FC +41 1 POSRES_FC POSRES_FC POSRES_FC +42 1 POSRES_FC POSRES_FC POSRES_FC +43 1 POSRES_FC POSRES_FC POSRES_FC +44 1 POSRES_FC POSRES_FC POSRES_FC +45 1 POSRES_FC POSRES_FC POSRES_FC +46 1 POSRES_FC POSRES_FC POSRES_FC +47 1 POSRES_FC POSRES_FC POSRES_FC +48 1 POSRES_FC POSRES_FC POSRES_FC +49 1 POSRES_FC POSRES_FC POSRES_FC +50 1 POSRES_FC POSRES_FC POSRES_FC +51 1 POSRES_FC POSRES_FC POSRES_FC +52 1 POSRES_FC POSRES_FC POSRES_FC +53 1 POSRES_FC POSRES_FC POSRES_FC +54 1 POSRES_FC POSRES_FC POSRES_FC +55 1 POSRES_FC POSRES_FC POSRES_FC +56 1 POSRES_FC POSRES_FC POSRES_FC +57 1 POSRES_FC POSRES_FC POSRES_FC +58 1 POSRES_FC POSRES_FC POSRES_FC +59 1 POSRES_FC POSRES_FC POSRES_FC +60 1 POSRES_FC POSRES_FC POSRES_FC +61 1 POSRES_FC POSRES_FC POSRES_FC +62 1 POSRES_FC POSRES_FC POSRES_FC +63 1 POSRES_FC POSRES_FC POSRES_FC +64 1 POSRES_FC POSRES_FC POSRES_FC +65 1 POSRES_FC POSRES_FC POSRES_FC +66 1 POSRES_FC POSRES_FC POSRES_FC +67 1 POSRES_FC POSRES_FC POSRES_FC +68 1 POSRES_FC POSRES_FC POSRES_FC +69 1 POSRES_FC POSRES_FC POSRES_FC +70 1 POSRES_FC POSRES_FC POSRES_FC +71 1 POSRES_FC POSRES_FC POSRES_FC +72 1 POSRES_FC POSRES_FC POSRES_FC +73 1 POSRES_FC POSRES_FC POSRES_FC +74 1 POSRES_FC POSRES_FC POSRES_FC +75 1 POSRES_FC POSRES_FC POSRES_FC +76 1 POSRES_FC POSRES_FC POSRES_FC +77 1 POSRES_FC POSRES_FC POSRES_FC +78 1 POSRES_FC POSRES_FC POSRES_FC +79 1 POSRES_FC POSRES_FC POSRES_FC +80 1 POSRES_FC POSRES_FC POSRES_FC +81 1 POSRES_FC POSRES_FC POSRES_FC +82 1 POSRES_FC POSRES_FC POSRES_FC +83 1 POSRES_FC POSRES_FC POSRES_FC +84 1 POSRES_FC POSRES_FC POSRES_FC +85 1 POSRES_FC POSRES_FC POSRES_FC +86 1 POSRES_FC POSRES_FC POSRES_FC +87 1 POSRES_FC POSRES_FC POSRES_FC +#endif diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command index b974dfca..6eead8af 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/command @@ -1 +1 @@ -polyply gen_params -lib martini3 -seq PPEinit:1 PPE:18 PPEend:1 -o PPE.itp -name PPE +polyply gen_params -lib martini3 -seq PPEinit:1 PPE:18 PPEter:1 -o PPE.itp -name PPE From 5af4242a2263318e6ddcde21499bb19f97f676b9 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:46:02 +0200 Subject: [PATCH 031/275] Delete PPE_20mers.itp --- .../martini3/PPE/polyply/PPE_20mers.itp | 442 ------------------ 1 file changed, 442 deletions(-) delete mode 100644 polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp deleted file mode 100644 index cf238b8c..00000000 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE_20mers.itp +++ /dev/null @@ -1,442 +0,0 @@ -[ moleculetype ] -PPE 1 -[ atoms ] -1 TC5 1 PPE BB 1 0.0000 ; -2 TC5 1 PPE BB 2 0.0000 ; -3 TC5 1 PPE BB 3 0.0000 ; -4 TC4 1 PPE BB 4 0.0000 ; -5 TC5 2 PPE BB 5 0.0000 ; -6 TC5 2 PPE BB 6 0.0000 ; -7 TC5 2 PPE BB 7 0.0000 ; -8 TC4 2 PPE BB 8 0.0000 ; -9 TC5 3 PPE BB 9 0.0000 ; -10 TC5 3 PPE BB 10 0.0000 ; -11 TC5 3 PPE BB 11 0.0000 ; -12 TC4 3 PPE BB 12 0.0000 ; -13 TC5 4 PPE BB 13 0.0000 ; -14 TC5 4 PPE BB 14 0.0000 ; -15 TC5 4 PPE BB 15 0.0000 ; -16 TC4 4 PPE BB 16 0.0000 ; -17 TC5 5 PPE BB 17 0.0000 ; -18 TC5 5 PPE BB 18 0.0000 ; -19 TC5 5 PPE BB 19 0.0000 ; -20 TC4 5 PPE BB 20 0.0000 ; -21 TC5 6 PPE BB 21 0.0000 ; -22 TC5 6 PPE BB 22 0.0000 ; -23 TC5 6 PPE BB 23 0.0000 ; -24 TC4 6 PPE BB 24 0.0000 ; -25 TC5 7 PPE BB 25 0.0000 ; -26 TC5 7 PPE BB 26 0.0000 ; -27 TC5 7 PPE BB 27 0.0000 ; -28 TC4 7 PPE BB 28 0.0000 ; -29 TC5 8 PPE BB 29 0.0000 ; -30 TC5 8 PPE BB 30 0.0000 ; -31 TC5 8 PPE BB 31 0.0000 ; -32 TC4 8 PPE BB 32 0.0000 ; -33 TC5 9 PPE BB 33 0.0000 ; -34 TC5 9 PPE BB 34 0.0000 ; -35 TC5 9 PPE BB 35 0.0000 ; -36 TC4 9 PPE BB 36 0.0000 ; -37 TC5 10 PPE BB 37 0.0000 ; -38 TC5 10 PPE BB 38 0.0000 ; -39 TC5 10 PPE BB 39 0.0000 ; -40 TC4 10 PPE BB 40 0.0000 ; -41 TC5 11 PPE BB 41 0.0000 ; -42 TC5 11 PPE BB 42 0.0000 ; -43 TC5 11 PPE BB 43 0.0000 ; -44 TC4 11 PPE BB 44 0.0000 ; -45 TC5 12 PPE BB 45 0.0000 ; -46 TC5 12 PPE BB 46 0.0000 ; -47 TC5 12 PPE BB 47 0.0000 ; -48 TC4 12 PPE BB 48 0.0000 ; -49 TC5 13 PPE BB 49 0.0000 ; -50 TC5 13 PPE BB 50 0.0000 ; -51 TC5 13 PPE BB 51 0.0000 ; -52 TC4 13 PPE BB 52 0.0000 ; -53 TC5 14 PPE BB 53 0.0000 ; -54 TC5 14 PPE BB 54 0.0000 ; -55 TC5 14 PPE BB 55 0.0000 ; -56 TC4 14 PPE BB 56 0.0000 ; -57 TC5 15 PPE BB 57 0.0000 ; -58 TC5 15 PPE BB 58 0.0000 ; -59 TC5 15 PPE BB 59 0.0000 ; -60 TC4 15 PPE BB 60 0.0000 ; -61 TC5 16 PPE BB 61 0.0000 ; -62 TC5 16 PPE BB 62 0.0000 ; -63 TC5 16 PPE BB 63 0.0000 ; -64 TC4 16 PPE BB 64 0.0000 ; -65 TC5 17 PPE BB 65 0.0000 ; -66 TC5 17 PPE BB 66 0.0000 ; -67 TC5 17 PPE BB 67 0.0000 ; -68 TC4 17 PPE BB 68 0.0000 ; -69 TC5 18 PPE BB 69 0.0000 ; -70 TC5 18 PPE BB 70 0.0000 ; -71 TC5 18 PPE BB 71 0.0000 ; -72 TC4 18 PPE BB 72 0.0000 ; -73 TC5 19 PPE BB 73 0.0000 ; -74 TC5 19 PPE BB 74 0.0000 ; -75 TC5 19 PPE BB 75 0.0000 ; -76 TC4 19 PPE BB 76 0.0000 ; -77 TC5 20 PPE BB 77 0.0000 ; -78 TC5 20 PPE BB 78 0.0000 ; -79 TC5 20 PPE BB 79 0.0000 ; -80 TC4 20 PPE BB 80 0.0000 ; -81 TC5 21 PPE BB 81 0.0000 ; -82 TC5 21 PPE BB 82 0.0000 ; -83 TC5 21 PPE BB 83 0.0000 ; -84 TC4 21 PPE BB 84 0.0000 ; -85 TC5 22 PPE BB 85 0.0000 ; -86 TC5 22 PPE BB 86 0.0000 ; -87 TC5 22 PPE BB 87 0.0000 ; -[ bonds ] -3 4 1 0.23400 9000 -4 5 1 0.23400 9000 -7 8 1 0.23400 9000 -8 9 1 0.23400 9000 -11 12 1 0.23400 9000 -12 13 1 0.23400 9000 -15 16 1 0.23400 9000 -16 17 1 0.23400 9000 -19 20 1 0.23400 9000 -20 21 1 0.23400 9000 -23 24 1 0.23400 9000 -24 25 1 0.23400 9000 -27 28 1 0.23400 9000 -28 29 1 0.23400 9000 -31 32 1 0.23400 9000 -32 33 1 0.23400 9000 -35 36 1 0.23400 9000 -36 37 1 0.23400 9000 -39 40 1 0.23400 9000 -40 41 1 0.23400 9000 -43 44 1 0.23400 9000 -44 45 1 0.23400 9000 -47 48 1 0.23400 9000 -48 49 1 0.23400 9000 -51 52 1 0.23400 9000 -52 53 1 0.23400 9000 -55 56 1 0.23400 9000 -56 57 1 0.23400 9000 -59 60 1 0.23400 9000 -60 61 1 0.23400 9000 -63 64 1 0.23400 9000 -64 65 1 0.23400 9000 -67 68 1 0.23400 9000 -68 69 1 0.23400 9000 -71 72 1 0.23400 9000 -72 73 1 0.23400 9000 -75 76 1 0.23400 9000 -76 77 1 0.23400 9000 -79 80 1 0.23400 9000 -80 81 1 0.23400 9000 -83 84 1 0.23400 9000 -84 85 1 0.23400 9000 -[ angles ] -1 3 4 1 143 550 -2 3 4 2 83 650 -4 5 6 2 83 650 -4 5 7 1 143 550 -4 8 12 1 180 50 -5 7 8 1 143 550 -6 7 8 2 83 650 -8 9 10 2 83 650 -8 9 11 1 143 550 -8 12 16 1 180 50 -9 11 12 1 143 550 -10 11 12 2 83 650 -12 13 14 2 83 650 -12 13 15 1 143 550 -12 16 20 1 180 50 -13 15 16 1 143 550 -14 15 16 2 83 650 -16 17 18 2 83 650 -16 17 19 1 143 550 -16 20 24 1 180 50 -17 19 20 1 143 550 -18 19 20 2 83 650 -20 21 22 2 83 650 -20 21 23 1 143 550 -20 24 28 1 180 50 -21 23 24 1 143 550 -22 23 24 2 83 650 -24 25 26 2 83 650 -24 25 27 1 143 550 -24 28 32 1 180 50 -25 27 28 1 143 550 -26 27 28 2 83 650 -28 29 30 2 83 650 -28 29 31 1 143 550 -28 32 36 1 180 50 -29 31 32 1 143 550 -30 31 32 2 83 650 -32 33 34 2 83 650 -32 33 35 1 143 550 -32 36 40 1 180 50 -33 35 36 1 143 550 -34 35 36 2 83 650 -36 37 38 2 83 650 -36 37 39 1 143 550 -36 40 44 1 180 50 -37 39 40 1 143 550 -38 39 40 2 83 650 -40 41 42 2 83 650 -40 41 43 1 143 550 -40 44 48 1 180 50 -41 43 44 1 143 550 -42 43 44 2 83 650 -44 45 46 2 83 650 -44 45 47 1 143 550 -44 48 52 1 180 50 -45 47 48 1 143 550 -46 47 48 2 83 650 -48 49 50 2 83 650 -48 49 51 1 143 550 -48 52 56 1 180 50 -49 51 52 1 143 550 -50 51 52 2 83 650 -52 53 54 2 83 650 -52 53 55 1 143 550 -52 56 60 1 180 50 -53 55 56 1 143 550 -54 55 56 2 83 650 -56 57 58 2 83 650 -56 57 59 1 143 550 -56 60 64 1 180 50 -57 59 60 1 143 550 -58 59 60 2 83 650 -60 61 62 2 83 650 -60 61 63 1 143 550 -60 64 68 1 180 50 -61 63 64 1 143 550 -62 63 64 2 83 650 -64 65 66 2 83 650 -64 65 67 1 143 550 -64 68 72 1 180 50 -65 67 68 1 143 550 -66 67 68 2 83 650 -68 69 70 2 83 650 -68 69 71 1 143 550 -68 72 76 1 180 50 -69 71 72 1 143 550 -70 71 72 2 83 650 -72 73 74 2 83 650 -72 73 75 1 143 550 -72 76 80 1 180 50 -73 75 76 1 143 550 -74 75 76 2 83 650 -76 77 78 2 83 650 -76 77 79 1 143 550 -76 80 84 1 180 50 -77 79 80 1 143 550 -78 79 80 2 83 650 -80 81 82 2 83 650 -80 81 83 1 143 550 -81 83 84 1 143 550 -82 83 84 2 83 650 -84 85 86 2 83 650 -84 85 87 1 143 550 -1 4 7 1 165 50 -80 84 87 1 165 50 -[ dihedrals ] -4 2 1 3 2 0.0 50.0 -4 6 7 5 2 0.0 50.0 -8 6 5 7 2 0.0 50.0 -8 10 11 9 2 0.0 50.0 -12 10 9 11 2 0.0 50.0 -12 14 15 13 2 0.0 50.0 -16 14 13 15 2 0.0 50.0 -16 18 19 17 2 0.0 50.0 -20 18 17 19 2 0.0 50.0 -20 22 23 21 2 0.0 50.0 -24 22 21 23 2 0.0 50.0 -24 26 27 25 2 0.0 50.0 -28 26 25 27 2 0.0 50.0 -28 30 31 29 2 0.0 50.0 -32 30 29 31 2 0.0 50.0 -32 34 35 33 2 0.0 50.0 -36 34 33 35 2 0.0 50.0 -36 38 39 37 2 0.0 50.0 -40 38 37 39 2 0.0 50.0 -40 42 43 41 2 0.0 50.0 -44 42 41 43 2 0.0 50.0 -44 46 47 45 2 0.0 50.0 -48 46 45 47 2 0.0 50.0 -48 50 51 49 2 0.0 50.0 -52 50 49 51 2 0.0 50.0 -52 54 55 53 2 0.0 50.0 -56 54 53 55 2 0.0 50.0 -56 58 59 57 2 0.0 50.0 -60 58 57 59 2 0.0 50.0 -60 62 63 61 2 0.0 50.0 -64 62 61 63 2 0.0 50.0 -64 66 67 65 2 0.0 50.0 -68 66 65 67 2 0.0 50.0 -68 70 71 69 2 0.0 50.0 -72 70 69 71 2 0.0 50.0 -72 74 75 73 2 0.0 50.0 -76 74 73 75 2 0.0 50.0 -76 78 79 77 2 0.0 50.0 -80 78 77 79 2 0.0 50.0 -80 82 83 81 2 0.0 50.0 -84 82 81 83 2 0.0 50.0 -84 86 87 85 2 0.0 50.0 -[ constraints ] -1 2 1 0.32500 -1 3 1 0.32500 -2 3 1 0.32500 -5 6 1 0.32500 -5 7 1 0.32500 -6 7 1 0.32500 -9 10 1 0.32500 -9 11 1 0.32500 -10 11 1 0.32500 -13 14 1 0.32500 -13 15 1 0.32500 -14 15 1 0.32500 -17 18 1 0.32500 -17 19 1 0.32500 -18 19 1 0.32500 -21 22 1 0.32500 -21 23 1 0.32500 -22 23 1 0.32500 -25 26 1 0.32500 -25 27 1 0.32500 -26 27 1 0.32500 -29 30 1 0.32500 -29 31 1 0.32500 -30 31 1 0.32500 -33 34 1 0.32500 -33 35 1 0.32500 -34 35 1 0.32500 -37 38 1 0.32500 -37 39 1 0.32500 -38 39 1 0.32500 -41 42 1 0.32500 -41 43 1 0.32500 -42 43 1 0.32500 -45 46 1 0.32500 -45 47 1 0.32500 -46 47 1 0.32500 -49 50 1 0.32500 -49 51 1 0.32500 -50 51 1 0.32500 -53 54 1 0.32500 -53 55 1 0.32500 -54 55 1 0.32500 -57 58 1 0.32500 -57 59 1 0.32500 -58 59 1 0.32500 -61 62 1 0.32500 -61 63 1 0.32500 -62 63 1 0.32500 -65 66 1 0.32500 -65 67 1 0.32500 -66 67 1 0.32500 -69 70 1 0.32500 -69 71 1 0.32500 -70 71 1 0.32500 -73 74 1 0.32500 -73 75 1 0.32500 -74 75 1 0.32500 -77 78 1 0.32500 -77 79 1 0.32500 -78 79 1 0.32500 -81 82 1 0.32500 -81 83 1 0.32500 -82 83 1 0.32500 -85 86 1 0.32500 -85 87 1 0.32500 -86 87 1 0.32500 -#ifdef POSRES -#define POSRES_FC 150.00 -#ifndef POSRES_FC -#endif -[ position_restraints ] -1 1 POSRES_FC POSRES_FC POSRES_FC -2 1 POSRES_FC POSRES_FC POSRES_FC -3 1 POSRES_FC POSRES_FC POSRES_FC -4 1 POSRES_FC POSRES_FC POSRES_FC -5 1 POSRES_FC POSRES_FC POSRES_FC -6 1 POSRES_FC POSRES_FC POSRES_FC -7 1 POSRES_FC POSRES_FC POSRES_FC -8 1 POSRES_FC POSRES_FC POSRES_FC -9 1 POSRES_FC POSRES_FC POSRES_FC -10 1 POSRES_FC POSRES_FC POSRES_FC -11 1 POSRES_FC POSRES_FC POSRES_FC -12 1 POSRES_FC POSRES_FC POSRES_FC -13 1 POSRES_FC POSRES_FC POSRES_FC -14 1 POSRES_FC POSRES_FC POSRES_FC -15 1 POSRES_FC POSRES_FC POSRES_FC -16 1 POSRES_FC POSRES_FC POSRES_FC -17 1 POSRES_FC POSRES_FC POSRES_FC -18 1 POSRES_FC POSRES_FC POSRES_FC -19 1 POSRES_FC POSRES_FC POSRES_FC -20 1 POSRES_FC POSRES_FC POSRES_FC -21 1 POSRES_FC POSRES_FC POSRES_FC -22 1 POSRES_FC POSRES_FC POSRES_FC -23 1 POSRES_FC POSRES_FC POSRES_FC -24 1 POSRES_FC POSRES_FC POSRES_FC -25 1 POSRES_FC POSRES_FC POSRES_FC -26 1 POSRES_FC POSRES_FC POSRES_FC -27 1 POSRES_FC POSRES_FC POSRES_FC -28 1 POSRES_FC POSRES_FC POSRES_FC -29 1 POSRES_FC POSRES_FC POSRES_FC -30 1 POSRES_FC POSRES_FC POSRES_FC -31 1 POSRES_FC POSRES_FC POSRES_FC -32 1 POSRES_FC POSRES_FC POSRES_FC -33 1 POSRES_FC POSRES_FC POSRES_FC -34 1 POSRES_FC POSRES_FC POSRES_FC -35 1 POSRES_FC POSRES_FC POSRES_FC -36 1 POSRES_FC POSRES_FC POSRES_FC -37 1 POSRES_FC POSRES_FC POSRES_FC -38 1 POSRES_FC POSRES_FC POSRES_FC -39 1 POSRES_FC POSRES_FC POSRES_FC -40 1 POSRES_FC POSRES_FC POSRES_FC -41 1 POSRES_FC POSRES_FC POSRES_FC -42 1 POSRES_FC POSRES_FC POSRES_FC -43 1 POSRES_FC POSRES_FC POSRES_FC -44 1 POSRES_FC POSRES_FC POSRES_FC -45 1 POSRES_FC POSRES_FC POSRES_FC -46 1 POSRES_FC POSRES_FC POSRES_FC -47 1 POSRES_FC POSRES_FC POSRES_FC -48 1 POSRES_FC POSRES_FC POSRES_FC -49 1 POSRES_FC POSRES_FC POSRES_FC -50 1 POSRES_FC POSRES_FC POSRES_FC -51 1 POSRES_FC POSRES_FC POSRES_FC -52 1 POSRES_FC POSRES_FC POSRES_FC -53 1 POSRES_FC POSRES_FC POSRES_FC -54 1 POSRES_FC POSRES_FC POSRES_FC -55 1 POSRES_FC POSRES_FC POSRES_FC -56 1 POSRES_FC POSRES_FC POSRES_FC -57 1 POSRES_FC POSRES_FC POSRES_FC -58 1 POSRES_FC POSRES_FC POSRES_FC -59 1 POSRES_FC POSRES_FC POSRES_FC -60 1 POSRES_FC POSRES_FC POSRES_FC -61 1 POSRES_FC POSRES_FC POSRES_FC -62 1 POSRES_FC POSRES_FC POSRES_FC -63 1 POSRES_FC POSRES_FC POSRES_FC -64 1 POSRES_FC POSRES_FC POSRES_FC -65 1 POSRES_FC POSRES_FC POSRES_FC -66 1 POSRES_FC POSRES_FC POSRES_FC -67 1 POSRES_FC POSRES_FC POSRES_FC -68 1 POSRES_FC POSRES_FC POSRES_FC -69 1 POSRES_FC POSRES_FC POSRES_FC -70 1 POSRES_FC POSRES_FC POSRES_FC -71 1 POSRES_FC POSRES_FC POSRES_FC -72 1 POSRES_FC POSRES_FC POSRES_FC -73 1 POSRES_FC POSRES_FC POSRES_FC -74 1 POSRES_FC POSRES_FC POSRES_FC -75 1 POSRES_FC POSRES_FC POSRES_FC -76 1 POSRES_FC POSRES_FC POSRES_FC -77 1 POSRES_FC POSRES_FC POSRES_FC -78 1 POSRES_FC POSRES_FC POSRES_FC -79 1 POSRES_FC POSRES_FC POSRES_FC -80 1 POSRES_FC POSRES_FC POSRES_FC -81 1 POSRES_FC POSRES_FC POSRES_FC -82 1 POSRES_FC POSRES_FC POSRES_FC -83 1 POSRES_FC POSRES_FC POSRES_FC -84 1 POSRES_FC POSRES_FC POSRES_FC -85 1 POSRES_FC POSRES_FC POSRES_FC -86 1 POSRES_FC POSRES_FC POSRES_FC -87 1 POSRES_FC POSRES_FC POSRES_FC -#endif From 9e08008adff4e0dc05928a5de8ccecd4100d79c2 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:46:25 +0200 Subject: [PATCH 032/275] Update PPE.itp --- .../martini3/PPE/polyply/PPE.itp | 95 +------------------ 1 file changed, 1 insertion(+), 94 deletions(-) diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp index 44ab2462..aafe1859 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp @@ -346,97 +346,4 @@ PPE 4 82 83 1 0.32500 85 86 1 0.32500 85 87 1 0.32500 -86 87 1 0.32500 -#ifdef POSRES -#define POSRES_FC 150.00 -#ifndef POSRES_FC -#endif -[ position_restraints ] -1 1 POSRES_FC POSRES_FC POSRES_FC -2 1 POSRES_FC POSRES_FC POSRES_FC -3 1 POSRES_FC POSRES_FC POSRES_FC -4 1 POSRES_FC POSRES_FC POSRES_FC -5 1 POSRES_FC POSRES_FC POSRES_FC -6 1 POSRES_FC POSRES_FC POSRES_FC -7 1 POSRES_FC POSRES_FC POSRES_FC -8 1 POSRES_FC POSRES_FC POSRES_FC -9 1 POSRES_FC POSRES_FC POSRES_FC -10 1 POSRES_FC POSRES_FC POSRES_FC -11 1 POSRES_FC POSRES_FC POSRES_FC -12 1 POSRES_FC POSRES_FC POSRES_FC -13 1 POSRES_FC POSRES_FC POSRES_FC -14 1 POSRES_FC POSRES_FC POSRES_FC -15 1 POSRES_FC POSRES_FC POSRES_FC -16 1 POSRES_FC POSRES_FC POSRES_FC -17 1 POSRES_FC POSRES_FC POSRES_FC -18 1 POSRES_FC POSRES_FC POSRES_FC -19 1 POSRES_FC POSRES_FC POSRES_FC -20 1 POSRES_FC POSRES_FC POSRES_FC -21 1 POSRES_FC POSRES_FC POSRES_FC -22 1 POSRES_FC POSRES_FC POSRES_FC -23 1 POSRES_FC POSRES_FC POSRES_FC -24 1 POSRES_FC POSRES_FC POSRES_FC -25 1 POSRES_FC POSRES_FC POSRES_FC -26 1 POSRES_FC POSRES_FC POSRES_FC -27 1 POSRES_FC POSRES_FC POSRES_FC -28 1 POSRES_FC POSRES_FC POSRES_FC -29 1 POSRES_FC POSRES_FC POSRES_FC -30 1 POSRES_FC POSRES_FC POSRES_FC -31 1 POSRES_FC POSRES_FC POSRES_FC -32 1 POSRES_FC POSRES_FC POSRES_FC -33 1 POSRES_FC POSRES_FC POSRES_FC -34 1 POSRES_FC POSRES_FC POSRES_FC -35 1 POSRES_FC POSRES_FC POSRES_FC -36 1 POSRES_FC POSRES_FC POSRES_FC -37 1 POSRES_FC POSRES_FC POSRES_FC -38 1 POSRES_FC POSRES_FC POSRES_FC -39 1 POSRES_FC POSRES_FC POSRES_FC -40 1 POSRES_FC POSRES_FC POSRES_FC -41 1 POSRES_FC POSRES_FC POSRES_FC -42 1 POSRES_FC POSRES_FC POSRES_FC -43 1 POSRES_FC POSRES_FC POSRES_FC -44 1 POSRES_FC POSRES_FC POSRES_FC -45 1 POSRES_FC POSRES_FC POSRES_FC -46 1 POSRES_FC POSRES_FC POSRES_FC -47 1 POSRES_FC POSRES_FC POSRES_FC -48 1 POSRES_FC POSRES_FC POSRES_FC -49 1 POSRES_FC POSRES_FC POSRES_FC -50 1 POSRES_FC POSRES_FC POSRES_FC -51 1 POSRES_FC POSRES_FC POSRES_FC -52 1 POSRES_FC POSRES_FC POSRES_FC -53 1 POSRES_FC POSRES_FC POSRES_FC -54 1 POSRES_FC POSRES_FC POSRES_FC -55 1 POSRES_FC POSRES_FC POSRES_FC -56 1 POSRES_FC POSRES_FC POSRES_FC -57 1 POSRES_FC POSRES_FC POSRES_FC -58 1 POSRES_FC POSRES_FC POSRES_FC -59 1 POSRES_FC POSRES_FC POSRES_FC -60 1 POSRES_FC POSRES_FC POSRES_FC -61 1 POSRES_FC POSRES_FC POSRES_FC -62 1 POSRES_FC POSRES_FC POSRES_FC -63 1 POSRES_FC POSRES_FC POSRES_FC -64 1 POSRES_FC POSRES_FC POSRES_FC -65 1 POSRES_FC POSRES_FC POSRES_FC -66 1 POSRES_FC POSRES_FC POSRES_FC -67 1 POSRES_FC POSRES_FC POSRES_FC -68 1 POSRES_FC POSRES_FC POSRES_FC -69 1 POSRES_FC POSRES_FC POSRES_FC -70 1 POSRES_FC POSRES_FC POSRES_FC -71 1 POSRES_FC POSRES_FC POSRES_FC -72 1 POSRES_FC POSRES_FC POSRES_FC -73 1 POSRES_FC POSRES_FC POSRES_FC -74 1 POSRES_FC POSRES_FC POSRES_FC -75 1 POSRES_FC POSRES_FC POSRES_FC -76 1 POSRES_FC POSRES_FC POSRES_FC -77 1 POSRES_FC POSRES_FC POSRES_FC -78 1 POSRES_FC POSRES_FC POSRES_FC -79 1 POSRES_FC POSRES_FC POSRES_FC -80 1 POSRES_FC POSRES_FC POSRES_FC -81 1 POSRES_FC POSRES_FC POSRES_FC -82 1 POSRES_FC POSRES_FC POSRES_FC -83 1 POSRES_FC POSRES_FC POSRES_FC -84 1 POSRES_FC POSRES_FC POSRES_FC -85 1 POSRES_FC POSRES_FC POSRES_FC -86 1 POSRES_FC POSRES_FC POSRES_FC -87 1 POSRES_FC POSRES_FC POSRES_FC -#endif +86 87 1 0.32500 From 0878db9c2c4f573e5872977af56f76b66eec5ed9 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:56:54 +0200 Subject: [PATCH 033/275] Delete PPEinit.martini3.ff --- polyply/data/martini3/PPEinit.martini3.ff | 68 ----------------------- 1 file changed, 68 deletions(-) delete mode 100644 polyply/data/martini3/PPEinit.martini3.ff diff --git a/polyply/data/martini3/PPEinit.martini3.ff b/polyply/data/martini3/PPEinit.martini3.ff deleted file mode 100644 index 2a05a7b7..00000000 --- a/polyply/data/martini3/PPEinit.martini3.ff +++ /dev/null @@ -1,68 +0,0 @@ -; General remarks: -; After "polyplying" PPE to the desired polymer length, some manual adjustments are recommended: -; 1) PPE ends with an aromatic ring and not with a triple bond: Delete last bead of topology and coordinate file and all respective potentials using that bead. -; 2) To prevent bending over of last and first aromatic ring: Add an additional bond angle potential at both polymer ends. (k=50,phi0=165) -; (e.g. bond angle potential between 1-4-8 and between End-(End-4)-(End-8) ). -; 3) For furher explanation, please look at https://doi.org/10.1039/D1CP04237H. - -[ citations ] -Martini3 -polyply -PPEs - -[ moleculetype ] -PPEinit 3 - -[ atoms ] -; nr type resnr residu atom cgnr charge - 1 TC5 1 PPEinit BB1 1 0.0 - 2 TC5 1 PPEinit BB2 2 0.0 - 3 TC5 1 PPEinit BB3 3 0.0 - 4 TC4 1 PPEinit BB4 4 0.0 - 5 TC5 1 PPEinit BB5 5 0.0 - 6 TC5 1 PPEinit BB6 6 0.0 - 7 TC5 1 PPEinit BB7 7 0.0 - 8 TC4 1 PPEinit BB8 8 0.0 - -[ bonds ] -; ai aj funct - 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - 7 8 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - -[ constraints ] -; ai aj funct - 1 2 1 0.325 {"comment": "constr. aromatic ring"} - 1 3 1 0.325 {"comment": "constr. aromatic ring"} - 2 3 1 0.325 {"comment": "constr. aromatic ring"} - 5 6 1 0.325 {"comment": "constr. aromatic ring"} - 5 7 1 0.325 {"comment": "constr. aromatic ring"} - 6 7 1 0.325 {"comment": "constr. aromatic ring"} - -[ angles ] - 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} - 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} - 5 7 8 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 6 7 8 1 83 650 {"comment": "angle aromatic ring-triple bond"} - 1 4 8 1 165 50 {"comment": "prevent start from bending over"} - -[ dihedrals ] - 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} - 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} - 8 6 5 7 2 0 50 {"comment": "improper dihedral left turn"} -[ link ] -resname "PPEinit|PPE" - -[ bonds ] -BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - -[ angles ] -BB8 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} -BB8 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 BB8 +BB4 2 180 50 {"comment": "bending stiffness backbone" } -BB8 +BB4 ++BB4 2 180 50 {"comment": "bending stiffness backbone" } - -[ dihedrals ] -BB8 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} From 803eef6cd82f0ecd9544319c3050334c5f1e1f90 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:56:59 +0200 Subject: [PATCH 034/275] Delete PPEter.martini3.ff --- polyply/data/martini3/PPEter.martini3.ff | 63 ------------------------ 1 file changed, 63 deletions(-) delete mode 100644 polyply/data/martini3/PPEter.martini3.ff diff --git a/polyply/data/martini3/PPEter.martini3.ff b/polyply/data/martini3/PPEter.martini3.ff deleted file mode 100644 index fcaf176b..00000000 --- a/polyply/data/martini3/PPEter.martini3.ff +++ /dev/null @@ -1,63 +0,0 @@ -; General remarks: -; After "polyplying" PPE to the desired polymer length, some manual adjustments are recommended: -; 1) PPE ends with an aromatic ring and not with a triple bond: Delete last bead of topology and coordinate file and all respective potentials using that bead. -; 2) To prevent bending over of last and first aromatic ring: Add an additional bond angle potential at both polymer ends. (k=50,phi0=165) -; (e.g. bond angle potential between 1-4-8 and between End-(End-4)-(End-8) ). -; 3) For furher explanation, please look at https://doi.org/10.1039/D1CP04237H. - -[ citations ] -Martini3 -polyply -PPEs - -[ moleculetype ] -PPEter 3 - -[ atoms ] -; nr type resnr residu atom cgnr charge - 1 TC5 1 PPEter BB1 1 0.0 - 2 TC5 1 PPEter BB2 2 0.0 - 3 TC5 1 PPEter BB3 3 0.0 - 4 TC4 1 PPEter BB4 4 0.0 - 5 TC5 1 PPEter BB5 5 0.0 - 6 TC5 1 PPEter BB6 6 0.0 - 7 TC5 1 PPEter BB7 7 0.0 - -[ bonds ] -; ai aj funct - 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - -[ constraints ] -; ai aj funct - 1 2 1 0.325 {"comment": "constr. aromatic ring"} - 1 3 1 0.325 {"comment": "constr. aromatic ring"} - 2 3 1 0.325 {"comment": "constr. aromatic ring"} - 5 6 1 0.325 {"comment": "constr. aromatic ring"} - 5 7 1 0.325 {"comment": "constr. aromatic ring"} - 6 7 1 0.325 {"comment": "constr. aromatic ring"} - -[ angles ] - 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} - 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} - -[ dihedrals ] - 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} - 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} - -[ link ] -resname "PPE|PPEter" - -[ bonds ] --BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - -[ angles ] --BB4 BB1 BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} --BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} --BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } ---BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } - -[ dihedrals ] --BB4 BB2 BB3 BB1 2 0 50 {"comment": "improper dihedral right turn"} From 897fb42d69a1123e9963943a200764683592c431 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:57:05 +0200 Subject: [PATCH 035/275] Delete PPE.martini3.ff --- polyply/data/martini3/PPE.martini3.ff | 52 --------------------------- 1 file changed, 52 deletions(-) delete mode 100644 polyply/data/martini3/PPE.martini3.ff diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff deleted file mode 100644 index fd58127f..00000000 --- a/polyply/data/martini3/PPE.martini3.ff +++ /dev/null @@ -1,52 +0,0 @@ -; General remarks: -; After "polyplying" PPE to the desired polymer length, some manual adjustments are recommended: -; 1) PPE ends with an aromatic ring and not with a triple bond: Delete last bead of topology and coordinate file and all respective potentials using that bead. -; 2) To prevent bending over of last and first aromatic ring: Add an additional bond angle potential at both polymer ends. (k=50,phi0=165) -; (e.g. bond angle potential between 1-4-8 and between End-(End-4)-(End-8) ). -; 3) For furher explanation, please look at https://doi.org/10.1039/D1CP04237H. - -[ citations ] -Martini3 -polyply -PPEs - -[ moleculetype ] -PPE 3 - -[ atoms ] -; nr type resnr residu atom cgnr charge - 1 TC5 1 PPE BB1 1 0.0 - 2 TC5 1 PPE BB2 2 0.0 - 3 TC5 1 PPE BB3 3 0.0 - 4 TC4 1 PPE BB4 4 0.0 - -[ bonds ] -; ai aj funct - 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - -[ constraints ] -; ai aj funct - 1 2 1 0.325 {"comment": "constr. aromatic ring"} - 1 3 1 0.325 {"comment": "constr. aromatic ring"} - 2 3 1 0.325 {"comment": "constr. aromatic ring"} - -[ angles ] - 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} - -[ dihedrals ] - 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} - -[ link ] -resname "PPE|PPEter" - -[ bonds ] -BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - -[ angles ] -BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} -BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } - -[ dihedrals ] -BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} From 987c2185828368da609053cab2f11b4e0428606f Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:57:15 +0200 Subject: [PATCH 036/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 156 ++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 polyply/data/martini3/PPE.martini3.ff diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff new file mode 100644 index 00000000..bff26278 --- /dev/null +++ b/polyply/data/martini3/PPE.martini3.ff @@ -0,0 +1,156 @@ +[ citations ] +Martini3 +polyply +PPEs + +[ moleculetype ] +PPE 3 + +[ atoms ] +; nr type resnr residu atom cgnr charge + 1 TC5 1 PPE BB1 1 0.0 + 2 TC5 1 PPE BB2 2 0.0 + 3 TC5 1 PPE BB3 3 0.0 + 4 TC4 1 PPE BB4 4 0.0 + +[ bonds ] +; ai aj funct + 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ constraints ] +; ai aj funct + 1 2 1 0.325 {"comment": "constr. aromatic ring"} + 1 3 1 0.325 {"comment": "constr. aromatic ring"} + 2 3 1 0.325 {"comment": "constr. aromatic ring"} + +[ angles ] + 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} + +[ dihedrals ] + 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} + +[ link ] +resname "PPE|PPEter" + +[ bonds ] +BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ angles ] +BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } + +[ dihedrals ] +BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} + + +[ moleculetype ] +PPEinit 3 + +[ atoms ] +; nr type resnr residu atom cgnr charge + 1 TC5 1 PPEinit BB1 1 0.0 + 2 TC5 1 PPEinit BB2 2 0.0 + 3 TC5 1 PPEinit BB3 3 0.0 + 4 TC4 1 PPEinit BB4 4 0.0 + 5 TC5 1 PPEinit BB5 5 0.0 + 6 TC5 1 PPEinit BB6 6 0.0 + 7 TC5 1 PPEinit BB7 7 0.0 + 8 TC4 1 PPEinit BB8 8 0.0 + +[ bonds ] +; ai aj funct + 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 7 8 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ constraints ] +; ai aj funct + 1 2 1 0.325 {"comment": "constr. aromatic ring"} + 1 3 1 0.325 {"comment": "constr. aromatic ring"} + 2 3 1 0.325 {"comment": "constr. aromatic ring"} + 5 6 1 0.325 {"comment": "constr. aromatic ring"} + 5 7 1 0.325 {"comment": "constr. aromatic ring"} + 6 7 1 0.325 {"comment": "constr. aromatic ring"} + +[ angles ] + 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 5 7 8 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 6 7 8 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 1 4 8 1 165 50 {"comment": "prevent start from bending over"} + +[ dihedrals ] + 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} + 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} + 8 6 5 7 2 0 50 {"comment": "improper dihedral left turn"} +[ link ] +resname "PPEinit|PPE" + +[ bonds ] +BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ angles ] +BB8 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +BB8 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 BB8 +BB4 2 180 50 {"comment": "bending stiffness backbone" } +BB8 +BB4 ++BB4 2 180 50 {"comment": "bending stiffness backbone" } + +[ dihedrals ] +BB8 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} + + +[ moleculetype ] +PPEter 3 + +[ atoms ] +; nr type resnr residu atom cgnr charge + 1 TC5 1 PPEter BB1 1 0.0 + 2 TC5 1 PPEter BB2 2 0.0 + 3 TC5 1 PPEter BB3 3 0.0 + 4 TC4 1 PPEter BB4 4 0.0 + 5 TC5 1 PPEter BB5 5 0.0 + 6 TC5 1 PPEter BB6 6 0.0 + 7 TC5 1 PPEter BB7 7 0.0 + +[ bonds ] +; ai aj funct + 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ constraints ] +; ai aj funct + 1 2 1 0.325 {"comment": "constr. aromatic ring"} + 1 3 1 0.325 {"comment": "constr. aromatic ring"} + 2 3 1 0.325 {"comment": "constr. aromatic ring"} + 5 6 1 0.325 {"comment": "constr. aromatic ring"} + 5 7 1 0.325 {"comment": "constr. aromatic ring"} + 6 7 1 0.325 {"comment": "constr. aromatic ring"} + +[ angles ] + 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} + +[ dihedrals ] + 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} + 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} + +[ link ] +resname "PPE|PPEter" + +[ bonds ] +-BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + +[ angles ] +-BB4 BB1 BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} +-BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +-BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } +--BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } + +[ dihedrals ] +-BB4 BB2 BB3 BB1 2 0 50 {"comment": "improper dihedral right turn"} From 677d5edc6b5955a64a964ef7d37b57a6515fa921 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:23:07 +0200 Subject: [PATCH 037/275] Update citations.bib --- polyply/data/martini3/citations.bib | 1 - 1 file changed, 1 deletion(-) diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index 9c0ad5a8..9a3746d7 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -30,5 +30,4 @@ @article{PPEs pages={9998--10010}, publisher={The Royal Society of Chemistry}, url={http://dx.doi.org/10.1039/D1CP04237H}, - abstract={Poly(para-phenylene ethynylene)s, or short PPEs, are a class of conjugated and semi-flexible polymers with a strongly delocalized π electron system and increased chain stiffness. Due to this, PPEs have a wide range of technological applications. Although the material properties of single-chains or mixtures of few PPE chains have been studied in detail, the properties of large assemblies remain to be fully explored. Here, we developed a coarse-grained model for PPEs with the Martini 3 force field to enable computational studies of PPEs in large-scale assembly. We used an optimization geometrical approach to take the shape of the π conjugated backbone into account and also applied an additional angular potential to tune the mechanical bending stiffness of the polymer. Our Martini 3 model reproduces key structural and thermodynamic observables of single PPE chains and mixtures, such as persistence length, density, packing and stacking. We show that chain entanglement increases with the expense of nematic ordering with growing PPE chain length. With the Martini 3 PPE model at hand, we are now able to cover large spatio-temporal scales and thereby to uncover key aspects for the structural organization of PPE bulk systems. The model is also predicted to be of high applicability to investigate out-of-equilibrium behavior of PPEs under mechanical force.} } From 7849a7ed3886db0f707874eb4c6274d6b2525166 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:24:29 +0200 Subject: [PATCH 038/275] Update PPE.itp --- .../tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp index aafe1859..95e8adec 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp @@ -1,5 +1,5 @@ [ moleculetype ] -PPE 4 +PPE 3 [ atoms ] 1 TC5 1 PPE BB 1 0.0000 ; 2 TC5 1 PPE BB 2 0.0000 ; From f86943c3234807722ee00db62a9b938401ca37c9 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:43:08 +0200 Subject: [PATCH 039/275] Add files via upload --- .../martini3/PPE/polyply/PPE.itp | 348 +++++++++--------- 1 file changed, 176 insertions(+), 172 deletions(-) diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp index 95e8adec..0c0c2735 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp @@ -1,93 +1,94 @@ [ moleculetype ] PPE 3 [ atoms ] -1 TC5 1 PPE BB 1 0.0000 ; -2 TC5 1 PPE BB 2 0.0000 ; -3 TC5 1 PPE BB 3 0.0000 ; -4 TC4 1 PPE BB 4 0.0000 ; -5 TC5 2 PPE BB 5 0.0000 ; -6 TC5 2 PPE BB 6 0.0000 ; -7 TC5 2 PPE BB 7 0.0000 ; -8 TC4 2 PPE BB 8 0.0000 ; -9 TC5 3 PPE BB 9 0.0000 ; -10 TC5 3 PPE BB 10 0.0000 ; -11 TC5 3 PPE BB 11 0.0000 ; -12 TC4 3 PPE BB 12 0.0000 ; -13 TC5 4 PPE BB 13 0.0000 ; -14 TC5 4 PPE BB 14 0.0000 ; -15 TC5 4 PPE BB 15 0.0000 ; -16 TC4 4 PPE BB 16 0.0000 ; -17 TC5 5 PPE BB 17 0.0000 ; -18 TC5 5 PPE BB 18 0.0000 ; -19 TC5 5 PPE BB 19 0.0000 ; -20 TC4 5 PPE BB 20 0.0000 ; -21 TC5 6 PPE BB 21 0.0000 ; -22 TC5 6 PPE BB 22 0.0000 ; -23 TC5 6 PPE BB 23 0.0000 ; -24 TC4 6 PPE BB 24 0.0000 ; -25 TC5 7 PPE BB 25 0.0000 ; -26 TC5 7 PPE BB 26 0.0000 ; -27 TC5 7 PPE BB 27 0.0000 ; -28 TC4 7 PPE BB 28 0.0000 ; -29 TC5 8 PPE BB 29 0.0000 ; -30 TC5 8 PPE BB 30 0.0000 ; -31 TC5 8 PPE BB 31 0.0000 ; -32 TC4 8 PPE BB 32 0.0000 ; -33 TC5 9 PPE BB 33 0.0000 ; -34 TC5 9 PPE BB 34 0.0000 ; -35 TC5 9 PPE BB 35 0.0000 ; -36 TC4 9 PPE BB 36 0.0000 ; -37 TC5 10 PPE BB 37 0.0000 ; -38 TC5 10 PPE BB 38 0.0000 ; -39 TC5 10 PPE BB 39 0.0000 ; -40 TC4 10 PPE BB 40 0.0000 ; -41 TC5 11 PPE BB 41 0.0000 ; -42 TC5 11 PPE BB 42 0.0000 ; -43 TC5 11 PPE BB 43 0.0000 ; -44 TC4 11 PPE BB 44 0.0000 ; -45 TC5 12 PPE BB 45 0.0000 ; -46 TC5 12 PPE BB 46 0.0000 ; -47 TC5 12 PPE BB 47 0.0000 ; -48 TC4 12 PPE BB 48 0.0000 ; -49 TC5 13 PPE BB 49 0.0000 ; -50 TC5 13 PPE BB 50 0.0000 ; -51 TC5 13 PPE BB 51 0.0000 ; -52 TC4 13 PPE BB 52 0.0000 ; -53 TC5 14 PPE BB 53 0.0000 ; -54 TC5 14 PPE BB 54 0.0000 ; -55 TC5 14 PPE BB 55 0.0000 ; -56 TC4 14 PPE BB 56 0.0000 ; -57 TC5 15 PPE BB 57 0.0000 ; -58 TC5 15 PPE BB 58 0.0000 ; -59 TC5 15 PPE BB 59 0.0000 ; -60 TC4 15 PPE BB 60 0.0000 ; -61 TC5 16 PPE BB 61 0.0000 ; -62 TC5 16 PPE BB 62 0.0000 ; -63 TC5 16 PPE BB 63 0.0000 ; -64 TC4 16 PPE BB 64 0.0000 ; -65 TC5 17 PPE BB 65 0.0000 ; -66 TC5 17 PPE BB 66 0.0000 ; -67 TC5 17 PPE BB 67 0.0000 ; -68 TC4 17 PPE BB 68 0.0000 ; -69 TC5 18 PPE BB 69 0.0000 ; -70 TC5 18 PPE BB 70 0.0000 ; -71 TC5 18 PPE BB 71 0.0000 ; -72 TC4 18 PPE BB 72 0.0000 ; -73 TC5 19 PPE BB 73 0.0000 ; -74 TC5 19 PPE BB 74 0.0000 ; -75 TC5 19 PPE BB 75 0.0000 ; -76 TC4 19 PPE BB 76 0.0000 ; -77 TC5 20 PPE BB 77 0.0000 ; -78 TC5 20 PPE BB 78 0.0000 ; -79 TC5 20 PPE BB 79 0.0000 ; -80 TC4 20 PPE BB 80 0.0000 ; -81 TC5 21 PPE BB 81 0.0000 ; -82 TC5 21 PPE BB 82 0.0000 ; -83 TC5 21 PPE BB 83 0.0000 ; -84 TC4 21 PPE BB 84 0.0000 ; -85 TC5 22 PPE BB 85 0.0000 ; -86 TC5 22 PPE BB 86 0.0000 ; -87 TC5 22 PPE BB 87 0.0000 ; +1 TC5 1 PPE BB1 1 0.0000 ; +2 TC5 1 PPE BB2 2 0.0000 ; +3 TC5 1 PPE BB3 3 0.0000 ; +4 TC4 1 PPE BB4 4 0.0000 ; +5 TC5 2 PPE BB5 5 0.0000 ; +6 TC5 2 PPE BB6 6 0.0000 ; +7 TC5 2 PPE BB7 7 0.0000 ; +8 TC4 2 PPE BB8 8 0.0000 ; +9 TC5 3 PPE BB1 9 0.0000 ; +10 TC5 3 PPE BB2 10 0.0000 ; +11 TC5 3 PPE BB3 11 0.0000 ; +12 TC4 3 PPE BB4 12 0.0000 ; +13 TC5 4 PPE BB1 13 0.0000 ; +14 TC5 4 PPE BB2 14 0.0000 ; +15 TC5 4 PPE BB3 15 0.0000 ; +16 TC4 4 PPE BB4 16 0.0000 ; +17 TC5 5 PPE BB1 17 0.0000 ; +18 TC5 5 PPE BB2 18 0.0000 ; +19 TC5 5 PPE BB3 19 0.0000 ; +20 TC4 5 PPE BB4 20 0.0000 ; +21 TC5 6 PPE BB1 21 0.0000 ; +22 TC5 6 PPE BB2 22 0.0000 ; +23 TC5 6 PPE BB3 23 0.0000 ; +24 TC4 6 PPE BB4 24 0.0000 ; +25 TC5 7 PPE BB1 25 0.0000 ; +26 TC5 7 PPE BB2 26 0.0000 ; +27 TC5 7 PPE BB3 27 0.0000 ; +28 TC4 7 PPE BB4 28 0.0000 ; +29 TC5 8 PPE BB1 29 0.0000 ; +30 TC5 8 PPE BB2 30 0.0000 ; +31 TC5 8 PPE BB3 31 0.0000 ; +32 TC4 8 PPE BB4 32 0.0000 ; +33 TC5 9 PPE BB1 33 0.0000 ; +34 TC5 9 PPE BB2 34 0.0000 ; +35 TC5 9 PPE BB3 35 0.0000 ; +36 TC4 9 PPE BB4 36 0.0000 ; +37 TC5 10 PPE BB1 37 0.0000 ; +38 TC5 10 PPE BB2 38 0.0000 ; +39 TC5 10 PPE BB3 39 0.0000 ; +40 TC4 10 PPE BB4 40 0.0000 ; +41 TC5 11 PPE BB1 41 0.0000 ; +42 TC5 11 PPE BB2 42 0.0000 ; +43 TC5 11 PPE BB3 43 0.0000 ; +44 TC4 11 PPE BB4 44 0.0000 ; +45 TC5 12 PPE BB1 45 0.0000 ; +46 TC5 12 PPE BB2 46 0.0000 ; +47 TC5 12 PPE BB3 47 0.0000 ; +48 TC4 12 PPE BB4 48 0.0000 ; +49 TC5 13 PPE BB1 49 0.0000 ; +50 TC5 13 PPE BB2 50 0.0000 ; +51 TC5 13 PPE BB3 51 0.0000 ; +52 TC4 13 PPE BB4 52 0.0000 ; +53 TC5 14 PPE BB1 53 0.0000 ; +54 TC5 14 PPE BB2 54 0.0000 ; +55 TC5 14 PPE BB3 55 0.0000 ; +56 TC4 14 PPE BB4 56 0.0000 ; +57 TC5 15 PPE BB1 57 0.0000 ; +58 TC5 15 PPE BB2 58 0.0000 ; +59 TC5 15 PPE BB3 59 0.0000 ; +60 TC4 15 PPE BB4 60 0.0000 ; +61 TC5 16 PPE BB1 61 0.0000 ; +62 TC5 16 PPE BB2 62 0.0000 ; +63 TC5 16 PPE BB3 63 0.0000 ; +64 TC4 16 PPE BB4 64 0.0000 ; +65 TC5 17 PPE BB1 65 0.0000 ; +66 TC5 17 PPE BB2 66 0.0000 ; +67 TC5 17 PPE BB3 67 0.0000 ; +68 TC4 17 PPE BB4 68 0.0000 ; +69 TC5 18 PPE BB1 69 0.0000 ; +70 TC5 18 PPE BB2 70 0.0000 ; +71 TC5 18 PPE BB3 71 0.0000 ; +72 TC4 18 PPE BB4 72 0.0000 ; +73 TC5 19 PPE BB1 73 0.0000 ; +74 TC5 19 PPE BB2 74 0.0000 ; +75 TC5 19 PPE BB3 75 0.0000 ; +76 TC4 19 PPE BB4 76 0.0000 ; +77 TC5 20 PPE BB1 77 0.0000 ; +78 TC5 20 PPE BB2 78 0.0000 ; +79 TC5 20 PPE BB3 79 0.0000 ; +80 TC4 20 PPE BB4 80 0.0000 ; +81 TC5 21 PPE BB1 81 0.0000 ; +82 TC5 21 PPE BB2 82 0.0000 ; +83 TC5 21 PPE BB3 83 0.0000 ; +84 TC4 21 PPE BB4 84 0.0000 ; +85 TC5 22 PPE BB5 85 0.0000 ; +86 TC5 22 PPE BB6 86 0.0000 ; +87 TC5 22 PPE BB7 87 0.0000 ; + [ bonds ] 3 4 1 0.23400 9000 4 5 1 0.23400 9000 @@ -131,155 +132,158 @@ PPE 3 80 81 1 0.23400 9000 83 84 1 0.23400 9000 84 85 1 0.23400 9000 + [ angles ] 1 3 4 1 143 550 -2 3 4 2 83 650 -4 5 6 2 83 650 +2 3 4 1 83 650 +4 5 6 1 83 650 4 5 7 1 143 550 4 8 12 1 180 50 5 7 8 1 143 550 -6 7 8 2 83 650 -8 9 10 2 83 650 +6 7 8 1 83 650 +8 9 10 1 83 650 8 9 11 1 143 550 8 12 16 1 180 50 9 11 12 1 143 550 -10 11 12 2 83 650 -12 13 14 2 83 650 +10 11 12 1 83 650 +12 13 14 1 83 650 12 13 15 1 143 550 12 16 20 1 180 50 13 15 16 1 143 550 -14 15 16 2 83 650 -16 17 18 2 83 650 +14 15 16 1 83 650 +16 17 18 1 83 650 16 17 19 1 143 550 16 20 24 1 180 50 17 19 20 1 143 550 -18 19 20 2 83 650 -20 21 22 2 83 650 +18 19 20 1 83 650 +20 21 22 1 83 650 20 21 23 1 143 550 20 24 28 1 180 50 21 23 24 1 143 550 -22 23 24 2 83 650 -24 25 26 2 83 650 +22 23 24 1 83 650 +24 25 26 1 83 650 24 25 27 1 143 550 24 28 32 1 180 50 25 27 28 1 143 550 -26 27 28 2 83 650 -28 29 30 2 83 650 +26 27 28 1 83 650 +28 29 30 1 83 650 28 29 31 1 143 550 28 32 36 1 180 50 29 31 32 1 143 550 -30 31 32 2 83 650 -32 33 34 2 83 650 +30 31 32 1 83 650 +32 33 34 1 83 650 32 33 35 1 143 550 32 36 40 1 180 50 33 35 36 1 143 550 -34 35 36 2 83 650 -36 37 38 2 83 650 +34 35 36 1 83 650 +36 37 38 1 83 650 36 37 39 1 143 550 36 40 44 1 180 50 37 39 40 1 143 550 -38 39 40 2 83 650 -40 41 42 2 83 650 +38 39 40 1 83 650 +40 41 42 1 83 650 40 41 43 1 143 550 40 44 48 1 180 50 41 43 44 1 143 550 -42 43 44 2 83 650 -44 45 46 2 83 650 +42 43 44 1 83 650 +44 45 46 1 83 650 44 45 47 1 143 550 44 48 52 1 180 50 45 47 48 1 143 550 -46 47 48 2 83 650 -48 49 50 2 83 650 +46 47 48 1 83 650 +48 49 50 1 83 650 48 49 51 1 143 550 48 52 56 1 180 50 49 51 52 1 143 550 -50 51 52 2 83 650 -52 53 54 2 83 650 +50 51 52 1 83 650 +52 53 54 1 83 650 52 53 55 1 143 550 52 56 60 1 180 50 53 55 56 1 143 550 -54 55 56 2 83 650 -56 57 58 2 83 650 +54 55 56 1 83 650 +56 57 58 1 83 650 56 57 59 1 143 550 56 60 64 1 180 50 57 59 60 1 143 550 -58 59 60 2 83 650 -60 61 62 2 83 650 +58 59 60 1 83 650 +60 61 62 1 83 650 60 61 63 1 143 550 60 64 68 1 180 50 61 63 64 1 143 550 -62 63 64 2 83 650 -64 65 66 2 83 650 +62 63 64 1 83 650 +64 65 66 1 83 650 64 65 67 1 143 550 64 68 72 1 180 50 65 67 68 1 143 550 -66 67 68 2 83 650 -68 69 70 2 83 650 +66 67 68 1 83 650 +68 69 70 1 83 650 68 69 71 1 143 550 68 72 76 1 180 50 69 71 72 1 143 550 -70 71 72 2 83 650 -72 73 74 2 83 650 +70 71 72 1 83 650 +72 73 74 1 83 650 72 73 75 1 143 550 72 76 80 1 180 50 73 75 76 1 143 550 -74 75 76 2 83 650 -76 77 78 2 83 650 +74 75 76 1 83 650 +76 77 78 1 83 650 76 77 79 1 143 550 76 80 84 1 180 50 77 79 80 1 143 550 -78 79 80 2 83 650 -80 81 82 2 83 650 +78 79 80 1 83 650 +80 81 82 1 83 650 80 81 83 1 143 550 81 83 84 1 143 550 -82 83 84 2 83 650 -84 85 86 2 83 650 +82 83 84 1 83 650 +84 85 86 1 83 650 84 85 87 1 143 550 1 4 7 1 165 50 80 84 87 1 165 50 + [ dihedrals ] -4 2 1 3 2 0.0 50.0 -4 6 7 5 2 0.0 50.0 -8 6 5 7 2 0.0 50.0 -8 10 11 9 2 0.0 50.0 -12 10 9 11 2 0.0 50.0 -12 14 15 13 2 0.0 50.0 -16 14 13 15 2 0.0 50.0 -16 18 19 17 2 0.0 50.0 -20 18 17 19 2 0.0 50.0 -20 22 23 21 2 0.0 50.0 -24 22 21 23 2 0.0 50.0 -24 26 27 25 2 0.0 50.0 -28 26 25 27 2 0.0 50.0 -28 30 31 29 2 0.0 50.0 -32 30 29 31 2 0.0 50.0 -32 34 35 33 2 0.0 50.0 -36 34 33 35 2 0.0 50.0 -36 38 39 37 2 0.0 50.0 -40 38 37 39 2 0.0 50.0 -40 42 43 41 2 0.0 50.0 -44 42 41 43 2 0.0 50.0 -44 46 47 45 2 0.0 50.0 -48 46 45 47 2 0.0 50.0 -48 50 51 49 2 0.0 50.0 -52 50 49 51 2 0.0 50.0 -52 54 55 53 2 0.0 50.0 -56 54 53 55 2 0.0 50.0 -56 58 59 57 2 0.0 50.0 -60 58 57 59 2 0.0 50.0 -60 62 63 61 2 0.0 50.0 -64 62 61 63 2 0.0 50.0 -64 66 67 65 2 0.0 50.0 -68 66 65 67 2 0.0 50.0 -68 70 71 69 2 0.0 50.0 -72 70 69 71 2 0.0 50.0 -72 74 75 73 2 0.0 50.0 -76 74 73 75 2 0.0 50.0 -76 78 79 77 2 0.0 50.0 -80 78 77 79 2 0.0 50.0 -80 82 83 81 2 0.0 50.0 -84 82 81 83 2 0.0 50.0 -84 86 87 85 2 0.0 50.0 +4 2 1 3 2 0 50 +4 6 7 5 2 0 50 +8 6 5 7 2 0 50 +8 10 11 9 2 0 50 +12 10 9 11 2 0 50 +12 14 15 13 2 0 50 +16 14 13 15 2 0 50 +16 18 19 17 2 0 50 +20 18 17 19 2 0 50 +20 22 23 21 2 0 50 +24 22 21 23 2 0 50 +24 26 27 25 2 0 50 +28 26 25 27 2 0 50 +28 30 31 29 2 0 50 +32 30 29 31 2 0 50 +32 34 35 33 2 0 50 +36 34 33 35 2 0 50 +36 38 39 37 2 0 50 +40 38 37 39 2 0 50 +40 42 43 41 2 0 50 +44 42 41 43 2 0 50 +44 46 47 45 2 0 50 +48 46 45 47 2 0 50 +48 50 51 49 2 0 50 +52 50 49 51 2 0 50 +52 54 55 53 2 0 50 +56 54 53 55 2 0 50 +56 58 59 57 2 0 50 +60 58 57 59 2 0 50 +60 62 63 61 2 0 50 +64 62 61 63 2 0 50 +64 66 67 65 2 0 50 +68 66 65 67 2 0 50 +68 70 71 69 2 0 50 +72 70 69 71 2 0 50 +72 74 75 73 2 0 50 +76 74 73 75 2 0 50 +76 78 79 77 2 0 50 +80 78 77 79 2 0 50 +80 82 83 81 2 0 50 +84 82 81 83 2 0 50 +84 86 87 85 2 0 50 + [ constraints ] 1 2 1 0.32500 1 3 1 0.32500 @@ -346,4 +350,4 @@ PPE 3 82 83 1 0.32500 85 86 1 0.32500 85 87 1 0.32500 -86 87 1 0.32500 +86 87 1 0.32500 From 4b63d44599d1151ba514253a61bd932b59f37802 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:51:03 +0200 Subject: [PATCH 040/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 83 ++++++++++++++------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index bff26278..2a0b832a 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -4,103 +4,105 @@ polyply PPEs [ moleculetype ] -PPE 3 +PPEinit 3 [ atoms ] ; nr type resnr residu atom cgnr charge - 1 TC5 1 PPE BB1 1 0.0 - 2 TC5 1 PPE BB2 2 0.0 - 3 TC5 1 PPE BB3 3 0.0 - 4 TC4 1 PPE BB4 4 0.0 + 1 TC5 1 PPEinit BB1 1 0.0 + 2 TC5 1 PPEinit BB2 2 0.0 + 3 TC5 1 PPEinit BB3 3 0.0 + 4 TC4 1 PPEinit BB4 4 0.0 + 5 TC5 1 PPEinit BB5 5 0.0 + 6 TC5 1 PPEinit BB6 6 0.0 + 7 TC5 1 PPEinit BB7 7 0.0 + 8 TC4 1 PPEinit BB8 8 0.0 [ bonds ] ; ai aj funct 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} + 7 8 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ constraints ] ; ai aj funct 1 2 1 0.325 {"comment": "constr. aromatic ring"} 1 3 1 0.325 {"comment": "constr. aromatic ring"} 2 3 1 0.325 {"comment": "constr. aromatic ring"} + 5 6 1 0.325 {"comment": "constr. aromatic ring"} + 5 7 1 0.325 {"comment": "constr. aromatic ring"} + 6 7 1 0.325 {"comment": "constr. aromatic ring"} [ angles ] 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 5 7 8 1 143 550 {"comment": "angle aromatic ring-triple bond"} + 6 7 8 1 83 650 {"comment": "angle aromatic ring-triple bond"} + 1 4 8 1 165 50 {"comment": "prevent start from bending over"} [ dihedrals ] 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} + 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} + 8 6 5 7 2 0 50 {"comment": "improper dihedral left turn"} + [ link ] -resname "PPE|PPEter" +resname "PPEinit|PPE" [ bonds ] -BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} +BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] -BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} -BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } +BB8 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +BB8 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 BB8 +BB4 2 180 50 {"comment": "bending stiffness backbone" } +BB8 +BB4 ++BB4 2 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] -BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} +BB8 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} [ moleculetype ] -PPEinit 3 +PPE 3 [ atoms ] ; nr type resnr residu atom cgnr charge - 1 TC5 1 PPEinit BB1 1 0.0 - 2 TC5 1 PPEinit BB2 2 0.0 - 3 TC5 1 PPEinit BB3 3 0.0 - 4 TC4 1 PPEinit BB4 4 0.0 - 5 TC5 1 PPEinit BB5 5 0.0 - 6 TC5 1 PPEinit BB6 6 0.0 - 7 TC5 1 PPEinit BB7 7 0.0 - 8 TC4 1 PPEinit BB8 8 0.0 + 1 TC5 1 PPE BB1 1 0.0 + 2 TC5 1 PPE BB2 2 0.0 + 3 TC5 1 PPE BB3 3 0.0 + 4 TC4 1 PPE BB4 4 0.0 [ bonds ] ; ai aj funct 3 4 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - 4 5 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - 7 8 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ constraints ] ; ai aj funct 1 2 1 0.325 {"comment": "constr. aromatic ring"} 1 3 1 0.325 {"comment": "constr. aromatic ring"} 2 3 1 0.325 {"comment": "constr. aromatic ring"} - 5 6 1 0.325 {"comment": "constr. aromatic ring"} - 5 7 1 0.325 {"comment": "constr. aromatic ring"} - 6 7 1 0.325 {"comment": "constr. aromatic ring"} [ angles ] 1 3 4 1 143 550 {"comment": "angle aromatic ring-triple bond"} 2 3 4 1 83 650 {"comment": "angle aromatic ring-triple bond"} - 4 5 7 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 4 5 6 1 83 650 {"comment": "angle aromatic ring-triple bond"} - 5 7 8 1 143 550 {"comment": "angle aromatic ring-triple bond"} - 6 7 8 1 83 650 {"comment": "angle aromatic ring-triple bond"} - 1 4 8 1 165 50 {"comment": "prevent start from bending over"} [ dihedrals ] 4 2 1 3 2 0 50 {"comment": "improper dihedral left turn"} - 4 6 7 5 2 0 50 {"comment": "improper dihedral right turn"} - 8 6 5 7 2 0 50 {"comment": "improper dihedral left turn"} + [ link ] -resname "PPEinit|PPE" +resname "PPE" [ bonds ] -BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} +BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] -BB8 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} -BB8 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 BB8 +BB4 2 180 50 {"comment": "bending stiffness backbone" } -BB8 +BB4 ++BB4 2 180 50 {"comment": "bending stiffness backbone" } +BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] -BB8 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} +BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} [ moleculetype ] @@ -145,12 +147,13 @@ resname "PPE|PPEter" [ bonds ] -BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} +-BB3 -BB4 1 0.234 9000 [ angles ] -BB4 BB1 BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} -BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } ---BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } +--BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] -BB4 BB2 BB3 BB1 2 0 50 {"comment": "improper dihedral right turn"} From eb8f45e9a9129132e3843544e946efb1fb6c7323 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:51:44 +0200 Subject: [PATCH 041/275] Add files via upload --- .../martini3/PPE/polyply/PPE.itp | 175 +++++++++--------- 1 file changed, 88 insertions(+), 87 deletions(-) diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp index 0c0c2735..1847a364 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp @@ -1,93 +1,94 @@ [ moleculetype ] PPE 3 + [ atoms ] -1 TC5 1 PPE BB1 1 0.0000 ; -2 TC5 1 PPE BB2 2 0.0000 ; -3 TC5 1 PPE BB3 3 0.0000 ; -4 TC4 1 PPE BB4 4 0.0000 ; -5 TC5 2 PPE BB5 5 0.0000 ; -6 TC5 2 PPE BB6 6 0.0000 ; -7 TC5 2 PPE BB7 7 0.0000 ; -8 TC4 2 PPE BB8 8 0.0000 ; -9 TC5 3 PPE BB1 9 0.0000 ; -10 TC5 3 PPE BB2 10 0.0000 ; -11 TC5 3 PPE BB3 11 0.0000 ; -12 TC4 3 PPE BB4 12 0.0000 ; -13 TC5 4 PPE BB1 13 0.0000 ; -14 TC5 4 PPE BB2 14 0.0000 ; -15 TC5 4 PPE BB3 15 0.0000 ; -16 TC4 4 PPE BB4 16 0.0000 ; -17 TC5 5 PPE BB1 17 0.0000 ; -18 TC5 5 PPE BB2 18 0.0000 ; -19 TC5 5 PPE BB3 19 0.0000 ; -20 TC4 5 PPE BB4 20 0.0000 ; -21 TC5 6 PPE BB1 21 0.0000 ; -22 TC5 6 PPE BB2 22 0.0000 ; -23 TC5 6 PPE BB3 23 0.0000 ; -24 TC4 6 PPE BB4 24 0.0000 ; -25 TC5 7 PPE BB1 25 0.0000 ; -26 TC5 7 PPE BB2 26 0.0000 ; -27 TC5 7 PPE BB3 27 0.0000 ; -28 TC4 7 PPE BB4 28 0.0000 ; -29 TC5 8 PPE BB1 29 0.0000 ; -30 TC5 8 PPE BB2 30 0.0000 ; -31 TC5 8 PPE BB3 31 0.0000 ; -32 TC4 8 PPE BB4 32 0.0000 ; -33 TC5 9 PPE BB1 33 0.0000 ; -34 TC5 9 PPE BB2 34 0.0000 ; -35 TC5 9 PPE BB3 35 0.0000 ; -36 TC4 9 PPE BB4 36 0.0000 ; -37 TC5 10 PPE BB1 37 0.0000 ; -38 TC5 10 PPE BB2 38 0.0000 ; -39 TC5 10 PPE BB3 39 0.0000 ; -40 TC4 10 PPE BB4 40 0.0000 ; -41 TC5 11 PPE BB1 41 0.0000 ; -42 TC5 11 PPE BB2 42 0.0000 ; -43 TC5 11 PPE BB3 43 0.0000 ; -44 TC4 11 PPE BB4 44 0.0000 ; -45 TC5 12 PPE BB1 45 0.0000 ; -46 TC5 12 PPE BB2 46 0.0000 ; -47 TC5 12 PPE BB3 47 0.0000 ; -48 TC4 12 PPE BB4 48 0.0000 ; -49 TC5 13 PPE BB1 49 0.0000 ; -50 TC5 13 PPE BB2 50 0.0000 ; -51 TC5 13 PPE BB3 51 0.0000 ; -52 TC4 13 PPE BB4 52 0.0000 ; -53 TC5 14 PPE BB1 53 0.0000 ; -54 TC5 14 PPE BB2 54 0.0000 ; -55 TC5 14 PPE BB3 55 0.0000 ; -56 TC4 14 PPE BB4 56 0.0000 ; -57 TC5 15 PPE BB1 57 0.0000 ; -58 TC5 15 PPE BB2 58 0.0000 ; -59 TC5 15 PPE BB3 59 0.0000 ; -60 TC4 15 PPE BB4 60 0.0000 ; -61 TC5 16 PPE BB1 61 0.0000 ; -62 TC5 16 PPE BB2 62 0.0000 ; -63 TC5 16 PPE BB3 63 0.0000 ; -64 TC4 16 PPE BB4 64 0.0000 ; -65 TC5 17 PPE BB1 65 0.0000 ; -66 TC5 17 PPE BB2 66 0.0000 ; -67 TC5 17 PPE BB3 67 0.0000 ; -68 TC4 17 PPE BB4 68 0.0000 ; -69 TC5 18 PPE BB1 69 0.0000 ; -70 TC5 18 PPE BB2 70 0.0000 ; -71 TC5 18 PPE BB3 71 0.0000 ; -72 TC4 18 PPE BB4 72 0.0000 ; -73 TC5 19 PPE BB1 73 0.0000 ; -74 TC5 19 PPE BB2 74 0.0000 ; -75 TC5 19 PPE BB3 75 0.0000 ; -76 TC4 19 PPE BB4 76 0.0000 ; -77 TC5 20 PPE BB1 77 0.0000 ; -78 TC5 20 PPE BB2 78 0.0000 ; -79 TC5 20 PPE BB3 79 0.0000 ; -80 TC4 20 PPE BB4 80 0.0000 ; -81 TC5 21 PPE BB1 81 0.0000 ; -82 TC5 21 PPE BB2 82 0.0000 ; -83 TC5 21 PPE BB3 83 0.0000 ; -84 TC4 21 PPE BB4 84 0.0000 ; -85 TC5 22 PPE BB5 85 0.0000 ; -86 TC5 22 PPE BB6 86 0.0000 ; -87 TC5 22 PPE BB7 87 0.0000 ; +1 TC5 1 PPEinit BB1 1 0.0000 ; +2 TC5 1 PPEinit BB2 2 0.0000 ; +3 TC5 1 PPEinit BB3 3 0.0000 ; +4 TC4 1 PPEinit BB4 4 0.0000 ; +5 TC5 1 PPEinit BB5 5 0.0000 ; +6 TC5 1 PPEinit BB6 6 0.0000 ; +7 TC5 1 PPEinit BB7 7 0.0000 ; +8 TC4 1 PPEinit BB8 8 0.0000 ; +9 TC5 2 PPE BB1 9 0.0000 ; +10 TC5 2 PPE BB2 10 0.0000 ; +11 TC5 2 PPE BB3 11 0.0000 ; +12 TC4 2 PPE BB4 12 0.0000 ; +13 TC5 3 PPE BB1 13 0.0000 ; +14 TC5 3 PPE BB2 14 0.0000 ; +15 TC5 3 PPE BB3 15 0.0000 ; +16 TC4 3 PPE BB4 16 0.0000 ; +17 TC5 4 PPE BB1 17 0.0000 ; +18 TC5 4 PPE BB2 18 0.0000 ; +19 TC5 4 PPE BB3 19 0.0000 ; +20 TC4 4 PPE BB4 20 0.0000 ; +21 TC5 5 PPE BB1 21 0.0000 ; +22 TC5 5 PPE BB2 22 0.0000 ; +23 TC5 5 PPE BB3 23 0.0000 ; +24 TC4 5 PPE BB4 24 0.0000 ; +25 TC5 6 PPE BB1 25 0.0000 ; +26 TC5 6 PPE BB2 26 0.0000 ; +27 TC5 6 PPE BB3 27 0.0000 ; +28 TC4 6 PPE BB4 28 0.0000 ; +29 TC5 7 PPE BB1 29 0.0000 ; +30 TC5 7 PPE BB2 30 0.0000 ; +31 TC5 7 PPE BB3 31 0.0000 ; +32 TC4 7 PPE BB4 32 0.0000 ; +33 TC5 8 PPE BB1 33 0.0000 ; +34 TC5 8 PPE BB2 34 0.0000 ; +35 TC5 8 PPE BB3 35 0.0000 ; +36 TC4 8 PPE BB4 36 0.0000 ; +37 TC5 9 PPE BB1 37 0.0000 ; +38 TC5 9 PPE BB2 38 0.0000 ; +39 TC5 9 PPE BB3 39 0.0000 ; +40 TC4 9 PPE BB4 40 0.0000 ; +41 TC5 10 PPE BB1 41 0.0000 ; +42 TC5 10 PPE BB2 42 0.0000 ; +43 TC5 10 PPE BB3 43 0.0000 ; +44 TC4 10 PPE BB4 44 0.0000 ; +45 TC5 11 PPE BB1 45 0.0000 ; +46 TC5 11 PPE BB2 46 0.0000 ; +47 TC5 11 PPE BB3 47 0.0000 ; +48 TC4 11 PPE BB4 48 0.0000 ; +49 TC5 12 PPE BB1 49 0.0000 ; +50 TC5 12 PPE BB2 50 0.0000 ; +51 TC5 12 PPE BB3 51 0.0000 ; +52 TC4 12 PPE BB4 52 0.0000 ; +53 TC5 13 PPE BB1 53 0.0000 ; +54 TC5 13 PPE BB2 54 0.0000 ; +55 TC5 13 PPE BB3 55 0.0000 ; +56 TC4 13 PPE BB4 56 0.0000 ; +57 TC5 14 PPE BB1 57 0.0000 ; +58 TC5 14 PPE BB2 58 0.0000 ; +59 TC5 14 PPE BB3 59 0.0000 ; +60 TC4 14 PPE BB4 60 0.0000 ; +61 TC5 15 PPE BB1 61 0.0000 ; +62 TC5 15 PPE BB2 62 0.0000 ; +63 TC5 15 PPE BB3 63 0.0000 ; +64 TC4 15 PPE BB4 64 0.0000 ; +65 TC5 16 PPE BB1 65 0.0000 ; +66 TC5 16 PPE BB2 66 0.0000 ; +67 TC5 16 PPE BB3 67 0.0000 ; +68 TC4 16 PPE BB4 68 0.0000 ; +69 TC5 17 PPE BB1 69 0.0000 ; +70 TC5 17 PPE BB2 70 0.0000 ; +71 TC5 17 PPE BB3 71 0.0000 ; +72 TC4 17 PPE BB4 72 0.0000 ; +73 TC5 18 PPE BB1 73 0.0000 ; +74 TC5 18 PPE BB2 74 0.0000 ; +75 TC5 18 PPE BB3 75 0.0000 ; +76 TC4 18 PPE BB4 76 0.0000 ; +77 TC5 19 PPE BB1 77 0.0000 ; +78 TC5 19 PPE BB2 78 0.0000 ; +79 TC5 19 PPE BB3 79 0.0000 ; +80 TC4 19 PPE BB4 80 0.0000 ; +81 TC5 20 PPEter BB1 81 0.0000 ; +82 TC5 20 PPEter BB2 82 0.0000 ; +83 TC5 20 PPEter BB3 83 0.0000 ; +84 TC4 20 PPEter BB4 84 0.0000 ; +85 TC5 20 PPEter BB5 85 0.0000 ; +86 TC5 20 PPEter BB6 86 0.0000 ; +87 TC5 20 PPEter BB7 87 0.0000 ; [ bonds ] 3 4 1 0.23400 9000 From 870b524a2c6137e13db601e1f744cf0ff55581f0 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:52:26 +0200 Subject: [PATCH 042/275] Add files via upload --- .../test_data/library_tests/martini3/PPE/polyply/PPE.itp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp index 1847a364..228fd79e 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp @@ -38,10 +38,10 @@ PPE 3 34 TC5 8 PPE BB2 34 0.0000 ; 35 TC5 8 PPE BB3 35 0.0000 ; 36 TC4 8 PPE BB4 36 0.0000 ; -37 TC5 9 PPE BB1 37 0.0000 ; -38 TC5 9 PPE BB2 38 0.0000 ; -39 TC5 9 PPE BB3 39 0.0000 ; -40 TC4 9 PPE BB4 40 0.0000 ; +37 TC5 9 PPE BB1 37 0.0000 ; +38 TC5 9 PPE BB2 38 0.0000 ; +39 TC5 9 PPE BB3 39 0.0000 ; +40 TC4 9 PPE BB4 40 0.0000 ; 41 TC5 10 PPE BB1 41 0.0000 ; 42 TC5 10 PPE BB2 42 0.0000 ; 43 TC5 10 PPE BB3 43 0.0000 ; From d371b0f8f611d24967bbb9b01a4198c0f21f5de3 Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Thu, 23 Jun 2022 09:54:36 +0200 Subject: [PATCH 043/275] Add files via upload --- polyply/data/martini3/PPE.martini3.ff | 28 +++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index 2a0b832a..1c7bc437 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -54,10 +54,10 @@ resname "PPEinit|PPE" BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] -BB8 +BB1 +BB2 2 83 650 {"comment": "angle aromatic ring-triple bond"} +BB8 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} BB8 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 BB8 +BB4 2 180 50 {"comment": "bending stiffness backbone" } -BB8 +BB4 ++BB4 2 180 50 {"comment": "bending stiffness backbone" } +BB4 BB8 +BB4 1 180 50 {"comment": "bending stiffness backbone" } +BB8 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] BB8 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} @@ -97,8 +97,8 @@ resname "PPE" BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] -BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} -BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} +BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] @@ -146,14 +146,18 @@ PPEter 3 resname "PPE|PPEter" [ bonds ] --BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} --BB3 -BB4 1 0.234 9000 +-BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} +--BB4 -BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] --BB4 BB1 BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} --BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} --BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } ---BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } +--BB4 -BB1 -BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} +--BB4 -BB1 -BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +--BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } +-BB4 BB1 BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} +-BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +-BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } +--BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] --BB4 BB2 BB3 BB1 2 0 50 {"comment": "improper dihedral right turn"} +-BB4 BB2 BB3 BB1 2 0 50 {"comment": "improper dihedral right turn"} +--BB4 -BB2 -BB3 -BB1 2 0 50 {"comment": "improper dihedral right turn"} From 545eff4264fbd302654edd4a58464c7af7ed55fb Mon Sep 17 00:00:00 2001 From: mbrosz <91525604+mbrosz@users.noreply.github.com> Date: Thu, 23 Jun 2022 09:55:39 +0200 Subject: [PATCH 044/275] Add files via upload --- .../martini3/PPE/polyply/PPE.itp | 392 +++++++++--------- 1 file changed, 196 insertions(+), 196 deletions(-) diff --git a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp index 228fd79e..ec1bc267 100644 --- a/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp +++ b/polyply/tests/test_data/library_tests/martini3/PPE/polyply/PPE.itp @@ -2,137 +2,137 @@ PPE 3 [ atoms ] -1 TC5 1 PPEinit BB1 1 0.0000 ; -2 TC5 1 PPEinit BB2 2 0.0000 ; -3 TC5 1 PPEinit BB3 3 0.0000 ; -4 TC4 1 PPEinit BB4 4 0.0000 ; -5 TC5 1 PPEinit BB5 5 0.0000 ; -6 TC5 1 PPEinit BB6 6 0.0000 ; -7 TC5 1 PPEinit BB7 7 0.0000 ; -8 TC4 1 PPEinit BB8 8 0.0000 ; -9 TC5 2 PPE BB1 9 0.0000 ; -10 TC5 2 PPE BB2 10 0.0000 ; -11 TC5 2 PPE BB3 11 0.0000 ; -12 TC4 2 PPE BB4 12 0.0000 ; -13 TC5 3 PPE BB1 13 0.0000 ; -14 TC5 3 PPE BB2 14 0.0000 ; -15 TC5 3 PPE BB3 15 0.0000 ; -16 TC4 3 PPE BB4 16 0.0000 ; -17 TC5 4 PPE BB1 17 0.0000 ; -18 TC5 4 PPE BB2 18 0.0000 ; -19 TC5 4 PPE BB3 19 0.0000 ; -20 TC4 4 PPE BB4 20 0.0000 ; -21 TC5 5 PPE BB1 21 0.0000 ; -22 TC5 5 PPE BB2 22 0.0000 ; -23 TC5 5 PPE BB3 23 0.0000 ; -24 TC4 5 PPE BB4 24 0.0000 ; -25 TC5 6 PPE BB1 25 0.0000 ; -26 TC5 6 PPE BB2 26 0.0000 ; -27 TC5 6 PPE BB3 27 0.0000 ; -28 TC4 6 PPE BB4 28 0.0000 ; -29 TC5 7 PPE BB1 29 0.0000 ; -30 TC5 7 PPE BB2 30 0.0000 ; -31 TC5 7 PPE BB3 31 0.0000 ; -32 TC4 7 PPE BB4 32 0.0000 ; -33 TC5 8 PPE BB1 33 0.0000 ; -34 TC5 8 PPE BB2 34 0.0000 ; -35 TC5 8 PPE BB3 35 0.0000 ; -36 TC4 8 PPE BB4 36 0.0000 ; -37 TC5 9 PPE BB1 37 0.0000 ; -38 TC5 9 PPE BB2 38 0.0000 ; -39 TC5 9 PPE BB3 39 0.0000 ; -40 TC4 9 PPE BB4 40 0.0000 ; -41 TC5 10 PPE BB1 41 0.0000 ; -42 TC5 10 PPE BB2 42 0.0000 ; -43 TC5 10 PPE BB3 43 0.0000 ; -44 TC4 10 PPE BB4 44 0.0000 ; -45 TC5 11 PPE BB1 45 0.0000 ; -46 TC5 11 PPE BB2 46 0.0000 ; -47 TC5 11 PPE BB3 47 0.0000 ; -48 TC4 11 PPE BB4 48 0.0000 ; -49 TC5 12 PPE BB1 49 0.0000 ; -50 TC5 12 PPE BB2 50 0.0000 ; -51 TC5 12 PPE BB3 51 0.0000 ; -52 TC4 12 PPE BB4 52 0.0000 ; -53 TC5 13 PPE BB1 53 0.0000 ; -54 TC5 13 PPE BB2 54 0.0000 ; -55 TC5 13 PPE BB3 55 0.0000 ; -56 TC4 13 PPE BB4 56 0.0000 ; -57 TC5 14 PPE BB1 57 0.0000 ; -58 TC5 14 PPE BB2 58 0.0000 ; -59 TC5 14 PPE BB3 59 0.0000 ; -60 TC4 14 PPE BB4 60 0.0000 ; -61 TC5 15 PPE BB1 61 0.0000 ; -62 TC5 15 PPE BB2 62 0.0000 ; -63 TC5 15 PPE BB3 63 0.0000 ; -64 TC4 15 PPE BB4 64 0.0000 ; -65 TC5 16 PPE BB1 65 0.0000 ; -66 TC5 16 PPE BB2 66 0.0000 ; -67 TC5 16 PPE BB3 67 0.0000 ; -68 TC4 16 PPE BB4 68 0.0000 ; -69 TC5 17 PPE BB1 69 0.0000 ; -70 TC5 17 PPE BB2 70 0.0000 ; -71 TC5 17 PPE BB3 71 0.0000 ; -72 TC4 17 PPE BB4 72 0.0000 ; -73 TC5 18 PPE BB1 73 0.0000 ; -74 TC5 18 PPE BB2 74 0.0000 ; -75 TC5 18 PPE BB3 75 0.0000 ; -76 TC4 18 PPE BB4 76 0.0000 ; -77 TC5 19 PPE BB1 77 0.0000 ; -78 TC5 19 PPE BB2 78 0.0000 ; -79 TC5 19 PPE BB3 79 0.0000 ; -80 TC4 19 PPE BB4 80 0.0000 ; -81 TC5 20 PPEter BB1 81 0.0000 ; -82 TC5 20 PPEter BB2 82 0.0000 ; -83 TC5 20 PPEter BB3 83 0.0000 ; -84 TC4 20 PPEter BB4 84 0.0000 ; -85 TC5 20 PPEter BB5 85 0.0000 ; -86 TC5 20 PPEter BB6 86 0.0000 ; -87 TC5 20 PPEter BB7 87 0.0000 ; +1 TC5 1 PPEinit BB1 1 0.0 +2 TC5 1 PPEinit BB2 2 0.0 +3 TC5 1 PPEinit BB3 3 0.0 +4 TC4 1 PPEinit BB4 4 0.0 +5 TC5 1 PPEinit BB5 5 0.0 +6 TC5 1 PPEinit BB6 6 0.0 +7 TC5 1 PPEinit BB7 7 0.0 +8 TC4 1 PPEinit BB8 8 0.0 +9 TC5 2 PPE BB1 9 0.0 +10 TC5 2 PPE BB2 10 0.0 +11 TC5 2 PPE BB3 11 0.0 +12 TC4 2 PPE BB4 12 0.0 +13 TC5 3 PPE BB1 13 0.0 +14 TC5 3 PPE BB2 14 0.0 +15 TC5 3 PPE BB3 15 0.0 +16 TC4 3 PPE BB4 16 0.0 +17 TC5 4 PPE BB1 17 0.0 +18 TC5 4 PPE BB2 18 0.0 +19 TC5 4 PPE BB3 19 0.0 +20 TC4 4 PPE BB4 20 0.0 +21 TC5 5 PPE BB1 21 0.0 +22 TC5 5 PPE BB2 22 0.0 +23 TC5 5 PPE BB3 23 0.0 +24 TC4 5 PPE BB4 24 0.0 +25 TC5 6 PPE BB1 25 0.0 +26 TC5 6 PPE BB2 26 0.0 +27 TC5 6 PPE BB3 27 0.0 +28 TC4 6 PPE BB4 28 0.0 +29 TC5 7 PPE BB1 29 0.0 +30 TC5 7 PPE BB2 30 0.0 +31 TC5 7 PPE BB3 31 0.0 +32 TC4 7 PPE BB4 32 0.0 +33 TC5 8 PPE BB1 33 0.0 +34 TC5 8 PPE BB2 34 0.0 +35 TC5 8 PPE BB3 35 0.0 +36 TC4 8 PPE BB4 36 0.0 +37 TC5 9 PPE BB1 37 0.0 +38 TC5 9 PPE BB2 38 0.0 +39 TC5 9 PPE BB3 39 0.0 +40 TC4 9 PPE BB4 40 0.0 +41 TC5 10 PPE BB1 41 0.0 +42 TC5 10 PPE BB2 42 0.0 +43 TC5 10 PPE BB3 43 0.0 +44 TC4 10 PPE BB4 44 0.0 +45 TC5 11 PPE BB1 45 0.0 +46 TC5 11 PPE BB2 46 0.0 +47 TC5 11 PPE BB3 47 0.0 +48 TC4 11 PPE BB4 48 0.0 +49 TC5 12 PPE BB1 49 0.0 +50 TC5 12 PPE BB2 50 0.0 +51 TC5 12 PPE BB3 51 0.0 +52 TC4 12 PPE BB4 52 0.0 +53 TC5 13 PPE BB1 53 0.0 +54 TC5 13 PPE BB2 54 0.0 +55 TC5 13 PPE BB3 55 0.0 +56 TC4 13 PPE BB4 56 0.0 +57 TC5 14 PPE BB1 57 0.0 +58 TC5 14 PPE BB2 58 0.0 +59 TC5 14 PPE BB3 59 0.0 +60 TC4 14 PPE BB4 60 0.0 +61 TC5 15 PPE BB1 61 0.0 +62 TC5 15 PPE BB2 62 0.0 +63 TC5 15 PPE BB3 63 0.0 +64 TC4 15 PPE BB4 64 0.0 +65 TC5 16 PPE BB1 65 0.0 +66 TC5 16 PPE BB2 66 0.0 +67 TC5 16 PPE BB3 67 0.0 +68 TC4 16 PPE BB4 68 0.0 +69 TC5 17 PPE BB1 69 0.0 +70 TC5 17 PPE BB2 70 0.0 +71 TC5 17 PPE BB3 71 0.0 +72 TC4 17 PPE BB4 72 0.0 +73 TC5 18 PPE BB1 73 0.0 +74 TC5 18 PPE BB2 74 0.0 +75 TC5 18 PPE BB3 75 0.0 +76 TC4 18 PPE BB4 76 0.0 +77 TC5 19 PPE BB1 77 0.0 +78 TC5 19 PPE BB2 78 0.0 +79 TC5 19 PPE BB3 79 0.0 +80 TC4 19 PPE BB4 80 0.0 +81 TC5 20 PPEter BB1 81 0.0 +82 TC5 20 PPEter BB2 82 0.0 +83 TC5 20 PPEter BB3 83 0.0 +84 TC4 20 PPEter BB4 84 0.0 +85 TC5 20 PPEter BB5 85 0.0 +86 TC5 20 PPEter BB6 86 0.0 +87 TC5 20 PPEter BB7 87 0.0 [ bonds ] -3 4 1 0.23400 9000 -4 5 1 0.23400 9000 -7 8 1 0.23400 9000 -8 9 1 0.23400 9000 -11 12 1 0.23400 9000 -12 13 1 0.23400 9000 -15 16 1 0.23400 9000 -16 17 1 0.23400 9000 -19 20 1 0.23400 9000 -20 21 1 0.23400 9000 -23 24 1 0.23400 9000 -24 25 1 0.23400 9000 -27 28 1 0.23400 9000 -28 29 1 0.23400 9000 -31 32 1 0.23400 9000 -32 33 1 0.23400 9000 -35 36 1 0.23400 9000 -36 37 1 0.23400 9000 -39 40 1 0.23400 9000 -40 41 1 0.23400 9000 -43 44 1 0.23400 9000 -44 45 1 0.23400 9000 -47 48 1 0.23400 9000 -48 49 1 0.23400 9000 -51 52 1 0.23400 9000 -52 53 1 0.23400 9000 -55 56 1 0.23400 9000 -56 57 1 0.23400 9000 -59 60 1 0.23400 9000 -60 61 1 0.23400 9000 -63 64 1 0.23400 9000 -64 65 1 0.23400 9000 -67 68 1 0.23400 9000 -68 69 1 0.23400 9000 -71 72 1 0.23400 9000 -72 73 1 0.23400 9000 -75 76 1 0.23400 9000 -76 77 1 0.23400 9000 -79 80 1 0.23400 9000 -80 81 1 0.23400 9000 -83 84 1 0.23400 9000 -84 85 1 0.23400 9000 +3 4 1 0.234 9000 +4 5 1 0.234 9000 +7 8 1 0.234 9000 +8 9 1 0.234 9000 +11 12 1 0.234 9000 +12 13 1 0.234 9000 +15 16 1 0.234 9000 +16 17 1 0.234 9000 +19 20 1 0.234 9000 +20 21 1 0.234 9000 +23 24 1 0.234 9000 +24 25 1 0.234 9000 +27 28 1 0.234 9000 +28 29 1 0.234 9000 +31 32 1 0.234 9000 +32 33 1 0.234 9000 +35 36 1 0.234 9000 +36 37 1 0.234 9000 +39 40 1 0.234 9000 +40 41 1 0.234 9000 +43 44 1 0.234 9000 +44 45 1 0.234 9000 +47 48 1 0.234 9000 +48 49 1 0.234 9000 +51 52 1 0.234 9000 +52 53 1 0.234 9000 +55 56 1 0.234 9000 +56 57 1 0.234 9000 +59 60 1 0.234 9000 +60 61 1 0.234 9000 +63 64 1 0.234 9000 +64 65 1 0.234 9000 +67 68 1 0.234 9000 +68 69 1 0.234 9000 +71 72 1 0.234 9000 +72 73 1 0.234 9000 +75 76 1 0.234 9000 +76 77 1 0.234 9000 +79 80 1 0.234 9000 +80 81 1 0.234 9000 +83 84 1 0.234 9000 +84 85 1 0.234 9000 [ angles ] 1 3 4 1 143 550 @@ -238,7 +238,7 @@ PPE 3 82 83 84 1 83 650 84 85 86 1 83 650 84 85 87 1 143 550 -1 4 7 1 165 50 +1 4 8 1 165 50 80 84 87 1 165 50 [ dihedrals ] @@ -286,69 +286,69 @@ PPE 3 84 86 87 85 2 0 50 [ constraints ] -1 2 1 0.32500 -1 3 1 0.32500 -2 3 1 0.32500 -5 6 1 0.32500 -5 7 1 0.32500 -6 7 1 0.32500 -9 10 1 0.32500 -9 11 1 0.32500 -10 11 1 0.32500 -13 14 1 0.32500 -13 15 1 0.32500 -14 15 1 0.32500 -17 18 1 0.32500 -17 19 1 0.32500 -18 19 1 0.32500 -21 22 1 0.32500 -21 23 1 0.32500 -22 23 1 0.32500 -25 26 1 0.32500 -25 27 1 0.32500 -26 27 1 0.32500 -29 30 1 0.32500 -29 31 1 0.32500 -30 31 1 0.32500 -33 34 1 0.32500 -33 35 1 0.32500 -34 35 1 0.32500 -37 38 1 0.32500 -37 39 1 0.32500 -38 39 1 0.32500 -41 42 1 0.32500 -41 43 1 0.32500 -42 43 1 0.32500 -45 46 1 0.32500 -45 47 1 0.32500 -46 47 1 0.32500 -49 50 1 0.32500 -49 51 1 0.32500 -50 51 1 0.32500 -53 54 1 0.32500 -53 55 1 0.32500 -54 55 1 0.32500 -57 58 1 0.32500 -57 59 1 0.32500 -58 59 1 0.32500 -61 62 1 0.32500 -61 63 1 0.32500 -62 63 1 0.32500 -65 66 1 0.32500 -65 67 1 0.32500 -66 67 1 0.32500 -69 70 1 0.32500 -69 71 1 0.32500 -70 71 1 0.32500 -73 74 1 0.32500 -73 75 1 0.32500 -74 75 1 0.32500 -77 78 1 0.32500 -77 79 1 0.32500 -78 79 1 0.32500 -81 82 1 0.32500 -81 83 1 0.32500 -82 83 1 0.32500 -85 86 1 0.32500 -85 87 1 0.32500 -86 87 1 0.32500 +1 2 1 0.325 +1 3 1 0.325 +2 3 1 0.325 +5 6 1 0.325 +5 7 1 0.325 +6 7 1 0.325 +9 10 1 0.325 +9 11 1 0.325 +10 11 1 0.325 +13 14 1 0.325 +13 15 1 0.325 +14 15 1 0.325 +17 18 1 0.325 +17 19 1 0.325 +18 19 1 0.325 +21 22 1 0.325 +21 23 1 0.325 +22 23 1 0.325 +25 26 1 0.325 +25 27 1 0.325 +26 27 1 0.325 +29 30 1 0.325 +29 31 1 0.325 +30 31 1 0.325 +33 34 1 0.325 +33 35 1 0.325 +34 35 1 0.325 +37 38 1 0.325 +37 39 1 0.325 +38 39 1 0.325 +41 42 1 0.325 +41 43 1 0.325 +42 43 1 0.325 +45 46 1 0.325 +45 47 1 0.325 +46 47 1 0.325 +49 50 1 0.325 +49 51 1 0.325 +50 51 1 0.325 +53 54 1 0.325 +53 55 1 0.325 +54 55 1 0.325 +57 58 1 0.325 +57 59 1 0.325 +58 59 1 0.325 +61 62 1 0.325 +61 63 1 0.325 +62 63 1 0.325 +65 66 1 0.325 +65 67 1 0.325 +66 67 1 0.325 +69 70 1 0.325 +69 71 1 0.325 +70 71 1 0.325 +73 74 1 0.325 +73 75 1 0.325 +74 75 1 0.325 +77 78 1 0.325 +77 79 1 0.325 +78 79 1 0.325 +81 82 1 0.325 +81 83 1 0.325 +82 83 1 0.325 +85 86 1 0.325 +85 87 1 0.325 +86 87 1 0.325 From b32ceca5b2a9f51465ea1a365a6a23bc091cead7 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 11:18:43 +0200 Subject: [PATCH 045/275] move missing links to graph utils --- polyply/src/graph_utils.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/polyply/src/graph_utils.py b/polyply/src/graph_utils.py index ad784c1b..a134d25e 100644 --- a/polyply/src/graph_utils.py +++ b/polyply/src/graph_utils.py @@ -137,6 +137,36 @@ def find_connecting_edges(res_graph, molecule, nodes): return edges +def find_missing_edges(res_graph, molecule): + """ + Given a molecular residue graph find all those nodes + that are connected in the residue graph but have no + connection in the molecule graph. + + Parameters + ---------- + res_graph: :class:`nx.Graph` + residue graph; must have the attribute "graph" and + "resid", where graph is the fragment the node describes + in the mol_graph + molecule: :class:`vermouth.molecule.Molecule` + vermouth molecule underlying the residue graph + + Yields: + -------- + dict + dict containing the resnams and resids of the + nodes corresponding to the missing links + """ + for origin, target in res_graph.edges: + connecting_edges = find_connecting_edges(res_graph, molecule, (origin, target)) + if len(connecting_edges) == 0: + resA = res_graph.nodes[origin]["resname"] + resB = res_graph.nodes[target]["resname"] + idxA = res_graph.nodes[origin]["resid"] + idxB = res_graph.nodes[target]["resid"] + yield {"resA": resA, "idxA": idxA, "resB": resB, "idxB": idxB} + def _compute_path_length_cartesian(mol_idx, path, nonbond_matrix): """ Computes the maximum length a graph path based on the super-CG model From 1ee0cbfb39c0b82584773ec56560e0d7bbe1d8e4 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 11:29:06 +0200 Subject: [PATCH 046/275] add test for missing edges --- polyply/tests/test_graph_utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/polyply/tests/test_graph_utils.py b/polyply/tests/test_graph_utils.py index cf27d3be..78f5163a 100644 --- a/polyply/tests/test_graph_utils.py +++ b/polyply/tests/test_graph_utils.py @@ -61,3 +61,15 @@ def test_find_connecting_edges(example_meta_molecule, nodes, expected): example_meta_molecule.molecule, nodes) assert result == expected + + +@pytest.mark.parametrize('del_edge, expected',( + ({"u":1, "v":4}, [{"resA": "A", "idxA": 1, "resB": "B", "idxB": 2}]), + # central residue + ({"u":6, "v":9}, [{"resA": "B", "idxA": 2, "resB": "A", "idxB": 3}]), + )) +def test_find_missing_edges(example_meta_molecule, del_edge, expected): + example_meta_molecule.molecule.remove_edge(**del_edge) + for idx, missing in enumerate(polyply.src.graph_utils.find_missing_edges(example_meta_molecule, + example_meta_molecule.molecule)): + assert missing == expected[idx] From deb20e05fdd1748003e1379b55c88df46a2d6cc5 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 11:32:25 +0200 Subject: [PATCH 047/275] remove missing_edges from gen_params; update test for missing edges --- polyply/src/gen_itp.py | 44 ++------------------------------ polyply/tests/test_gen_params.py | 4 +-- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 77ae5080..eb8a5eef 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -30,6 +30,7 @@ from vermouth.citation_parser import citation_formatter from vermouth.graph_utils import make_residue_graph from polyply import (MetaMolecule, ApplyLinks, Monomer, MapToMolecule) +from polyply.src.graph_utils import find_missing_edges from .load_library import load_library LOGGER = StyleAdapter(get_logger(__name__)) @@ -57,47 +58,6 @@ def split_seq_string(sequence): monomers.append(Monomer(resname=resname, n_blocks=n_blocks)) return monomers -# TODO move the two functions below to meta-molecule -# and generalize to a function that returns edges -# replacing the equivalent function in graph_utils - -def _are_connected(graph, origin_nodes, target_nodes): - """ - Given a list of origin nodes check if any of these - nodes is neighbor to any of the target nodes. - """ - for node in origin_nodes: - for neigh in graph.neighbors(node): - if neigh in target_nodes: - return True - return False - -def find_missing_links(meta_molecule): - """ - Given a connected meta_molecule graph and a disconnected - molecule, figure out which residue connections are missing. - - Parameters - ---------- - meta_molecule: `:class:polyply.MetaMolecule` - - Yields: - -------- - dict - dict containing the resnams and resids of the - nodes corresponding to the missing links - """ - for origin, target in meta_molecule.edges: - origin_nodes = meta_molecule.nodes[origin]['graph'].nodes - target_nodes = meta_molecule.nodes[target]['graph'].nodes - if not _are_connected(meta_molecule.molecule, origin_nodes, target_nodes): - resA = meta_molecule.nodes[origin]["resname"] - resB = meta_molecule.nodes[target]["resname"] - idxA = meta_molecule.nodes[origin]["resid"] - idxB = meta_molecule.nodes[target]["resid"] - yield {"resA": resA, "idxA": idxA, "resB": resB, "idxB": idxB} - - def gen_params(args): # Import of Itp and FF files LOGGER.info("reading input and library files", type="step") @@ -125,7 +85,7 @@ def gen_params(args): LOGGER.warning("Your molecule consists of disjoint parts." "Perhaps links were not applied correctly.") msg = "Missing link between residue {idxA} {resA} and residue {idxB} {resB}" - for missing in find_missing_links(meta_molecule): + for missing in find_missing_edges(meta_molecule, meta_molecule.molecule): LOGGER.warning(msg, **missing) with deferred_open(args.outpath, 'w') as outpath: diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index 8e0d9844..c9d9a27c 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -21,7 +21,7 @@ import vermouth.molecule import vermouth.gmx.itp_read from polyply import gen_params, TEST_DATA, MetaMolecule -from polyply.src.gen_itp import find_missing_links +from polyply.src.graph_utils import find_missing_edges class TestGenParams(): @staticmethod @@ -122,7 +122,7 @@ def test_find_missing_links(): meta_mol = MetaMolecule.from_itp(ff, fname, "P3HTref") meta_mol.molecule.remove_edge(39, 45) # resid 7,8 meta_mol.molecule.remove_edge(15, 21) # resid 3,4 - missing = list(find_missing_links(meta_mol)) + missing = list(find_missing_edges(meta_mol, meta_mol.molecule)) assert len(missing) == 2 for edge in missing: assert edge["resA"] == "P3HTref" From 6a6fb3bf871fea1394093496574241cda3c6241e Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 12:49:05 +0200 Subject: [PATCH 048/275] Update polyply/src/graph_utils.py Co-authored-by: Peter C Kroon --- polyply/src/graph_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/graph_utils.py b/polyply/src/graph_utils.py index a134d25e..b0300d3c 100644 --- a/polyply/src/graph_utils.py +++ b/polyply/src/graph_utils.py @@ -160,7 +160,7 @@ def find_missing_edges(res_graph, molecule): """ for origin, target in res_graph.edges: connecting_edges = find_connecting_edges(res_graph, molecule, (origin, target)) - if len(connecting_edges) == 0: + if not connecting_edges: resA = res_graph.nodes[origin]["resname"] resB = res_graph.nodes[target]["resname"] idxA = res_graph.nodes[origin]["resid"] From cbaca5f55bdda7126010ac630017acdb3f06bd36 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 12:53:26 +0200 Subject: [PATCH 049/275] improve test gen_params for missing edges --- polyply/tests/test_gen_params.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index c9d9a27c..74352bff 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -124,8 +124,8 @@ def test_find_missing_links(): meta_mol.molecule.remove_edge(15, 21) # resid 3,4 missing = list(find_missing_edges(meta_mol, meta_mol.molecule)) assert len(missing) == 2 - for edge in missing: + for edge, ref in zip(missing, [(3, 4), (7, 8)]): assert edge["resA"] == "P3HTref" assert edge["resB"] == "P3HTref" - assert edge["idxA"] in [3, 4, 7, 8] - assert edge["idxB"] in [3, 4, 7, 8] + assert edge["idxA"] == ref[0] + assert edge["idxB"] == ref[1] From eb765d3197d861e420a4290e74a9260ae42c3de5 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 13:29:41 +0200 Subject: [PATCH 050/275] parse args as func variables not class attributes to gen_itp --- bin/polyply | 12 ++++++------ polyply/src/gen_itp.py | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/bin/polyply b/bin/polyply index c421fb6f..fb987b88 100755 --- a/bin/polyply +++ b/bin/polyply @@ -4,7 +4,7 @@ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# You may obtain a OBcopy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # @@ -242,14 +242,14 @@ def main(): # pylint: disable=too-many-locals,too-many-statements for block in force_field.blocks: print(block) parser.exit() -# if args.list_links: -# print('The following Links are known to force field {}:'.format(args.list_links)) -# print(', '.join(known_force_fields[args.list_links])) -# parser.exit() LOGGER.setLevel(LOGLEVELS[args.verbosity]) + args_dict = vars(args) + subprogram = args_dict['func'] + for remove_args in ['list_ff', 'list_blocks', 'verbosity', 'func']: + del args_dict[remove_args] - args.func(args) + subprogram(**args_dict) if __name__ == '__main__': diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 3f8f6619..605a4673 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -56,21 +56,42 @@ def split_seq_string(sequence): monomers.append(Monomer(resname=resname, n_blocks=n_blocks)) return monomers -def gen_params(args): +def gen_params(name, inpath, lib, seq, seq_file, outpath): + """ + Top level function for running the polyply parameter generation. + Parameters seq and seq_file are mutually exclusive. Set the other + to None. Of inpath and lib only one has to be given. Set the other + to None if not used. + + Parameters + ---------- + name: str + name of the molecule in the itp file + inpath: list[:class:pathlib.Path] + list of paths to files with input definitions + library: str + name of the library to use + seq: list[str] + list of strings with format "resname:#monomers" + seqf: :class:`pathlib.Path` + file path to valid sequence file (.json/.fasta/.ig/.txt) + outpath: :class:`pathlib.Path` + file path for output file + """ # Import of Itp and FF files LOGGER.info("reading input and library files", type="step") - force_field = load_library(args.name, args.lib, args.inpath) + force_field = load_library(name, lib, inpath) # Generate the MetaMolecule - if args.seq: + if seq: LOGGER.info("reading sequence from command", type="step") - monomers = split_seq_string(args.seq) + monomers = split_seq_string(seq) meta_molecule = MetaMolecule.from_monomer_seq_linear(monomers=monomers, force_field=force_field, - mol_name=args.name) - elif args.seq_file: + mol_name=name) + elif seq_file: LOGGER.info("reading sequence from file", type="step") - meta_molecule = MetaMolecule.from_sequence_file(force_field, args.seq_file, args.name) + meta_molecule = MetaMolecule.from_sequence_file(force_field, seq_file, name) # Do transformationa and apply link LOGGER.info("mapping sequence to molecule", type="step") @@ -84,7 +105,7 @@ def gen_params(args): msg = "You molecule consists of {:d} disjoint parts. Perhaps links were not applied correctly." LOGGER.warning(msg, (n_components)) - with deferred_open(args.outpath, 'w') as outpath: + with deferred_open(outpath, 'w') as outfile: header = [ ' '.join(sys.argv) + "\n" ] header.append("Please cite the following papers:") for citation in meta_molecule.molecule.citations: @@ -92,8 +113,8 @@ def gen_params(args): LOGGER.info("Please cite: " + cite_string) header.append(cite_string) - vermouth.gmx.itp.write_molecule_itp(meta_molecule.molecule, outpath, - moltype=args.name, header=header) + vermouth.gmx.itp.write_molecule_itp(meta_molecule.molecule, outfile, + moltype=name, header=header) DeferredFileWriter().write() # ducktape for renaming the itp tool From e6122f94982c2cd76c4bc6a9a042c2655cb12a2a Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 13:45:31 +0200 Subject: [PATCH 051/275] parse args as func variables not class attributes to gen_seq --- polyply/src/gen_seq.py | 53 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index b734b4c1..a0385ec1 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -303,11 +303,62 @@ def _tag_nodes(graph, tags, seed=None): weights, attr, nodes=idx_nodes, seed=seed) -def gen_seq(args): +def gen_seq(name, + outpath, + inpath=None, + seq, + macros=[], + from_file=None, + connects=[] + modifications=[] + tags=[], + ): """ Given a sequence definition and macros defining smaller building blocks of the sequence, create a residue graph and write it to a .json file to be used with gen_itp. + + Parameters + ---------- + name: str + name of the sequence + inpath: list[:class:pathlib.Path] + list of paths to files with input definitions + outpath: :class:`pathlib.Path` + file path for output file + seq: str + Define the sequence order in which to combine macros. + The format is . For example, + to combine three blocks called A, B, which are defined by the + macro syntax use and define how they are connected + using the connects flag. + macors: + Define small polymer fragments by a string: + the format is :<#blocks>:<#branches>: + where residues has the format . + Examples are linear PEG of length 10 + or a random copolymer of PS-PEG . + But we can also generate branched polymer with 3 generations + using . + connects: list[str] + Provide connect records for sequence. + The format is . + For example if we want to connect the first and third + block in a sequence, using a connection between the second + and third residue in these blocks respectively the input + would be <1:3:2-3>. + modifications: list[str] + Change the resname of terminii of a specific block + in the sequence. The format of the strings is + + tags: list[str] + Set one or more labels for the residues. Labels can be + referred to in the ff input files and used as a selector + for applying links. See the workflow documentation for + more information. Labels can also be applied statistically. + The syntax is + For example setting the chirality on PS could be done this way + <0:chiral:R-0.5,S-0.5> """ macros = {} From 67c32e68971383d4f21c2eff8d9f20447964125e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 14:10:33 +0200 Subject: [PATCH 052/275] parse args as func variables not class attributes to gen_coords --- polyply/src/gen_coords.py | 142 +++++++++++++++++++++++++++++++------- 1 file changed, 117 insertions(+), 25 deletions(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 928b9aa0..94f4664b 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -93,39 +93,131 @@ def _check_molecules(molecules): 'connected by bonds, constraints or virual-sites') raise IOError(msg.format(molecule.name)) -def gen_coords(args): +def gen_coords(toppath, + outpath, + coordpath=None, + build=None + build_res=[] + ign=[] + cycles=[], + cycle_tol=0.0 + split=[] + ligands=[] + grid_spacing=0.2 + grid=None + maxiter=800 + start=[], + dens=None + box=None + maxiter_random=100 + step_fudge=1.0 + max_force=5*10**4.0 + nrewind=5, + back_fudge): + """ + Subprogram for coordinate generation which implements the default + polyply workflow for structure generation. In general a topology + file is read, all molecules are extracted. Subseuqeuntly for each + residue in the system a template is built. Afterwards a random-walk + is performed for ecah residue based on a volume estimated from + the templates. Once the RW residue coordinates are generated, they + are backmapped. + + Parameters + ---------- + toppath: :class:pathlib.Path + Path to topology file + outpath: :class:pathlib.Path + Path to coordinate file + build: :class:pathlib.Path + Path to build file + build_res: list[str] + List of resnames to build + ign: list[str] + List of molecule names to ignore + cycles: list[str] + List of cyclic molecule names + cycle_tol: float + Tolarance in nm for cycles to be closed + split: list[str] + Split single residue into more residues. The syntax is + :-,: + Note that all atoms of the old residues need to be in at + most one new residue and must all be accounted for. + ligands: list[str] + Specify ligands of molecules which should be placed close + to a specific molecule. The format is as follows: + #-#:#-#. + Elements of the specification can be omitted as required. + Note mol_name and resname cannot contain the characters + # and -. + grid_spacing: float + Grid spacing in nm + grid: str + Path to file with grid-points + maxiter: int + Maximum number of trys to generate coordinates for a molecule. + The default is 800. + start: list[str] + Specify which residue to build first. The syntax is + #-#. Parts of this + specification may be omitted. + Note mol_name and resname cannot contain the characters # + and -. + dens: float + Density of the system (kg/m3) + box: np.ndarray(1,3) + Rectangular box x, y, z in nm + maxiter_random: int + Maximum number of trys to place a residue with + the random walk module. + step_fudge: float + Scale the step length in random walk by this fudge factor. + The default is 1. + max_force: float + Maximum force under which placement of a residue is accepted. + The default is 5x10^4 kJ/(mol*nm). + nrewind: int + Number of residues to trace back when RW step fails in first + attempt. The default is 5. + back_fudge: float + Fudge factor by which to scale the coordinates of the residues + during the backmapping step. 1 will result in to-scale coordinates + but likely generate overlaps. + """ + # Read in the topology LOGGER.info("reading topology", type="step") - topology = Topology.from_gmx_topfile(name=args.name, path=args.toppath) + topology = Topology.from_gmx_topfile(name=name, path=toppath) LOGGER.info("processing topology", type="step") topology.preprocess() _check_molecules(topology.molecules) - if args.split: + if split: LOGGER.info("splitting residues", type="step") for molecule in topology.molecules: - molecule.split_residue(args.split) + molecule.split_residue(split) # read in coordinates if there are any - if args.coordpath: + if coordpath: LOGGER.info("loading coordinates", type="step") - topology.add_positions_from_file(args.coordpath, args.build_res) + topology.add_positions_from_file(coordpath, build_res) # load in built file - if args.build: + if build: LOGGER.info("reading build file", type="step") - with open(args.build) as build_file: + with open(build) as build_file: lines = build_file.readlines() read_build_file(lines, topology.molecules, topology) # collect all starting points for the molecules - start_dict = find_starting_node_from_spec(topology, args.start) + start_dict = find_starting_node_from_spec(topology, start) # handle grid input - if args.grid: + if grid: LOGGER.info("loading grid", type="step") - args.grid = np.loadtxt(args.grid) + grid = np.loadtxt(grid) # do a sanity check LOGGER.info("checking residue integrity", type="step") @@ -134,29 +226,29 @@ def gen_coords(args): LOGGER.info("generating templates", type="step") GenerateTemplates(topology=topology, max_opt=10).run_system(topology) LOGGER.info("annotating ligands", type="step") - ligand_annotator = AnnotateLigands(topology, args.ligands) + ligand_annotator = AnnotateLigands(topology, ligands) ligand_annotator.run_system(topology) LOGGER.info("generating system coordinates", type="step") - _initialize_cylces(topology, args.cycles, args.cycle_tol) + _initialize_cylces(topology, cycles, cycle_tol) BuildSystem(topology, start_dict=start_dict, - density=args.density, - max_force=args.max_force, - grid_spacing=args.grid_spacing, - maxiter=args.maxiter, - box=args.box, - step_fudge=args.step_fudge, - ignore=args.ignore, - grid=args.grid, - cycles=args.cycles, - nrewind=args.nrewind).run_system(topology.molecules) + density=density, + max_force=max_force, + grid_spacing=grid_spacing, + maxiter=maxiter, + box=box, + step_fudge=step_fudge, + ignore=ignore, + grid=grid, + cycles=cycles, + nrewind=nrewind).run_system(topology.molecules) ligand_annotator.split_ligands() LOGGER.info("backmapping to target resolution", type="step") - Backmap(fudge_coords=args.bfudge).run_system(topology) + Backmap(fudge_coords=bfudge).run_system(topology) # Write output LOGGER.info("writing output", type="step") command = ' '.join(sys.argv) system = topology.convert_to_vermouth_system() - vermouth.gmx.gro.write_gro(system, args.outpath, precision=7, + vermouth.gmx.gro.write_gro(system, outpath, precision=7, title=command, box=topology.box) DeferredFileWriter().write() From a1031e9ef8b583bdc2de3ef08d0c37784839aa38 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 14:27:10 +0200 Subject: [PATCH 053/275] fix bugs in top-level programs --- polyply/src/gen_coords.py | 30 +++++++++++++++--------------- polyply/src/gen_itp.py | 6 +++--- polyply/src/gen_seq.py | 28 +++++++++++++++------------- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 94f4664b..79b79270 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -96,24 +96,24 @@ def _check_molecules(molecules): def gen_coords(toppath, outpath, coordpath=None, - build=None - build_res=[] - ign=[] + build=None, + build_res=[], + ign=[], cycles=[], - cycle_tol=0.0 - split=[] - ligands=[] - grid_spacing=0.2 - grid=None - maxiter=800 + cycle_tol=0.0, + split=[], + ligands=[], + grid_spacing=0.2, + grid=None, + maxiter=800, start=[], - dens=None - box=None - maxiter_random=100 - step_fudge=1.0 - max_force=5*10**4.0 + dens=None, + box=None, + maxiter_random=100, + step_fudge=1.0, + max_force=5*10**4.0, nrewind=5, - back_fudge): + back_fudge=0.4): """ Subprogram for coordinate generation which implements the default polyply workflow for structure generation. In general a topology diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 605a4673..8aa781de 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -56,7 +56,7 @@ def split_seq_string(sequence): monomers.append(Monomer(resname=resname, n_blocks=n_blocks)) return monomers -def gen_params(name, inpath, lib, seq, seq_file, outpath): +def gen_params(name, outpath, inpath=None, lib=None, seq=None, seq_file=None): """ Top level function for running the polyply parameter generation. Parameters seq and seq_file are mutually exclusive. Set the other @@ -67,6 +67,8 @@ def gen_params(name, inpath, lib, seq, seq_file, outpath): ---------- name: str name of the molecule in the itp file + outpath: :class:`pathlib.Path` + file path for output file inpath: list[:class:pathlib.Path] list of paths to files with input definitions library: str @@ -75,8 +77,6 @@ def gen_params(name, inpath, lib, seq, seq_file, outpath): list of strings with format "resname:#monomers" seqf: :class:`pathlib.Path` file path to valid sequence file (.json/.fasta/.ig/.txt) - outpath: :class:`pathlib.Path` - file path for output file """ # Import of Itp and FF files LOGGER.info("reading input and library files", type="step") diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index a0385ec1..04e32057 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -305,12 +305,12 @@ def _tag_nodes(graph, tags, seed=None): def gen_seq(name, outpath, - inpath=None, seq, - macros=[], + inpath=None, + macro_strings=[], from_file=None, - connects=[] - modifications=[] + connects=[], + modifications=[], tags=[], ): """ @@ -332,7 +332,7 @@ def gen_seq(name, to combine three blocks called A, B, which are defined by the macro syntax use and define how they are connected using the connects flag. - macors: + macro_strings: list[str] Define small polymer fragments by a string: the format is :<#blocks>:<#branches>: where residues has the format . @@ -340,6 +340,8 @@ def gen_seq(name, or a random copolymer of PS-PEG . But we can also generate branched polymer with 3 generations using . + from_file: list[pathlib.Path] + Paths to files which to take as macro. connects: list[str] Provide connect records for sequence. The format is . @@ -362,21 +364,21 @@ def gen_seq(name, """ macros = {} - if args.from_file: - force_field = load_library("seq", None, args.inpath) - for tag_name in args.from_file: + if from_file: + force_field = load_library("seq", None, inpath) + for tag_name in from_file: tag, name = tag_name.split(":") macros[tag] = MacroFile(name, force_field) - for macro_string in args.macros: + for macro_string in macro_strings: macro = MacroString(macro_string) macros[macro.name] = macro - seq_graph = generate_seq_graph(args.seq, macros, args.connects) + seq_graph = generate_seq_graph(seq, macros, connects) - _apply_termini_modifications(seq_graph, args.modifications) - _tag_nodes(seq_graph, args.tags) + _apply_termini_modifications(seq_graph, modifications) + _tag_nodes(seq_graph, tags) g_json = json_graph.node_link_data(seq_graph) - with open(args.outpath, "w") as file_handle: + with open(outpath, "w") as file_handle: json.dump(g_json, file_handle, indent=2) From f134e3c12d3740b80d00c35d239e86eaf44d37ac Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 14:27:35 +0200 Subject: [PATCH 054/275] change argument destination macros to macro_strings to avoid conflict in gen_seq --- bin/polyply | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/polyply b/bin/polyply index fb987b88..b48e9de3 100755 --- a/bin/polyply +++ b/bin/polyply @@ -180,7 +180,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements help='output file (.json)', required=True) macro_group = parser_gen_seq.add_argument_group('Definitions of macros') - macro_group.add_argument('-from_string', dest='macros', nargs='+', type=str, + macro_group.add_argument('-from_string', dest='macro_strings', nargs='+', type=str, help=("Define small polymer fragments: " "the format is :<#blocks>:<#branches>: " "where residues has the format . " From 41d9a4bfd2c60fb8374da4419ddd83acf9f9db11 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 14:28:00 +0200 Subject: [PATCH 055/275] update seq and param tests --- polyply/tests/test_gen_params.py | 13 +-------- polyply/tests/test_gen_seq.py | 50 +++++++------------------------- 2 files changed, 12 insertions(+), 51 deletions(-) diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index aa0fa78b..92c54374 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -75,20 +75,9 @@ def test_gen_params(args_in, ref_file): ff_group = parser.add_argument_group('Force field selection') ff_group.add_argument('-lib', dest='lib', required=False, type=str, help='force-fields to include from library', nargs='*') - ff_group.add_argument('-ff-dir', dest='extra_ff_dir', action='append', - type=Path, default=[], - help='Additional repository for custom force fields.') - ff_group.add_argument('-list-lib', action='store_true', dest='list_ff', - help='List all known force fields, and exit.') - ff_group.add_argument('-list-blocks', action='store_true', dest='list_blocks', - help='List all Blocks known to the' - ' force field, and exit.') - ff_group.add_argument('-list-links', action='store_true', dest='list_links', - help='List all Links known to the' - ' force field, and exit.') args = parser.parse_args(args_in) - gen_params(args) + gen_params(**vars(args)) force_field = vermouth.forcefield.ForceField(name='test_ff') diff --git a/polyply/tests/test_gen_seq.py b/polyply/tests/test_gen_seq.py index 200fb30a..033f586a 100644 --- a/polyply/tests/test_gen_seq.py +++ b/polyply/tests/test_gen_seq.py @@ -167,64 +167,36 @@ def test_tag_nodes(tags, expected, seed): _tag_nodes(graph, tags, seed) assert nx.get_node_attributes(graph, "chiral") == expected -class Args: - """ - Inpute Arguments for the sequence generator. - """ - - def __init__(self, - name=None, - ffpath=None, - outpath=None, - macros=None, - file_macros=None, - seq=None, - connects=None, - lib=None, - modifications=[], - inpath=None, - tags=[]): - - self.name = name - self.lib = lib - self.ffpath = ffpath - self.outpath = outpath - self.macros = macros - self.from_file = file_macros - self.seq = seq - self.connects = connects - self.inpath = inpath - self.modifications = modifications - self.tags = [] - -@pytest.mark.parametrize('_input, ref_file', ( +@pytest.mark.parametrize('args, ref_file', ( (dict(outpath=TEST_DATA + "/gen_seq/output/PPI.json", - macros=["A:3:2:N1-1.0"], + macro_strings=["A:3:2:N1-1.0"], seq=["A", "A"], + name="test", connects=["0:1:0-0"]), TEST_DATA + "/gen_seq/ref/PPI_ref.json"), (dict(outpath=TEST_DATA + "/gen_seq/output/PEO_PS.json", - macros=["A:11:1:PEO-1", "B:11:1:PS-1"], + macro_strings=["A:11:1:PEO-1", "B:11:1:PS-1"], connects=["0:1:10-0"], + name="test", seq=["A", "B"]), TEST_DATA + "/gen_seq/ref/PEO_PS_ref.json"), (dict(outpath=TEST_DATA + "/gen_seq/output/lysoPEG.json", inpath=[TEST_DATA + "/gen_seq/input/molecule_0.itp"], - macros=["A:5:1:PEG-1.0"], - file_macros=["PROT:molecule_0"], + macro_strings=["A:5:1:PEG-1.0"], + from_file=["PROT:molecule_0"], + name="test", seq=["PROT", "A"], connects=["0:1:0-0"]), TEST_DATA + "/gen_seq/ref/lyso_PEG.json") )) -def test_gen_seq(_input, ref_file): - arguments = Args(**_input) - gen_seq(arguments) +def test_gen_seq(args, ref_file): + gen_seq(**args) with open(ref_file) as _file: js_graph = json.load(_file) ref_graph = json_graph.node_link_graph(js_graph) - with open(_input["outpath"]) as _file: + with open(args["outpath"]) as _file: js_graph = json.load(_file) out_graph = json_graph.node_link_graph(js_graph) From 5b1b29d1e615d7e32b79d63095afb26508366aad Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 15:53:02 +0200 Subject: [PATCH 056/275] fix variable names in gen_coords --- polyply/src/gen_coords.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 79b79270..f31f621b 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -95,10 +95,11 @@ def _check_molecules(molecules): def gen_coords(toppath, outpath, + name, coordpath=None, build=None, build_res=[], - ign=[], + ignore=[], cycles=[], cycle_tol=0.0, split=[], @@ -107,13 +108,13 @@ def gen_coords(toppath, grid=None, maxiter=800, start=[], - dens=None, + density=None, box=None, maxiter_random=100, step_fudge=1.0, max_force=5*10**4.0, nrewind=5, - back_fudge=0.4): + bfudge=0.4): """ Subprogram for coordinate generation which implements the default polyply workflow for structure generation. In general a topology @@ -129,11 +130,13 @@ def gen_coords(toppath, Path to topology file outpath: :class:pathlib.Path Path to coordinate file + name: str + Name of the molecule build: :class:pathlib.Path Path to build file build_res: list[str] List of resnames to build - ign: list[str] + ignore: list[str] List of molecule names to ignore cycles: list[str] List of cyclic molecule names @@ -164,7 +167,7 @@ def gen_coords(toppath, specification may be omitted. Note mol_name and resname cannot contain the characters # and -. - dens: float + density: float Density of the system (kg/m3) box: np.ndarray(1,3) Rectangular box x, y, z in nm @@ -180,7 +183,7 @@ def gen_coords(toppath, nrewind: int Number of residues to trace back when RW step fails in first attempt. The default is 5. - back_fudge: float + bfudge: float Fudge factor by which to scale the coordinates of the residues during the backmapping step. 1 will result in to-scale coordinates but likely generate overlaps. From e55637aadf205ce255601df17cd8296f0e8cc46d Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 4 Jul 2022 16:13:18 +0200 Subject: [PATCH 057/275] change argument type for grid spacing from int to float --- bin/polyply | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/polyply b/bin/polyply index c421fb6f..b367cbc6 100755 --- a/bin/polyply +++ b/bin/polyply @@ -125,7 +125,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements '# and -.')) system_group = parser_gen_coords.add_argument_group('Options for system generation') - system_group.add_argument('-gs', dest='grid_spacing', type=int, + system_group.add_argument('-gs', dest='grid_spacing', type=float, help='grid spacing (nm)', default=0.2) system_group.add_argument('-grid', dest='grid', type=str, help='file with grid-points', default=None) From bbf36f778cbcf78ce50ca6b7cbb45353e2b694c5 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:01:34 +0200 Subject: [PATCH 058/275] Update bin/polyply Co-authored-by: Peter C Kroon --- bin/polyply | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/polyply b/bin/polyply index b48e9de3..6a4693e0 100755 --- a/bin/polyply +++ b/bin/polyply @@ -4,7 +4,7 @@ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a OBcopy of the License at +# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # From 993abf49ffced55ac32d96326b9e1ea6bd8f55c2 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:01:39 +0200 Subject: [PATCH 059/275] Update polyply/src/gen_coords.py Co-authored-by: Peter C Kroon --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index f31f621b..b1e08b25 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -118,7 +118,7 @@ def gen_coords(toppath, """ Subprogram for coordinate generation which implements the default polyply workflow for structure generation. In general a topology - file is read, all molecules are extracted. Subseuqeuntly for each + file is read, all molecules are extracted. Subsequently for each residue in the system a template is built. Afterwards a random-walk is performed for ecah residue based on a volume estimated from the templates. Once the RW residue coordinates are generated, they From eb7c349b3511c8f11f47bb2d755a4760d57e3b5b Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:01:45 +0200 Subject: [PATCH 060/275] Update polyply/src/gen_coords.py Co-authored-by: Peter C Kroon --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index b1e08b25..82432d7d 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -120,7 +120,7 @@ def gen_coords(toppath, polyply workflow for structure generation. In general a topology file is read, all molecules are extracted. Subsequently for each residue in the system a template is built. Afterwards a random-walk - is performed for ecah residue based on a volume estimated from + is performed for each residue based on a volume estimated from the templates. Once the RW residue coordinates are generated, they are backmapped. From 5273727997590a28cda07a9a8a99ac2c476d206d Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:01:50 +0200 Subject: [PATCH 061/275] Update polyply/src/gen_coords.py Co-authored-by: Peter C Kroon --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 82432d7d..68dcba1d 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -141,7 +141,7 @@ def gen_coords(toppath, cycles: list[str] List of cyclic molecule names cycle_tol: float - Tolarance in nm for cycles to be closed + Tolerance in nm for cycles to be closed split: list[str] Split single residue into more residues. The syntax is :-,: From 6041c5507274c9fd358ab082ecb619222f684f8c Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:01:56 +0200 Subject: [PATCH 062/275] Update polyply/src/gen_itp.py Co-authored-by: Peter C Kroon --- polyply/src/gen_itp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 8aa781de..1dc46880 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -69,7 +69,7 @@ def gen_params(name, outpath, inpath=None, lib=None, seq=None, seq_file=None): name of the molecule in the itp file outpath: :class:`pathlib.Path` file path for output file - inpath: list[:class:pathlib.Path] + inpath: list[pathlib.Path] list of paths to files with input definitions library: str name of the library to use From fa881bf8c7d199427eaf9687dbb39c11bbd9fa39 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:02:02 +0200 Subject: [PATCH 063/275] Update polyply/src/gen_seq.py Co-authored-by: Peter C Kroon --- polyply/src/gen_seq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index 04e32057..a2de54f3 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -322,7 +322,7 @@ def gen_seq(name, ---------- name: str name of the sequence - inpath: list[:class:pathlib.Path] + inpath: list[pathlib.Path] list of paths to files with input definitions outpath: :class:`pathlib.Path` file path for output file From fe25de95214c1255b6d238f46c94564f6530f186 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:02:06 +0200 Subject: [PATCH 064/275] Update polyply/src/gen_seq.py Co-authored-by: Peter C Kroon --- polyply/src/gen_seq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index a2de54f3..b3874bc4 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -350,7 +350,7 @@ def gen_seq(name, and third residue in these blocks respectively the input would be <1:3:2-3>. modifications: list[str] - Change the resname of terminii of a specific block + Change the resname of termini of a specific block in the sequence. The format of the strings is tags: list[str] From f9ef30505bdbd3b6e68de1f27b13e7ef0cfcf78b Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 4 Jul 2022 18:07:41 +0200 Subject: [PATCH 065/275] Update README.md add news item to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index afb68bf8..f379319f 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ force-field, molecule parameters and this program. ## News - (Feb 8) **Featured Research Article in Nature Communcations.** Our article on the polyply software suite is now featured on the [Editors' Highlights](https://www.nature.com/collections/hhfigaahch) for Structural biology, biochemistry and biophysics in Nature Communications. The Editors’ Highlights pages aims to showcase the 50 best papers recently published in an area. The development team is beyond happy to receive this honor. +- (May 23) **Fighting Cancer with polyply.** Dane et al. used polyply to setup simulations of vesicles and lipid nanodiscs (LNDs) containing PEGylated lipids, which are used as nanocarriers for cancer therapeutics. They find that LNDs are more effective in delivery likely due to their higher flexibility. Check it out in [Nature Materials](https://www.nature.com/articles/s41563-022-01251-z). ## Contributions & Support We are happy to accept submissions of polymer parameters to the polyply library. To submit parameters simply From 505b23cdadca8e0747c9fbb1c24cdc00f219f2c4 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:49:20 +0200 Subject: [PATCH 066/275] Update polyply/src/gen_itp.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_itp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 1dc46880..a88a2b0d 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -72,7 +72,7 @@ def gen_params(name, outpath, inpath=None, lib=None, seq=None, seq_file=None): inpath: list[pathlib.Path] list of paths to files with input definitions library: str - name of the library to use + name of the force field library to use seq: list[str] list of strings with format "resname:#monomers" seqf: :class:`pathlib.Path` From d895b5a51550da491b7bf204e454419cc54eccdd Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:49:31 +0200 Subject: [PATCH 067/275] Update polyply/src/gen_seq.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_seq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index b3874bc4..88b7dab0 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -359,7 +359,7 @@ def gen_seq(name, for applying links. See the workflow documentation for more information. Labels can also be applied statistically. The syntax is - For example setting the chirality on PS could be done this way + For example setting the chirality on PS could be done in this way <0:chiral:R-0.5,S-0.5> """ macros = {} From e1bfd957a53a772db4dc7194f3b515c9fd921a7e Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:49:40 +0200 Subject: [PATCH 068/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 68dcba1d..d96356fe 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -159,7 +159,7 @@ def gen_coords(toppath, grid: str Path to file with grid-points maxiter: int - Maximum number of trys to generate coordinates for a molecule. + Maximum number of tries to generate coordinates for a molecule. The default is 800. start: list[str] Specify which residue to build first. The syntax is From e438a72859d3d60bf0dd11e7bf706492d82c30a1 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:50:21 +0200 Subject: [PATCH 069/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index d96356fe..c9c30909 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -172,7 +172,7 @@ def gen_coords(toppath, box: np.ndarray(1,3) Rectangular box x, y, z in nm maxiter_random: int - Maximum number of trys to place a residue with + Maximum number of tries to place a residue with the random walk module. step_fudge: float Scale the step length in random walk by this fudge factor. From 4103e816956d85d8793aee4e26eb2b220a9cf184 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:50:38 +0200 Subject: [PATCH 070/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index c9c30909..800435a7 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -181,7 +181,7 @@ def gen_coords(toppath, Maximum force under which placement of a residue is accepted. The default is 5x10^4 kJ/(mol*nm). nrewind: int - Number of residues to trace back when RW step fails in first + Number of residues to trace back when random walk step fails in first attempt. The default is 5. bfudge: float Fudge factor by which to scale the coordinates of the residues From 1108e9c7a2c1a956c2ed70cc4b89912ab1736d54 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:50:49 +0200 Subject: [PATCH 071/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 800435a7..6848caf4 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -121,7 +121,7 @@ def gen_coords(toppath, file is read, all molecules are extracted. Subsequently for each residue in the system a template is built. Afterwards a random-walk is performed for each residue based on a volume estimated from - the templates. Once the RW residue coordinates are generated, they + the templates. Once the random walk residue coordinates are generated, they are backmapped. Parameters From f2d4d27118c76204138b736383b27f547ecd1fa6 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:51:02 +0200 Subject: [PATCH 072/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 6848caf4..853956a2 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -117,7 +117,7 @@ def gen_coords(toppath, bfudge=0.4): """ Subprogram for coordinate generation which implements the default - polyply workflow for structure generation. In general a topology + polyply workflow for structure generation. In general, a topology file is read, all molecules are extracted. Subsequently for each residue in the system a template is built. Afterwards a random-walk is performed for each residue based on a volume estimated from From 577440208bddc7155af801d5f4c291d9686545fb Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:52:42 +0200 Subject: [PATCH 073/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 853956a2..c2acec2f 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -118,7 +118,7 @@ def gen_coords(toppath, """ Subprogram for coordinate generation which implements the default polyply workflow for structure generation. In general, a topology - file is read, all molecules are extracted. Subsequently for each + file is read from which all molecules are extracted. Subsequently for each residue in the system a template is built. Afterwards a random-walk is performed for each residue based on a volume estimated from the templates. Once the random walk residue coordinates are generated, they From aea72cbb8cea0ce30c60e524554296cbbf63aafb Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:52:50 +0200 Subject: [PATCH 074/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index c2acec2f..d8877ac7 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -119,7 +119,7 @@ def gen_coords(toppath, Subprogram for coordinate generation which implements the default polyply workflow for structure generation. In general, a topology file is read from which all molecules are extracted. Subsequently for each - residue in the system a template is built. Afterwards a random-walk + residue in the system a template is built. Afterwards a random walk is performed for each residue based on a volume estimated from the templates. Once the random walk residue coordinates are generated, they are backmapped. From 47180ae8a92f839338d1e8bece4d6fa6da3dbaa8 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:52:57 +0200 Subject: [PATCH 075/275] Update polyply/src/gen_coords.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_coords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index d8877ac7..ae33183a 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -186,7 +186,7 @@ def gen_coords(toppath, bfudge: float Fudge factor by which to scale the coordinates of the residues during the backmapping step. 1 will result in to-scale coordinates - but likely generate overlaps. + but will likely generate overlaps. """ # Read in the topology From 2d50e10b40d1cf3f79ff674079f219594035b1bb Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:53:06 +0200 Subject: [PATCH 076/275] Update polyply/src/gen_seq.py Co-authored-by: Riccardo Alessandri --- polyply/src/gen_seq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index 88b7dab0..429ac7ec 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -335,7 +335,7 @@ def gen_seq(name, macro_strings: list[str] Define small polymer fragments by a string: the format is :<#blocks>:<#branches>: - where residues has the format . + where residues have the format . Examples are linear PEG of length 10 or a random copolymer of PS-PEG . But we can also generate branched polymer with 3 generations From 0df87e2e1d279748a6706a922a3fb2200fa82ef1 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 13 Jul 2022 17:26:58 +0200 Subject: [PATCH 077/275] update topology tests --- polyply/tests/test_data/topology_test/test.gro | 8 +------- polyply/tests/test_topology.py | 3 +++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/polyply/tests/test_data/topology_test/test.gro b/polyply/tests/test_data/topology_test/test.gro index a1b12a7a..c9f52fec 100644 --- a/polyply/tests/test_data/topology_test/test.gro +++ b/polyply/tests/test_data/topology_test/test.gro @@ -1,5 +1,5 @@ PMMA test file - 20 + 14 1PMMA C1 1 -0.024 -0.125 0.104 1PMMA C2 2 -0.089 -0.100 -0.028 1PMMA C3 3 -0.040 -0.186 -0.145 @@ -14,10 +14,4 @@ PMMA test file 2PMMA O1 12 -1.010 2.895 9.806 2PMMA O2 13 -0.913 2.924 9.613 2PMMA C5 14 -0.860 3.036 9.683 - 3PMMA C1 15 -1.812 -5.338 3.667 - 3PMMA C2 16 -1.876 -5.313 3.535 - 3PMMA C3 17 -1.828 -5.399 3.418 - 3PMMA C4 18 -1.802 -5.185 3.573 - 3PMMA O1 19 -1.814 -5.141 3.687 - 3PMMA O2 20 -1.717 -5.113 3.495 10.00000 10.00000 10.00000 diff --git a/polyply/tests/test_topology.py b/polyply/tests/test_topology.py index c84178d3..ce122564 100644 --- a/polyply/tests/test_topology.py +++ b/polyply/tests/test_topology.py @@ -34,6 +34,9 @@ def test_from_gmx_topfile(): @staticmethod def test_add_positions_from_gro(): + """ + The last residue has no coordinates defined. + """ top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/system.top", "test") top.add_positions_from_file(TEST_DATA + "/topology_test/test.gro") for node in top.molecules[0].molecule.nodes: From 6867b5a7cdd509137619cc5b19f1690eaa207b8e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 13 Jul 2022 17:27:16 +0200 Subject: [PATCH 078/275] allow parsing of meta_molecule coordinates --- polyply/src/topology.py | 84 +++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 28 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 68911a68..9c6e7bd0 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -20,6 +20,7 @@ from collections import defaultdict from itertools import combinations import numpy as np +import networkx as nx from vermouth.system import System from vermouth.forcefield import ForceField from vermouth.gmx.gro import read_gro @@ -44,8 +45,8 @@ def _coord_parser(path, extension): molecule.merge_molecule(new_mol) else: molecule = molecules - - return molecule + positions = np.array(list(nx.get_node_attributes(molecule, "position").values())) + return positions def replace_defined_interaction(interaction, defines): @@ -356,41 +357,68 @@ def convert_nonbond_to_sig_eps(self): self.nonbond_params.update({atom_pair: {"nb1": sig, "nb2": eps}}) - def add_positions_from_file(self, path, build_res=[]): + def add_positions_from_file(self, path, skip_res=[], resolution='mol'): """ - Add positions to topology from coordinate file. + Add positions to molecules in topology from coordinate file. + Depending on the resolution set they are either added to the + meta_molecule or the molecules. With `skip_res` residues can + be skipped by name. + + Note that molecule coordinates will also set the meta_molecule + coordinates. Coordinates for a single residue must be complete. + + Currently .gro and .pdb file parsers are supoprted for the + coordinate reading. See `_coord_parsers` for more information. + + Parameters + ---------- + path: :class:`pathlib.Path` + path to coordinate file + skip_res: list[str] + list of resnames to skip + resolution: str + choice of meta_mol or mol """ path = Path(path) extension = path.suffix.casefold()[1:] - molecules = _coord_parser(path, extension) + positions = _coord_parser(path, extension) + max_coords = len(positions) total = 0 for meta_mol in self.molecules: - no_coords = [] - for node in meta_mol.molecule.nodes: - resname = meta_mol.molecule.nodes[node]["resname"] - if resname in build_res: - no_coords.append(node) + for meta_node in meta_mol.nodes: + resname = meta_mol.nodes[meta_node]["resname"] + mol_nodes = meta_mol.nodes[meta_node]['graph'].nodes + # skip residue if resname is to be skipped or + # if the no more coordinates are available + # in that case we want to build the node and + # backmap it + if resname in skip_res or total >= max_coords: + meta_mol.nodes[meta_node]["build"] = True + meta_mol.nodes[meta_node]["backmap"] = True continue - try: - position = molecules.nodes[total]["position"] - except KeyError: - no_coords.append(node) - else: - meta_mol.molecule.nodes[node]["position"] = position + # here we only add meta_molecule coordiantes + # in that case we only want to backmap + if resolution == 'meta_mol': + meta_mol.nodes[meta_node]["position"] = positions[total] + meta_mol.nodes[meta_node]["backmap"] = True total += 1 - - for node in meta_mol: - resid = meta_mol.nodes[node]["resid"] - atoms_in_res = list(meta_mol.nodes[node]["graph"].nodes) - - if all(atom not in no_coords for atom in atoms_in_res): - positions = np.array([meta_mol.molecule.nodes[atom]["position"] for - atom in atoms_in_res]) - center = center_of_geometry(positions) - meta_mol.nodes[node]["position"] = center - meta_mol.nodes[node]["build"] = False + # here we set molecule coordinates in that case we neither + # want to backmap nor build these nodes else: - meta_mol.nodes[node]["build"] = True + start = total + for mol_node in mol_nodes: + # of the coordinates for a single residue are incomplete + # we raise an error because otherwise we would set them + # based on a non-complete residue + try: + meta_mol.molecule.nodes[mol_node]["position"] = positions[total] + except IndexError: + raise IOError from IndexError + total += 1 + + meta_mol.nodes[meta_node]["position"] = center_of_geometry(positions[start:total]) + meta_mol.nodes[meta_node]["build"] = False + meta_mol.nodes[meta_node]["backmap"] = False def convert_to_vermouth_system(self): system = System() From e236e2890ab074f622e7f37bbee2bdafefeed8c3 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 13 Jul 2022 17:27:39 +0200 Subject: [PATCH 079/275] allow parsing of meta_molecule coordinates in gen_coords and bin/polyply --- bin/polyply | 4 +++- polyply/src/gen_coords.py | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bin/polyply b/bin/polyply index a9a8dedd..29e0b6ff 100755 --- a/bin/polyply +++ b/bin/polyply @@ -94,7 +94,9 @@ def main(): # pylint: disable=too-many-locals,too-many-statements file_group.add_argument('-o', dest='outpath', type=Path, help='output GRO (.gro)') file_group.add_argument('-c', dest='coordpath', type=Path, - help='input file (.gro)', default=None) + help='input file molecules (.gro)', default=None) + file_group.add_argument('-mc', dest='coordpath_meta', type=Path, + help='input file meta-molecule (.gro)', default=None) file_group.add_argument('-b', dest='build', type=Path, default=None, help=('input file; specify molecule specific building options')) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index ae33183a..14501e0f 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -97,6 +97,7 @@ def gen_coords(toppath, outpath, name, coordpath=None, + coordpath_meta=None, build=None, build_res=[], ignore=[], @@ -204,8 +205,18 @@ def gen_coords(toppath, # read in coordinates if there are any if coordpath: - LOGGER.info("loading coordinates", type="step") - topology.add_positions_from_file(coordpath, build_res) + LOGGER.info("loading molecule coordinates", type="step") + topology.add_positions_from_file(coordpath, + skip=build_res, + resolution='mol') + + # read in meta-molecule coordaintes of there are any + if coordpath_meta: + LOGGER.info("loading meta_molecule coordinates", type="step") + topology.add_meta_positions_from_file(coordpath_meta, + skip_res=build_res, + resolution='meta_mol' + ) # load in built file if build: From 5318984a2ed4bd98ca01b6c62698f4d7e8d11231 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 13 Jul 2022 17:32:38 +0200 Subject: [PATCH 080/275] add test for only meta-molecule coordinates --- polyply/src/topology.py | 1 + polyply/tests/test_data/topology_test/meta.gro | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 polyply/tests/test_data/topology_test/meta.gro diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 9c6e7bd0..0ee765bb 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -401,6 +401,7 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): if resolution == 'meta_mol': meta_mol.nodes[meta_node]["position"] = positions[total] meta_mol.nodes[meta_node]["backmap"] = True + meta_mol.nodes[meta_node]["build"] = False total += 1 # here we set molecule coordinates in that case we neither # want to backmap nor build these nodes diff --git a/polyply/tests/test_data/topology_test/meta.gro b/polyply/tests/test_data/topology_test/meta.gro new file mode 100644 index 00000000..aa20030b --- /dev/null +++ b/polyply/tests/test_data/topology_test/meta.gro @@ -0,0 +1,5 @@ +PMMA test file + 2 + 1PMMA C1 1 -0.024 -0.125 0.104 + 1PMMA C2 2 -0.089 -0.100 -0.028 + 10.00000 10.00000 10.00000 From 66e20e31c973539f80640abae6e0859070a9f77e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 13 Jul 2022 17:34:17 +0200 Subject: [PATCH 081/275] add test for only meta-molecule coordinates --- polyply/tests/test_topology.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/polyply/tests/test_topology.py b/polyply/tests/test_topology.py index ce122564..384b1b96 100644 --- a/polyply/tests/test_topology.py +++ b/polyply/tests/test_topology.py @@ -47,8 +47,26 @@ def test_add_positions_from_gro(): if node != 2: assert "position" in top.molecules[0].nodes[node].keys() assert top.molecules[0].nodes[node]["build"] == False + assert top.molecules[0].nodes[node]["backmap"] == False else: assert top.molecules[0].nodes[node]["build"] == True + assert top.molecules[0].nodes[node]["backmap"] == True + + @staticmethod + def test_add_meta_positions_from_gro(): + """ + The last residue has no coordinates defined. + """ + top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/system.top", "test") + top.add_positions_from_file(TEST_DATA + "/topology_test/meta.gro", resolution="meta_mol") + for node in top.molecules[0].nodes: + if node != 2: + assert "position" in top.molecules[0].nodes[node].keys() + assert top.molecules[0].nodes[node]["build"] == False + assert top.molecules[0].nodes[node]["backmap"] == True + else: + assert top.molecules[0].nodes[node]["build"] == True + assert top.molecules[0].nodes[node]["backmap"] == True @staticmethod def test_add_positions_from_pdb(): From 01c7d9a4efbb934370931179e2d3606d9f32d783 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 13 Jul 2022 17:38:41 +0200 Subject: [PATCH 082/275] use backmap attribute instead of build in backmap processor --- polyply/src/backmap.py | 2 +- polyply/tests/test_backmap.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/polyply/src/backmap.py b/polyply/src/backmap.py index 919fc805..b643c07b 100644 --- a/polyply/src/backmap.py +++ b/polyply/src/backmap.py @@ -168,7 +168,7 @@ def _place_init_coords(self, meta_molecule): """ built_nodes = [] for node in meta_molecule.nodes: - if meta_molecule.nodes[node]["build"]: + if meta_molecule.nodes[node]["backmap"]: resname = meta_molecule.nodes[node]["resname"] cg_coord = meta_molecule.nodes[node]["position"] resid = meta_molecule.nodes[node]["resid"] diff --git a/polyply/tests/test_backmap.py b/polyply/tests/test_backmap.py index 21293d17..91aa1ba5 100644 --- a/polyply/tests/test_backmap.py +++ b/polyply/tests/test_backmap.py @@ -45,13 +45,13 @@ def test_backmapping(): nx.set_node_attributes(meta_molecule, {0: {"resname": "test", "position": np.array([0, 0, 0]), - "resid": 1, "build": True}, + "resid": 1, "backmap": True}, 1: {"resname": "test", "position": np.array([0, 0, 1.0]), - "resid": 2, "build": True}, + "resid": 2, "backmap": True}, 2: {"resname": "test", "position": np.array([0, 0, 2.0]), - "resid": 3, "build": False}}) + "resid": 3, "backmap": False}}) # test if disordered template works meta_molecule.templates = {"test": {"B": np.array([0, 0, 0]), "A": np.array([0, 0, 0.5]), From 3d8249df81e1b418a2c7b533e5e5db4704818a0e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 13 Jul 2022 17:48:31 +0200 Subject: [PATCH 083/275] add backmap key in all relevant places --- polyply/src/meta_molecule.py | 4 +++- polyply/tests/test_meta_molecule.py | 4 ++++ polyply/tests/test_topology.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/polyply/src/meta_molecule.py b/polyply/src/meta_molecule.py index 7a8a09ad..56511881 100644 --- a/polyply/src/meta_molecule.py +++ b/polyply/src/meta_molecule.py @@ -100,6 +100,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.molecule = None nx.set_node_attributes(self, True, "build") + nx.set_node_attributes(self, True, "backmap") self.__search_tree = None self.root = None self.dfs = False @@ -131,7 +132,7 @@ def add_monomer(self, current, resname, connections): else: resid = 1 - self.add_node(current, resname=resname, resid=resid, build=True) + self.add_node(current, resname=resname, resid=resid, build=True, backmap=True) for edge in connections: if self.has_node(edge[0]) and self.has_node(edge[1]): self.add_edge(edge[0], edge[1]) @@ -161,6 +162,7 @@ def relabel_and_redo_res_graph(self, mapping): old_resid = self.molecule.nodes[node]["resid"] self.molecule.nodes[node]["resid"] = old_resid + max_resid self.molecule.nodes[node]["build"] = True + self.molecule.nodes[node]["backmap"] = True # make a new residue graph and overwrite the old one new_meta_graph = make_residue_graph(self.molecule, attrs=('resid', 'resname')) diff --git a/polyply/tests/test_meta_molecule.py b/polyply/tests/test_meta_molecule.py index 6130b5cd..492cb69f 100644 --- a/polyply/tests/test_meta_molecule.py +++ b/polyply/tests/test_meta_molecule.py @@ -39,6 +39,10 @@ def test_add_monomer(): assert nx.get_node_attributes(meta_mol, "resname") == {0: 'PEO', 1: 'PEO'} assert list(meta_mol.nodes) == [0, 1] assert list(meta_mol.edges) == [(0, 1)] + assert meta_mol.nodes[0]["build"] + assert meta_mol.nodes[1]["build"] + assert meta_mol.nodes[0]["backmap"] + assert meta_mol.nodes[1]["backmap"] @staticmethod def test_add_monomer_fail(): diff --git a/polyply/tests/test_topology.py b/polyply/tests/test_topology.py index 384b1b96..818bc2a1 100644 --- a/polyply/tests/test_topology.py +++ b/polyply/tests/test_topology.py @@ -80,6 +80,7 @@ def test_add_positions_from_pdb(): for node in meta_mol.nodes: assert "position" in meta_mol.nodes[node].keys() assert meta_mol.nodes[node]["build"] == False + assert meta_mol.nodes[node]["backmap"] == False @staticmethod def test_convert_to_vermouth_system(): From 3d62c625dabcd578c3e3a1c71ed3abb89fe3cc47 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Thu, 14 Jul 2022 18:01:09 +0200 Subject: [PATCH 084/275] add parsing of templates --- polyply/src/build_file_parser.py | 50 ++++++++++++++++++++- polyply/tests/test_build_file_parser.py | 58 +++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/polyply/src/build_file_parser.py b/polyply/src/build_file_parser.py index f8e2f358..868465f8 100644 --- a/polyply/src/build_file_parser.py +++ b/polyply/src/build_file_parser.py @@ -13,6 +13,7 @@ # limitations under the License. from collections import defaultdict, namedtuple import numpy as np +import vermouth from vermouth.parser_utils import SectionLineParser from vermouth.log_helpers import StyleAdapter, get_logger @@ -34,8 +35,10 @@ def __init__(self, molecules, topology): self.current_molidxs = [] self.build_options = defaultdict(list) self.current_molname = None - self.rw_options = dict() + self.rw_options = {} self.persistence_length = {} + self.templates = {} + self.volumes = {} @SectionLineParser.section_parser('molecule') def _molecule(self, line, lineno=0): @@ -125,11 +128,55 @@ def _persistence_length(self, line, lineno=0): specs = PersistenceSpecs(*[model, persistence_length, start, stop, self.current_molidxs]) self.topology.persistences.append(specs) + @SectionLineParser.section_parser('template') + def _template(self, line, lineno=0): + """ + Parses the lines in the '[template]' + directive and stores it. + """ + name = line.split()[1] + self.templates[name] = vermouth.molecule.Block() + self.templates[name].name = name + self.template_name = name + + @SectionLineParser.section_parser('template', 'atoms') + def _template_atoms(self, line, lineno=0): + """ + Parses the lines in the '[atoms]' + directive of the '[template]' section + """ + tokens = line.split() + node_name = tokens[0] + position = np.array(tokens[1:], dtype=float) + self.templates[self.template_name].add_node(node_name, position=position) + + @SectionLineParser.section_parser('template', 'bonds') + def _template_bonds(self, line, lineno=0): + """ + Parses the lines in the '[bonds]' + directive of the '[template]' section + """ + tokens = line.split() + nodeA = tokens[0] + nodeB = tokens[1] + self.templates[self.template_name].add_edge(nodeA, nodeB) + print("go here") + + @SectionLineParser.section_parser('volumes') + def _volume(self, line, lineno=0): + """ + Parses the lines in the '[volumes]' + directive and stores it. + """ + resname, volume = line.split() + self.topology.volume[resname] = float(volume) + def finalize(self, lineno=0): """ Tag each molecule node with the chirality and build options if that molecule is mentioned in the build file by name. """ + print("go here") for mol_idx, molecule in enumerate(self.molecules): if (molecule.mol_name, mol_idx) in self.build_options: @@ -140,6 +187,7 @@ def finalize(self, lineno=0): self._tag_nodes(molecule, "rw_options", self.rw_options[(molecule.mol_name, mol_idx)], molecule.mol_name) + molecule.templates = self.templates super().finalize diff --git a/polyply/tests/test_build_file_parser.py b/polyply/tests/test_build_file_parser.py index 1e64f61d..de05edd0 100644 --- a/polyply/tests/test_build_file_parser.py +++ b/polyply/tests/test_build_file_parser.py @@ -18,6 +18,7 @@ import pytest import numpy as np import networkx as nx +import vermouth import vermouth.forcefield import vermouth.molecule import polyply @@ -264,3 +265,60 @@ def test_persistence_parsers(test_system, lines, expected): for info_ref, info_new in zip(ref[:-1], new[:-1]): assert info_ref == info_new assert all(ref[-1] == new[-1]) + +@pytest.mark.parametrize('line, names, edges, positions', ( + (("""[ template ] + resname PEO + [ atoms ] + EC1 0.000 0.000 0.000 + O1 0.000 0.000 0.150 + EC2 0.000 0.000 0.300 + [ bonds ] + EC1 O1 + O1 EC2 + """, + ["PEO"], + [[("EC1", "O1"), ("O1", "EC2")]], + [[("EC1", 0.0, 0.0, 0.0), + ("O1", 0.000, 0.000, 0.150), + ("EC2", 0.000, 0.000, 0.300)]]), + ("""[ template ] + resname PEO + [ atoms ] + EC1 0.000 0.000 0.000 + O1 0.000 0.000 0.150 + EC2 0.000 0.000 0.300 + [ bonds ] + EC1 O1 + O1 EC2 + [ template ] + resname OH + [ atoms ] + O1 0.0000 0.000 0.000 + H1 0.0000 0.000 0.100 + [ bonds ] + O1 H1 + """, + ["PEO", "OH"], + [[("EC1", "O1"), ("O1", "EC2")], [("O1", "H1")]], + [[("EC1", 0.0, 0.0, 0.0), + ("O1", 0.000, 0.000, 0.150), + ("EC2", 0.000, 0.000, 0.300)], + [("O1", 0.0000, 0.000, 0.000), + ("H1", 0.0000, 0.000, 0.100)] + ]), +))) +def test_template_parsing(test_system, line, names, edges, positions): + lines = textwrap.dedent(line) + lines = lines.splitlines() + polyply.src.build_file_parser.read_build_file(lines, + test_system.molecules, + test_system) + for mol in test_system.molecules: + assert len(mol.templates) == len(names) + for idx, name in enumerate(names): + template = mol.templates[name] + assert edges[idx] == list(template.edges) + for node_pos in positions[idx]: + node = node_pos[0] + assert all(np.array(node_pos[1:], dtype=float) == template.nodes[node]["position"]) From f9aa3606bcdaba3471b53b5c3e28822d05e2e639 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Thu, 14 Jul 2022 18:08:17 +0200 Subject: [PATCH 085/275] add parsing of volumes --- polyply/src/build_file_parser.py | 5 ++--- polyply/tests/test_build_file_parser.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/polyply/src/build_file_parser.py b/polyply/src/build_file_parser.py index 868465f8..3678e477 100644 --- a/polyply/src/build_file_parser.py +++ b/polyply/src/build_file_parser.py @@ -38,7 +38,7 @@ def __init__(self, molecules, topology): self.rw_options = {} self.persistence_length = {} self.templates = {} - self.volumes = {} + self.topology.volumes = {} @SectionLineParser.section_parser('molecule') def _molecule(self, line, lineno=0): @@ -160,7 +160,6 @@ def _template_bonds(self, line, lineno=0): nodeA = tokens[0] nodeB = tokens[1] self.templates[self.template_name].add_edge(nodeA, nodeB) - print("go here") @SectionLineParser.section_parser('volumes') def _volume(self, line, lineno=0): @@ -169,7 +168,7 @@ def _volume(self, line, lineno=0): directive and stores it. """ resname, volume = line.split() - self.topology.volume[resname] = float(volume) + self.topology.volumes[resname] = float(volume) def finalize(self, lineno=0): """ diff --git a/polyply/tests/test_build_file_parser.py b/polyply/tests/test_build_file_parser.py index de05edd0..6e99239a 100644 --- a/polyply/tests/test_build_file_parser.py +++ b/polyply/tests/test_build_file_parser.py @@ -322,3 +322,24 @@ def test_template_parsing(test_system, line, names, edges, positions): for node_pos in positions[idx]: node = node_pos[0] assert all(np.array(node_pos[1:], dtype=float) == template.nodes[node]["position"]) + +@pytest.mark.parametrize('line, expected', ( + ((""" + [ volumes ] + PEO 0.47 + """, + {"PEO": 0.47}), + (""" + [ volumes ] + PEO 0.47 + P3HT 0.61 + """, + {"PEO": 0.47, "P3HT": 0.61}), +))) +def test_template_parsing(test_system, line, expected): + lines = textwrap.dedent(line) + lines = lines.splitlines() + polyply.src.build_file_parser.read_build_file(lines, + test_system.molecules, + test_system) + assert test_system.volumes == expected From 40b81742bf7e04c1544174e1ad58032330c0e376 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 15 Jul 2022 11:49:51 +0200 Subject: [PATCH 086/275] linting and implement check for defined templates/volumes --- polyply/src/generate_templates.py | 44 ++++++++++++++++++------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/polyply/src/generate_templates.py b/polyply/src/generate_templates.py index 3ab02958..93e163ef 100644 --- a/polyply/src/generate_templates.py +++ b/polyply/src/generate_templates.py @@ -13,7 +13,6 @@ # limitations under the License. import networkx as nx import numpy as np -import scipy import vermouth from vermouth.log_helpers import StyleAdapter, get_logger from .minimizer import optimize_geometry @@ -89,10 +88,9 @@ def find_interaction_involving(block, current_node, prev_node): return False, interaction, inter_type elif prev_node in interaction.atoms and inter_type.split("_")[0] == "virtual": return True, interaction, inter_type - else: - msg = '''Cannot build template for residue {}. No constraint, bond, virtual-site - linking atom {} and atom {}.''' - raise IOError(msg.format(block.nodes[0]["resname"], prev_node, current_node)) + msg = '''Cannot build template for residue {}. No constraint, bond, virtual-site + linking atom {} and atom {}.''' + raise IOError(msg.format(block.nodes[0]["resname"], prev_node, current_node)) def _expand_inital_coords(block, max_count=50000): """ @@ -180,9 +178,8 @@ def compute_volume(molecule, block, coords, nonbond_params, treshold=1e-18): rad = float(nonbond_params[frozenset([atom_key, atom_key])]["nb1"]) diff = coord - res_center_of_geometry if np.linalg.norm(diff) < treshold: - continue - else: - geom_vects[idx, :] = diff + u_vect(diff) * rad + continue + geom_vects[idx, :] = diff + u_vect(diff) * rad idx += 1 if geom_vects.shape[0] > 1: @@ -302,9 +299,12 @@ def __init__(self, topology, max_opt, *args, **kwargs): super().__init__(*args, **kwargs) self.templates = {} self.resnames = [] - self.volumes = {} self.max_opt = max_opt self.topology = topology + if "volumes" in self.topology: + self.volumes = self.topology.volumes + else: + self.volumes = {} def _gen_templates(self, meta_molecule): """ @@ -325,10 +325,8 @@ def _gen_templates(self, meta_molecule): """ resnames = set(nx.get_node_attributes(meta_molecule.molecule, "resname").values()) - templates = {} - volumes = {} for resname in resnames: - if not resname in self.resnames: + if not resname in self.resnames and resname not in meta_molecule.templates: self.resnames.append(resname) block = extract_block(meta_molecule.molecule, resname, self.topology.defines) @@ -337,8 +335,13 @@ def _gen_templates(self, meta_molecule): while True: coords = _expand_inital_coords(block) - success, coords = optimize_geometry(block, coords, ["bonds", "constraints", "angles"]) - success, coords = optimize_geometry(block, coords, ["bonds", "constraints", "angles", "dihedrals"]) + success, coords = optimize_geometry(block, + coords, + ["bonds", "constraints", "angles"]) + + success, coords = optimize_geometry(block, + coords, + ["bonds", "constraints", "angles", "dihedrals"]) if success: break @@ -349,19 +352,24 @@ def _gen_templates(self, meta_molecule): break else: opt_counter += 1 - - self.volumes[resname] = compute_volume(meta_molecule, block, coords, self.topology.nonbond_params) coords = map_from_CoG(coords) self.templates[resname] = coords + elif resname in meta_molecule.templates: + coords = meta_molecule.templates[resname] + coords = map_from_CoG(coords) + self.templates[resname] = coords + else: + coords = None - return templates, volumes + if coords and resname not in self.volumes: + self.volumes[resname] = compute_volume(meta_molecule, block, coords, self.topology.nonbond_params) def run_molecule(self, meta_molecule): """ Execute the generation of templates and set the template and volume attribute. """ - templates, volumes = self._gen_templates(meta_molecule) + self._gen_templates(meta_molecule) meta_molecule.templates = self.templates self.topology.volumes = self.volumes return meta_molecule From 561b5f34df2c5c233593850dcbdaa53f7b8affb1 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 15 Jul 2022 18:01:04 +0200 Subject: [PATCH 087/275] handle already present volumes/templates --- polyply/src/generate_templates.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/polyply/src/generate_templates.py b/polyply/src/generate_templates.py index 93e163ef..bbf16c44 100644 --- a/polyply/src/generate_templates.py +++ b/polyply/src/generate_templates.py @@ -301,11 +301,20 @@ def __init__(self, topology, max_opt, *args, **kwargs): self.resnames = [] self.max_opt = max_opt self.topology = topology - if "volumes" in self.topology: + if hasattr(self.topology, "volumes"): self.volumes = self.topology.volumes else: self.volumes = {} + def _update_templates_volumes(self, meta_molecule): + for resname, block in meta_molecule.template_blocks.items(): + coords = nx.get_node_attributes(block, "positions") + coords = map_from_CoG(coords) + self.volumes[resname] = compute_volume(meta_molecule, + block, coords, + self.topology.nonbond_params) + self.templates[resname] = coords + def _gen_templates(self, meta_molecule): """ Generate blocks for each unique residue by extracting the @@ -326,8 +335,7 @@ def _gen_templates(self, meta_molecule): resnames = set(nx.get_node_attributes(meta_molecule.molecule, "resname").values()) for resname in resnames: - if not resname in self.resnames and resname not in meta_molecule.templates: - self.resnames.append(resname) + if resname not in self.templates: block = extract_block(meta_molecule.molecule, resname, self.topology.defines) @@ -352,23 +360,22 @@ def _gen_templates(self, meta_molecule): break else: opt_counter += 1 + coords = map_from_CoG(coords) self.templates[resname] = coords - elif resname in meta_molecule.templates: - coords = meta_molecule.templates[resname] - coords = map_from_CoG(coords) - self.templates[resname] = coords - else: - coords = None - if coords and resname not in self.volumes: - self.volumes[resname] = compute_volume(meta_molecule, block, coords, self.topology.nonbond_params) + if resname not in self.volumes: + self.volumes[resname] = compute_volume(meta_molecule, + block, coords, + self.topology.nonbond_params) def run_molecule(self, meta_molecule): """ Execute the generation of templates and set the template and volume attribute. """ + if hasattr(meta_molecule, "template_blocks"): + self._update_templates_volumes(meta_molecule) self._gen_templates(meta_molecule) meta_molecule.templates = self.templates self.topology.volumes = self.volumes From 29de6e2b3283049597f67e326dd1cfed2df3726f Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Thu, 21 Jul 2022 16:10:28 +0200 Subject: [PATCH 088/275] address comments + map template from COG --- polyply/src/build_file_parser.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/polyply/src/build_file_parser.py b/polyply/src/build_file_parser.py index 3678e477..b93541f3 100644 --- a/polyply/src/build_file_parser.py +++ b/polyply/src/build_file_parser.py @@ -16,6 +16,7 @@ import vermouth from vermouth.parser_utils import SectionLineParser from vermouth.log_helpers import StyleAdapter, get_logger +from .generate_templates import map_from_CoG LOGGER = StyleAdapter(get_logger(__name__)) @@ -38,6 +39,7 @@ def __init__(self, molecules, topology): self.rw_options = {} self.persistence_length = {} self.templates = {} + self.current_template = None self.topology.volumes = {} @SectionLineParser.section_parser('molecule') @@ -132,12 +134,13 @@ def _persistence_length(self, line, lineno=0): def _template(self, line, lineno=0): """ Parses the lines in the '[template]' - directive and stores it. + directive and stores it. The line should be + 'resname ALA' for example. """ + # we only need the residue name name = line.split()[1] - self.templates[name] = vermouth.molecule.Block() - self.templates[name].name = name - self.template_name = name + self.current_template = vermouth.molecule.Block() + self.current_template.name = name @SectionLineParser.section_parser('template', 'atoms') def _template_atoms(self, line, lineno=0): @@ -148,7 +151,7 @@ def _template_atoms(self, line, lineno=0): tokens = line.split() node_name = tokens[0] position = np.array(tokens[1:], dtype=float) - self.templates[self.template_name].add_node(node_name, position=position) + self.current_template.add_node(node_name, position=position) @SectionLineParser.section_parser('template', 'bonds') def _template_bonds(self, line, lineno=0): @@ -159,7 +162,7 @@ def _template_bonds(self, line, lineno=0): tokens = line.split() nodeA = tokens[0] nodeB = tokens[1] - self.templates[self.template_name].add_edge(nodeA, nodeB) + self.current_template.add_edge(nodeA, nodeB) @SectionLineParser.section_parser('volumes') def _volume(self, line, lineno=0): @@ -170,12 +173,24 @@ def _volume(self, line, lineno=0): resname, volume = line.split() self.topology.volumes[resname] = float(volume) + def finalize_section(self, previous_section, ended_section): + """ + Called once a section has finished. Here we perform all + operations that are required when a section has ended. + """ + if previous_section == "templates": + # internally a template is defined as vectors from the + # center of geometry + coords = nx.get_node_attributes(self.current_template, "position") + mapped_coords = map_from_CoG(coords) + self.template[self.current_template.name] = mapped_coords + self.current_template = None + def finalize(self, lineno=0): """ Tag each molecule node with the chirality and build options if that molecule is mentioned in the build file by name. """ - print("go here") for mol_idx, molecule in enumerate(self.molecules): if (molecule.mol_name, mol_idx) in self.build_options: From ab59baff213e5a6b7674a6d45fac2d3472de0c11 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Thu, 21 Jul 2022 16:10:55 +0200 Subject: [PATCH 089/275] address comment --- polyply/tests/test_build_file_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_build_file_parser.py b/polyply/tests/test_build_file_parser.py index 6e99239a..c5e07615 100644 --- a/polyply/tests/test_build_file_parser.py +++ b/polyply/tests/test_build_file_parser.py @@ -321,7 +321,7 @@ def test_template_parsing(test_system, line, names, edges, positions): assert edges[idx] == list(template.edges) for node_pos in positions[idx]: node = node_pos[0] - assert all(np.array(node_pos[1:], dtype=float) == template.nodes[node]["position"]) + assert np.all(np.array(node_pos[1:], dtype=float) == template.nodes[node]["position"]) @pytest.mark.parametrize('line, expected', ( ((""" From a11ebc7bf40200c15265b1feded3b0999ea3c27e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Thu, 21 Jul 2022 17:25:12 +0200 Subject: [PATCH 090/275] fix type in test --- polyply/tests/test_build_file_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_build_file_parser.py b/polyply/tests/test_build_file_parser.py index c5e07615..64c3562a 100644 --- a/polyply/tests/test_build_file_parser.py +++ b/polyply/tests/test_build_file_parser.py @@ -336,7 +336,7 @@ def test_template_parsing(test_system, line, names, edges, positions): """, {"PEO": 0.47, "P3HT": 0.61}), ))) -def test_template_parsing(test_system, line, expected): +def test_volume_parsing(test_system, line, expected): lines = textwrap.dedent(line) lines = lines.splitlines() polyply.src.build_file_parser.read_build_file(lines, From dc64a05d887d692c018003b7b53c833cbe80a6c2 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Thu, 21 Jul 2022 17:35:52 +0200 Subject: [PATCH 091/275] Fix 242 Missing comma prevented edge making for constraints and angles in blocks. --- polyply/src/meta_molecule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/meta_molecule.py b/polyply/src/meta_molecule.py index 7a8a09ad..ec12d208 100644 --- a/polyply/src/meta_molecule.py +++ b/polyply/src/meta_molecule.py @@ -26,7 +26,7 @@ def _make_edges(force_field): for block in force_field.blocks.values(): inter_types = list(block.interactions.keys()) for inter_type in inter_types: - if inter_type in ["bonds", "constraints" "angles"]: + if inter_type in ["bonds", "constraints", "angles"]: block.make_edges_from_interaction_type(type_=inter_type) for link in force_field.links: From e40e90de88754b4cadeb6f1b001d9f8caf70ba1d Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Sun, 24 Jul 2022 15:29:23 +0200 Subject: [PATCH 092/275] only have bonds and constraints make edges --- polyply/src/meta_molecule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/meta_molecule.py b/polyply/src/meta_molecule.py index ec12d208..794228d9 100644 --- a/polyply/src/meta_molecule.py +++ b/polyply/src/meta_molecule.py @@ -26,7 +26,7 @@ def _make_edges(force_field): for block in force_field.blocks.values(): inter_types = list(block.interactions.keys()) for inter_type in inter_types: - if inter_type in ["bonds", "constraints", "angles"]: + if inter_type in ["bonds", "constraints"]: block.make_edges_from_interaction_type(type_=inter_type) for link in force_field.links: From a3fda66042761e291861ba861abb42da8714cc75 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Sun, 24 Jul 2022 15:57:48 +0200 Subject: [PATCH 093/275] add more clear error message --- polyply/src/topology.py | 8 ++++- .../tests/test_data/topology_test/fail.gro | 16 ++++++++++ polyply/tests/test_topology.py | 29 +++++++++++++++++-- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 polyply/tests/test_data/topology_test/fail.gro diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 0ee765bb..69b238cf 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -414,7 +414,13 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): try: meta_mol.molecule.nodes[mol_node]["position"] = positions[total] except IndexError: - raise IOError from IndexError + resid = meta_mol.nodes[meta_node]['resid'] + mol_name = meta_mol.mol_name + msg = (f"Trying to {resname}{resid} of molecule {mol_name}, " + "but missing coordinates. Coordinates of residues " + "must be complete or build from scratch. Partial " + "reconstruction is not supported.") + raise IOError(msg) from IndexError total += 1 meta_mol.nodes[meta_node]["position"] = center_of_geometry(positions[start:total]) diff --git a/polyply/tests/test_data/topology_test/fail.gro b/polyply/tests/test_data/topology_test/fail.gro new file mode 100644 index 00000000..7ef4f5b1 --- /dev/null +++ b/polyply/tests/test_data/topology_test/fail.gro @@ -0,0 +1,16 @@ +PMMA test file + 13 + 1PMMA C1 1 -0.024 -0.125 0.104 + 1PMMA C2 2 -0.089 -0.100 -0.028 + 1PMMA C3 3 -0.040 -0.186 -0.145 + 1PMMA C4 4 -0.014 0.028 0.011 + 1PMMA O1 5 -0.027 0.072 0.125 + 1PMMA O2 6 0.070 0.100 -0.068 + 1PMMA C5 7 0.123 0.212 0.002 + 2PMMA C1 8 -1.008 2.698 9.785 + 2PMMA C2 9 -1.072 2.723 9.653 + 2PMMA C3 10 -1.024 2.637 9.536 + 2PMMA C4 11 -0.997 2.851 9.692 + 2PMMA O1 12 -1.010 2.895 9.806 + 2PMMA O2 13 -0.913 2.924 9.613 + 10.00000 10.00000 10.00000 diff --git a/polyply/tests/test_topology.py b/polyply/tests/test_topology.py index 818bc2a1..76230c89 100644 --- a/polyply/tests/test_topology.py +++ b/polyply/tests/test_topology.py @@ -35,7 +35,12 @@ def test_from_gmx_topfile(): @staticmethod def test_add_positions_from_gro(): """ - The last residue has no coordinates defined. + This test checks if coordinates are supplied at the molecule level that + coordinates are transfered to the meta_mol.molecule nodes and that the + meta_molecule nodes have the COG coordinates of the positions. Furthermore, + the last residue has no coordinates defined. In this case these nodes have + no coordinates defined and require the build and backmap attribute to be True. + In all other cases they need to be False. """ top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/system.top", "test") top.add_positions_from_file(TEST_DATA + "/topology_test/test.gro") @@ -55,7 +60,11 @@ def test_add_positions_from_gro(): @staticmethod def test_add_meta_positions_from_gro(): """ - The last residue has no coordinates defined. + This test checks if coordinates are supplied at the meta_molecule level that + coordinates are transfered to the meta_mol nodes, but not the molecule nodes. + Furthermore, the last residue has no coordinates defined. In this case these nodes + have no coordinates defined at either level and require the build and backmap attribute + to be True. In all other cases the build attribute is False and backmap is True. """ top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/system.top", "test") top.add_positions_from_file(TEST_DATA + "/topology_test/meta.gro", resolution="meta_mol") @@ -70,6 +79,12 @@ def test_add_meta_positions_from_gro(): @staticmethod def test_add_positions_from_pdb(): + """ + This test checks, if coordinates are supplied at the molecule level and no residues + are missing or skipped, that all molecule nodes have coordinates defined and that + the meta_molecule positions are defined as well. In addition all build and backmap + attributes have to be False. + """ top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/pdb.top", "test") top.add_positions_from_file(TEST_DATA + "/topology_test/test.pdb") for meta_mol in top.molecules: @@ -82,6 +97,16 @@ def test_add_positions_from_pdb(): assert meta_mol.nodes[node]["build"] == False assert meta_mol.nodes[node]["backmap"] == False + @staticmethod + def test_add_positions_from_file_fail(): + """ + This test checks if coordinates for a residue at the molecule level + are incomplete the appropiate error is raised. + """ + top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/system.top", "test") + with pytest.raises(IOError): + top.add_positions_from_file(TEST_DATA + "/topology_test/fail.gro") + @staticmethod def test_convert_to_vermouth_system(): top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/system.top", "test") From e40d735f1ccdcac4459941be14b62c2e4563da6b Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Sun, 24 Jul 2022 16:41:38 +0200 Subject: [PATCH 094/275] fix bug in gen_coords, add infrastruct for gen_coord testing --- polyply/src/gen_coords.py | 2 +- .../test_data/topology_test/complete.gro | 24 ++++++++++ .../tests/test_data/topology_test/test.gro | 30 ++++++------ polyply/tests/test_gen_coords_logic.py | 46 +++++++++++++++++++ 4 files changed, 86 insertions(+), 16 deletions(-) create mode 100644 polyply/tests/test_data/topology_test/complete.gro create mode 100644 polyply/tests/test_gen_coords_logic.py diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 14501e0f..7f18d22f 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -207,7 +207,7 @@ def gen_coords(toppath, if coordpath: LOGGER.info("loading molecule coordinates", type="step") topology.add_positions_from_file(coordpath, - skip=build_res, + skip_res=build_res, resolution='mol') # read in meta-molecule coordaintes of there are any diff --git a/polyply/tests/test_data/topology_test/complete.gro b/polyply/tests/test_data/topology_test/complete.gro new file mode 100644 index 00000000..e39f22b0 --- /dev/null +++ b/polyply/tests/test_data/topology_test/complete.gro @@ -0,0 +1,24 @@ +/coarse/fabian/current-projects/polymer_itp_builder/vermouth_dev/venv_py38/bin/polyply gen_coords -p system.top -o complete.gro -c test.gro -box 11 11 11 -name test +21 + 1PMMA C1 1 5.468 3.463 0.263 + 1PMMA C2 2 5.403 3.488 0.131 + 1PMMA C3 3 5.452 3.402 0.014 + 1PMMA C4 4 5.478 3.616 0.170 + 1PMMA O1 5 5.465 3.660 0.284 + 1PMMA O2 6 5.562 3.688 0.091 + 1PMMA C5 7 5.615 3.800 0.161 + 2PMMA C1 8 4.484 6.286 9.944 + 2PMMA C2 9 4.420 6.311 9.812 + 2PMMA C3 10 4.468 6.225 9.695 + 2PMMA C4 11 4.495 6.439 9.851 + 2PMMA O1 12 4.482 6.483 9.965 + 2PMMA O2 13 4.579 6.512 9.772 + 2PMMA C5 14 4.632 6.624 9.842 + 3PMMA C1 15 4.116 6.238 9.737 + 3PMMA C2 16 4.081 6.203 9.701 + 3PMMA C3 17 4.100 6.146 9.691 + 3PMMA C4 18 4.020 6.212 9.705 + 3PMMA O1 19 3.992 6.231 9.670 + 3PMMA O2 20 4.000 6.195 9.753 + 3PMMA C5 21 3.943 6.197 9.759 +11.0 11.0 11.0 diff --git a/polyply/tests/test_data/topology_test/test.gro b/polyply/tests/test_data/topology_test/test.gro index c9f52fec..f4458eec 100644 --- a/polyply/tests/test_data/topology_test/test.gro +++ b/polyply/tests/test_data/topology_test/test.gro @@ -1,17 +1,17 @@ PMMA test file - 14 - 1PMMA C1 1 -0.024 -0.125 0.104 - 1PMMA C2 2 -0.089 -0.100 -0.028 - 1PMMA C3 3 -0.040 -0.186 -0.145 - 1PMMA C4 4 -0.014 0.028 0.011 - 1PMMA O1 5 -0.027 0.072 0.125 - 1PMMA O2 6 0.070 0.100 -0.068 - 1PMMA C5 7 0.123 0.212 0.002 - 2PMMA C1 8 -1.008 2.698 9.785 - 2PMMA C2 9 -1.072 2.723 9.653 - 2PMMA C3 10 -1.024 2.637 9.536 - 2PMMA C4 11 -0.997 2.851 9.692 - 2PMMA O1 12 -1.010 2.895 9.806 - 2PMMA O2 13 -0.913 2.924 9.613 - 2PMMA C5 14 -0.860 3.036 9.683 + 14 + 1PMMA C1 1 5.468 3.463 0.263 + 1PMMA C2 2 5.403 3.488 0.131 + 1PMMA C3 3 5.452 3.402 0.014 + 1PMMA C4 4 5.478 3.616 0.170 + 1PMMA O1 5 5.465 3.660 0.284 + 1PMMA O2 6 5.562 3.688 0.091 + 1PMMA C5 7 5.615 3.800 0.161 + 2PMMA C1 8 4.484 6.286 9.944 + 2PMMA C2 9 4.420 6.311 9.812 + 2PMMA C3 10 4.468 6.225 9.695 + 2PMMA C4 11 4.495 6.439 9.851 + 2PMMA O1 12 4.482 6.483 9.965 + 2PMMA O2 13 4.579 6.512 9.772 + 2PMMA C5 14 4.632 6.624 9.842 10.00000 10.00000 10.00000 diff --git a/polyply/tests/test_gen_coords_logic.py b/polyply/tests/test_gen_coords_logic.py new file mode 100644 index 00000000..5970ceab --- /dev/null +++ b/polyply/tests/test_gen_coords_logic.py @@ -0,0 +1,46 @@ +# Copyright 2020 University of Groningen +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +This collection of tests check some basic I/O workflows of the gen_coords +function. For example, that it runs through when no coordinates are requested +to be generated. +""" +import pathlib +import pytest +import numpy as np +import networkx as nx +from vermouth.gmx.gro import read_gro +import polyply +from polyply import TEST_DATA, gen_coords + +def test_no_positions_generated(tmp_path, monkeypatch): + """ + All positions are defined none have to be created. Should run through without + errors and preserve all positions given in the input to rounding accuracy. + """ + monkeypatch.chdir(tmp_path) + top_file = TEST_DATA + "/topology_test/system.top" + pos_file = TEST_DATA + "/topology_test/complete.gro" + out_file = tmp_path / "out.gro" + gen_coords(toppath=top_file, + coordpath=pos_file, + outpath=out_file, + name="test", + box=np.array([10, 10, 10]) + ) + molecule_out = read_gro(out_file, exclude=()) + molecule_in = read_gro(pos_file, exclude=()) + for node in molecule_out.nodes: + assert np.all(molecule_out.nodes[node]['position'] == + molecule_in.nodes[node]['position']) From d18b7244531222a7459855388bbd50ad9298e774 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Sun, 24 Jul 2022 17:17:23 +0200 Subject: [PATCH 095/275] fix bug in gen_coords, add test for backmap only gen_coords --- polyply/src/gen_coords.py | 7 ++--- polyply/tests/test_data/topology_test/cog.gro | 6 ++++ polyply/tests/test_gen_coords_logic.py | 31 +++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 polyply/tests/test_data/topology_test/cog.gro diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 7f18d22f..028282b5 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -213,10 +213,9 @@ def gen_coords(toppath, # read in meta-molecule coordaintes of there are any if coordpath_meta: LOGGER.info("loading meta_molecule coordinates", type="step") - topology.add_meta_positions_from_file(coordpath_meta, - skip_res=build_res, - resolution='meta_mol' - ) + topology.add_positions_from_file(coordpath_meta, + skip_res=build_res, + resolution='meta_mol') # load in built file if build: diff --git a/polyply/tests/test_data/topology_test/cog.gro b/polyply/tests/test_data/topology_test/cog.gro new file mode 100644 index 00000000..3d743806 --- /dev/null +++ b/polyply/tests/test_data/topology_test/cog.gro @@ -0,0 +1,6 @@ +/coarse/fabian/current-projects/polymer_itp_builder/vermouth_dev/venv_py38/bin/polyply gen_coords -p system.top -o complete.gro -c test.gro -box 11 11 11 -name test +3 + 1PMMA C 1 0.000 0.000 0.250 + 2PMMA C 2 0.000 0.000 0.500 + 3PMMA C 3 0.000 0.000 0.750 +11.0 11.0 11.0 diff --git a/polyply/tests/test_gen_coords_logic.py b/polyply/tests/test_gen_coords_logic.py index 5970ceab..3f7be8a9 100644 --- a/polyply/tests/test_gen_coords_logic.py +++ b/polyply/tests/test_gen_coords_logic.py @@ -21,6 +21,7 @@ import numpy as np import networkx as nx from vermouth.gmx.gro import read_gro +from vermouth.graph_utils import make_residue_graph import polyply from polyply import TEST_DATA, gen_coords @@ -44,3 +45,33 @@ def test_no_positions_generated(tmp_path, monkeypatch): for node in molecule_out.nodes: assert np.all(molecule_out.nodes[node]['position'] == molecule_in.nodes[node]['position']) + +def test_backmap_only(tmp_path, monkeypatch): + """ + Only meta_mol positions are defined so others have to be backmapped. + Should run through without errors and COG of residues should be the + same as they have been put in. + """ + monkeypatch.chdir(tmp_path) + top_file = TEST_DATA + "/topology_test/system.top" + pos_file = TEST_DATA + "/topology_test/cog.gro" + out_file = tmp_path / "out.gro" + gen_coords(toppath=top_file, + coordpath_meta=pos_file, + outpath=out_file, + name="test", + box=np.array([11, 11, 11]) + ) + molecule_out = read_gro(out_file, exclude=()) + for node in molecule_out.nodes: + assert "position" in molecule_out.nodes[node] + + meta_in = read_gro(pos_file, exclude=()) + meta_out = make_residue_graph(molecule_out) + for node in meta_out.nodes: + nodes_pos = nx.get_node_attributes(meta_out.nodes[node]['graph'], 'position') + nodes_pos = np.array(list(nodes_pos.values())) + res_pos = np.average(nodes_pos, axis=0) + ref_pos = meta_in.nodes[node]['position'] + # tolerance comes from finite tolerance in gro file + assert np.allclose(res_pos, ref_pos, atol=0.0009) From bf2360f5222694863989576bf9ba0608d37cf894 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Sun, 24 Jul 2022 17:31:36 +0200 Subject: [PATCH 096/275] cosmetic change to if elif else --- polyply/src/topology.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 69b238cf..f0f65b4c 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -395,10 +395,9 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): if resname in skip_res or total >= max_coords: meta_mol.nodes[meta_node]["build"] = True meta_mol.nodes[meta_node]["backmap"] = True - continue # here we only add meta_molecule coordiantes # in that case we only want to backmap - if resolution == 'meta_mol': + elif resolution == 'meta_mol': meta_mol.nodes[meta_node]["position"] = positions[total] meta_mol.nodes[meta_node]["backmap"] = True meta_mol.nodes[meta_node]["build"] = False From bc2aefc0f4141939d1afbbb5bbb2ea2518cf428e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Sun, 24 Jul 2022 17:36:08 +0200 Subject: [PATCH 097/275] fix typo --- polyply/src/topology.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index f0f65b4c..a0efffc0 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -415,10 +415,11 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): except IndexError: resid = meta_mol.nodes[meta_node]['resid'] mol_name = meta_mol.mol_name - msg = (f"Trying to {resname}{resid} of molecule {mol_name}, " - "but missing coordinates. Coordinates of residues " - "must be complete or build from scratch. Partial " - "reconstruction is not supported.") + msg = (f"Trying to add position to {resname}{resid} of " + "molecule {mol_name}, but missing coordinates. " + "Coordinates of residues must be complete or " + "build from scratch. Partial reconstruction is " + "not supported.") raise IOError(msg) from IndexError total += 1 From 146cf19a47dc7c13de025413d31842aba948a2eb Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 11:01:19 +0200 Subject: [PATCH 098/275] update doc-string and clean compute volume function --- polyply/src/generate_templates.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/polyply/src/generate_templates.py b/polyply/src/generate_templates.py index bbf16c44..1b4e30f4 100644 --- a/polyply/src/generate_templates.py +++ b/polyply/src/generate_templates.py @@ -144,20 +144,22 @@ def _good_impropers(coords, block): return False return True -def compute_volume(molecule, block, coords, nonbond_params, treshold=1e-18): +def compute_volume(block, coords, nonbond_params, treshold=1e-18): """ - Given a `block`, which is part of `molecule` and - has the coordinates `coord` compute the radius - of gyration taking into account the volume of each - particle. The volume of a particle is considered to be - the sigma value of it's LJ self interaction parameter. + Given a `block`, which has the coordinates `coords`, + compute the radius of gyration taking into account + the volume of each particle. The volume of a particle + is considered to be the sigma value of it's LJ self- + interaction parameter. Parameters ---------- - molecule: :class:vermouth.molecule.Molecule - block: :class:vermouth.molecule.Block - coords: :class:dict + block: :class:`vermouth.molecule.Block` + coords: dict[abc.hashable] dictionary of positions in from node_idx: np.array + nonbond_params: dict[frozenset(abc.hashable, abc.hashable)] + dictionary of nonbonded parameters with atom-types as + keys and sigma, epsilon LJ parameters treshold: float distance from center of geometry at which the particle is not taken into account for the volume From c9e755cbe195396169035195135d60a372077ac8 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 11:07:50 +0200 Subject: [PATCH 099/275] compute volume upon parsing --- polyply/src/build_file_parser.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/polyply/src/build_file_parser.py b/polyply/src/build_file_parser.py index b93541f3..fb94ee4d 100644 --- a/polyply/src/build_file_parser.py +++ b/polyply/src/build_file_parser.py @@ -16,7 +16,7 @@ import vermouth from vermouth.parser_utils import SectionLineParser from vermouth.log_helpers import StyleAdapter, get_logger -from .generate_templates import map_from_CoG +from .generate_templates import map_from_CoG, compute_volume LOGGER = StyleAdapter(get_logger(__name__)) @@ -40,7 +40,6 @@ def __init__(self, molecules, topology): self.persistence_length = {} self.templates = {} self.current_template = None - self.topology.volumes = {} @SectionLineParser.section_parser('molecule') def _molecule(self, line, lineno=0): @@ -177,11 +176,23 @@ def finalize_section(self, previous_section, ended_section): """ Called once a section has finished. Here we perform all operations that are required when a section has ended. + Here comes a list of end-section wrap ups: + + Templates + --------- + - compute volume from template if it is not defined yet + - store coordinates as vectors from center of geometry """ if previous_section == "templates": + coords = nx.get_node_attributes(self.current_template, "position") + # if the volume is not defined yet compute the volume, this still + # can be overwritten by an explicit volume directive later + if resname not in self.volumes: + self.topology.volumes[resname] = compute_volume(self.current_template, + coords, + self.top.nonbond_params,) # internally a template is defined as vectors from the # center of geometry - coords = nx.get_node_attributes(self.current_template, "position") mapped_coords = map_from_CoG(coords) self.template[self.current_template.name] = mapped_coords self.current_template = None From cb3cd600aa5b49a30cfb6224cfb74719f2c12793 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 11:21:41 +0200 Subject: [PATCH 100/275] update and clean generate templates --- polyply/src/generate_templates.py | 51 +++++++++++-------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/polyply/src/generate_templates.py b/polyply/src/generate_templates.py index 1b4e30f4..a771daed 100644 --- a/polyply/src/generate_templates.py +++ b/polyply/src/generate_templates.py @@ -299,43 +299,30 @@ class GenerateTemplates(Processor): """ def __init__(self, topology, max_opt, *args, **kwargs): super().__init__(*args, **kwargs) - self.templates = {} - self.resnames = [] self.max_opt = max_opt self.topology = topology - if hasattr(self.topology, "volumes"): - self.volumes = self.topology.volumes - else: - self.volumes = {} - - def _update_templates_volumes(self, meta_molecule): - for resname, block in meta_molecule.template_blocks.items(): - coords = nx.get_node_attributes(block, "positions") - coords = map_from_CoG(coords) - self.volumes[resname] = compute_volume(meta_molecule, - block, coords, - self.topology.nonbond_params) - self.templates[resname] = coords - - def _gen_templates(self, meta_molecule): + self.volumes = self.topology.volumes + self.templates = {} + + def gen_templates(self, meta_molecule): """ Generate blocks for each unique residue by extracting the block information, placing initial coordinates, and geometry - optimizing those coordinates. Subsequently compute volume + optimizing those coordinates. Subsequently compute the volume + for each block unless they are already given in the volumes + class variable. Parameters ---------- meta_molecule: :class:`polyply.src.meta_molecule.MetaMolecule` - Returns + Updates --------- - templates: dict - dict of resname: block - volumes: dict - dict of name: volume + self.templates + self.volumes """ - resnames = set(nx.get_node_attributes(meta_molecule.molecule, - "resname").values()) + resnames = set(nx.get_node_attributes(meta_molecule, "resname").values()) + for resname in resnames: if resname not in self.templates: block = extract_block(meta_molecule.molecule, resname, @@ -363,22 +350,20 @@ def _gen_templates(self, meta_molecule): else: opt_counter += 1 - coords = map_from_CoG(coords) - self.templates[resname] = coords - if resname not in self.volumes: - self.volumes[resname] = compute_volume(meta_molecule, - block, coords, + self.volumes[resname] = compute_volume(block, + coords, self.topology.nonbond_params) + coords = map_from_CoG(coords) + self.templates[resname] = coords def run_molecule(self, meta_molecule): """ Execute the generation of templates and set the template and volume attribute. """ - if hasattr(meta_molecule, "template_blocks"): - self._update_templates_volumes(meta_molecule) + if hasattr(meta_molecule, "templates"): + self.templates.update(meta_molecule.templates) self._gen_templates(meta_molecule) meta_molecule.templates = self.templates - self.topology.volumes = self.volumes return meta_molecule From ef6b47a831934d8cc218fa55b3a89fb72c6b1dca Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 11:37:00 +0200 Subject: [PATCH 101/275] add volumes as class attribute to topology --- polyply/src/topology.py | 1 + 1 file changed, 1 insertion(+) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 68911a68..0bb26ed6 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -225,6 +225,7 @@ def __init__(self, force_field, name=None): self.mol_idx_by_name = defaultdict(list) self.persistences = [] self.distance_restraints = defaultdict(dict) + self.volumes = {} def preprocess(self): """ From cf5b759dde62ddbf1e8ee6ff1889220ba2f9b56d Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 13:02:30 +0200 Subject: [PATCH 102/275] take care to rename self._gen_temp to self.get_temp --- polyply/src/generate_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/generate_templates.py b/polyply/src/generate_templates.py index a771daed..351c633b 100644 --- a/polyply/src/generate_templates.py +++ b/polyply/src/generate_templates.py @@ -364,6 +364,6 @@ def run_molecule(self, meta_molecule): """ if hasattr(meta_molecule, "templates"): self.templates.update(meta_molecule.templates) - self._gen_templates(meta_molecule) + self.gen_templates(meta_molecule) meta_molecule.templates = self.templates return meta_molecule From 4e3c241fe2ad15d8d84e6389964772bf30c7c3af Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 13:02:44 +0200 Subject: [PATCH 103/275] fix generate templates --- polyply/tests/test_generate_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_generate_templates.py b/polyply/tests/test_generate_templates.py index 978d5924..ff4bd11f 100644 --- a/polyply/tests/test_generate_templates.py +++ b/polyply/tests/test_generate_templates.py @@ -101,7 +101,7 @@ def test_compute_volume(): polyply.src.polyply_parser.read_polyply(lines, ff) block = ff.blocks['GLY'] coords = _expand_inital_coords(block) - vol = compute_volume(meta_mol, block, coords, nonbond_params) + vol = compute_volume(block, coords, nonbond_params) assert vol > 0. @staticmethod From 2c4976c3060f81eaf81879dc76eafb728a5379f1 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 13:02:59 +0200 Subject: [PATCH 104/275] debug build file parser --- polyply/src/build_file_parser.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/polyply/src/build_file_parser.py b/polyply/src/build_file_parser.py index fb94ee4d..1e961c00 100644 --- a/polyply/src/build_file_parser.py +++ b/polyply/src/build_file_parser.py @@ -13,6 +13,7 @@ # limitations under the License. from collections import defaultdict, namedtuple import numpy as np +import networkx as nx import vermouth from vermouth.parser_utils import SectionLineParser from vermouth.log_helpers import StyleAdapter, get_logger @@ -148,9 +149,11 @@ def _template_atoms(self, line, lineno=0): directive of the '[template]' section """ tokens = line.split() - node_name = tokens[0] - position = np.array(tokens[1:], dtype=float) - self.current_template.add_node(node_name, position=position) + node_name, atype = tokens[0], tokens[1] + position = np.array(tokens[2:], dtype=float) + self.current_template.add_node(node_name, + atype=atype, + position=position) @SectionLineParser.section_parser('template', 'bonds') def _template_bonds(self, line, lineno=0): @@ -183,18 +186,19 @@ def finalize_section(self, previous_section, ended_section): - compute volume from template if it is not defined yet - store coordinates as vectors from center of geometry """ - if previous_section == "templates": + if previous_section == ["template", "bonds"]: coords = nx.get_node_attributes(self.current_template, "position") # if the volume is not defined yet compute the volume, this still # can be overwritten by an explicit volume directive later - if resname not in self.volumes: + resname = self.current_template.name + if resname not in self.topology.volumes: self.topology.volumes[resname] = compute_volume(self.current_template, coords, - self.top.nonbond_params,) + self.topology.nonbond_params,) # internally a template is defined as vectors from the # center of geometry mapped_coords = map_from_CoG(coords) - self.template[self.current_template.name] = mapped_coords + self.templates[resname] = mapped_coords self.current_template = None def finalize(self, lineno=0): @@ -214,7 +218,7 @@ def finalize(self, lineno=0): molecule.mol_name) molecule.templates = self.templates - super().finalize + super().finalize(lineno=lineno) @staticmethod def _tag_nodes(molecule, keyword, option, molname=""): From 1014e42378392261d3f8721c4a9944b84a179d45 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 25 Jul 2022 13:03:16 +0200 Subject: [PATCH 105/275] add tests for template and volume parsing --- polyply/tests/test_build_file_parser.py | 153 +++++++++++++++++------- 1 file changed, 111 insertions(+), 42 deletions(-) diff --git a/polyply/tests/test_build_file_parser.py b/polyply/tests/test_build_file_parser.py index 64c3562a..fb4447d5 100644 --- a/polyply/tests/test_build_file_parser.py +++ b/polyply/tests/test_build_file_parser.py @@ -121,6 +121,9 @@ def test_system(): top = Topology(force_field=force_field) top.molecules = molecules top.mol_idx_by_name = {"AA":[0, 1], "BB": [2], "NA":[3, 4, 5, 6]} + top.nonbond_params = {frozenset(["O"]): {"nb1": 0.30}, + frozenset(["C"]): {"nb1": 0.36}, + frozenset(["H"]): {"nb1": 0.04}} return top @pytest.mark.parametrize('line, expected', ( @@ -266,49 +269,135 @@ def test_persistence_parsers(test_system, lines, expected): assert info_ref == info_new assert all(ref[-1] == new[-1]) -@pytest.mark.parametrize('line, names, edges, positions', ( - (("""[ template ] +@pytest.mark.parametrize('line, expected', ( + ((""" + [ volumes ] + PEO 0.47 + """, + {"PEO": 0.47}), + (""" + [ volumes ] + PEO 0.47 + P3HT 0.61 + """, + {"PEO": 0.47, "P3HT": 0.61}), +))) +def test_volume_parsing(test_system, line, expected): + lines = textwrap.dedent(line) + lines = lines.splitlines() + polyply.src.build_file_parser.read_build_file(lines, + test_system.molecules, + test_system) + assert test_system.volumes == expected + +@pytest.mark.parametrize('line, names, edges, positions, out_vol', ( + ( + # 1 - template but volume are provided before + ("""[ volumes ] + PEO 0.43 + [ template ] + resname PEO + [ atoms ] + EC1 C 0.000 0.000 0.000 + O1 O 0.000 0.000 0.150 + EC2 C 0.000 0.000 0.300 + [ bonds ] + EC1 O1 + O1 EC2 + """, + ["PEO"], + [[("EC1", "O1"), ("O1", "EC2")]], + # template positions are defined as vectors + # from the center of geometry internally + [[("EC1", 0.0, 0.0, -0.150), + ("O1", 0.000, 0.000, 0.000), + ("EC2", 0.000, 0.000, 0.150)]], + {"PEO": 0.43}), + # 2 - template but volume are provided after + ("""[ template ] resname PEO [ atoms ] - EC1 0.000 0.000 0.000 - O1 0.000 0.000 0.150 - EC2 0.000 0.000 0.300 + EC1 C 0.000 0.000 0.000 + O1 O 0.000 0.000 0.150 + EC2 C 0.000 0.000 0.300 [ bonds ] EC1 O1 O1 EC2 + [ volumes ] + PEO 0.43 """, ["PEO"], [[("EC1", "O1"), ("O1", "EC2")]], - [[("EC1", 0.0, 0.0, 0.0), - ("O1", 0.000, 0.000, 0.150), - ("EC2", 0.000, 0.000, 0.300)]]), + # template positions are defined as vectors + # from the center of geometry internally + [[("EC1", 0.0, 0.0, -0.150), + ("O1", 0.000, 0.000, 0.000), + ("EC2", 0.000, 0.000, 0.150)]], + {"PEO": 0.43}), + + # 3 - two templates and volumes are provided before + ("""[ volumes ] + PEO 0.43 + OH 0.22 + [ template ] + resname PEO + [ atoms ] + EC1 C 0.000 0.000 0.000 + O1 O 0.000 0.000 0.150 + EC2 C 0.000 0.000 0.300 + [ bonds ] + EC1 O1 + O1 EC2 + [ template ] + resname OH + [ atoms ] + O1 O 0.0000 0.000 0.000 + H1 H 0.0000 0.000 0.100 + [ bonds ] + O1 H1 + """, + ["PEO", "OH"], + [[("EC1", "O1"), ("O1", "EC2")], [("O1", "H1")]], + # template positions are defined as vectors + # from the center of geometry internally + [[("EC1", 0.0, 0.0, -0.150), + ("O1", 0.000, 0.000, 0.000), + ("EC2", 0.000, 0.000, 0.150)], + [("O1", 0.0000, 0.000, -0.050), + ("H1", 0.0000, 0.000, 0.050)]], + {"PEO": 0.43, "OH": 0.22}), + # 4 - two templates but only 1 volume are provided ("""[ template ] resname PEO [ atoms ] - EC1 0.000 0.000 0.000 - O1 0.000 0.000 0.150 - EC2 0.000 0.000 0.300 + EC1 C 0.000 0.000 0.000 + O1 O 0.000 0.000 0.150 + EC2 C 0.000 0.000 0.300 [ bonds ] EC1 O1 O1 EC2 [ template ] resname OH [ atoms ] - O1 0.0000 0.000 0.000 - H1 0.0000 0.000 0.100 + O1 O 0.0000 0.000 0.000 + H1 H 0.0000 0.000 0.100 [ bonds ] O1 H1 + [ volumes ] + OH 0.22 """, ["PEO", "OH"], [[("EC1", "O1"), ("O1", "EC2")], [("O1", "H1")]], - [[("EC1", 0.0, 0.0, 0.0), - ("O1", 0.000, 0.000, 0.150), - ("EC2", 0.000, 0.000, 0.300)], - [("O1", 0.0000, 0.000, 0.000), - ("H1", 0.0000, 0.000, 0.100)] - ]), + # template positions are defined as vectors + # from the center of geometry internally + [[("EC1", 0.0, 0.0, -0.150), + ("O1", 0.000, 0.000, 0.000), + ("EC2", 0.000, 0.000, 0.150)], + [("O1", 0.0000, 0.000, -0.050), + ("H1", 0.0000, 0.000, 0.050)]], + {"PEO": 0.4164132562731403, "OH": 0.22}), ))) -def test_template_parsing(test_system, line, names, edges, positions): +def test_template_volume_parsing(test_system, line, names, edges, positions, out_vol): lines = textwrap.dedent(line) lines = lines.splitlines() polyply.src.build_file_parser.read_build_file(lines, @@ -318,28 +407,8 @@ def test_template_parsing(test_system, line, names, edges, positions): assert len(mol.templates) == len(names) for idx, name in enumerate(names): template = mol.templates[name] - assert edges[idx] == list(template.edges) for node_pos in positions[idx]: node = node_pos[0] - assert np.all(np.array(node_pos[1:], dtype=float) == template.nodes[node]["position"]) + assert np.all(np.array(node_pos[1:], dtype=float) == template[node]) -@pytest.mark.parametrize('line, expected', ( - ((""" - [ volumes ] - PEO 0.47 - """, - {"PEO": 0.47}), - (""" - [ volumes ] - PEO 0.47 - P3HT 0.61 - """, - {"PEO": 0.47, "P3HT": 0.61}), -))) -def test_volume_parsing(test_system, line, expected): - lines = textwrap.dedent(line) - lines = lines.splitlines() - polyply.src.build_file_parser.read_build_file(lines, - test_system.molecules, - test_system) - assert test_system.volumes == expected + assert test_system.volumes == out_vol From bb94017cdc64cbccfe5e423d5de337def671f298 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 29 Jul 2022 12:05:15 +0200 Subject: [PATCH 106/275] fix multiblock input --- polyply/src/map_to_molecule.py | 39 ++++++++++++++++++--------- polyply/tests/test_map_to_molecule.py | 30 +++++++++++++++++++-- 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index eee77466..608202f1 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -13,6 +13,7 @@ # limitations under the License. import networkx as nx +from vermouth.graph_utils import make_residue_graph from polyply.src.processor import Processor def tag_exclusions(node_to_block, force_field): @@ -135,14 +136,13 @@ def match_nodes_to_blocks(self, meta_molecule): if len(meta_molecule.nodes) == 1: regular_graph.add_nodes_from(meta_molecule.nodes) - # this breaks down when to proteins are directly linked - # because they would appear as one connected component - # and not two seperate components referring to two molecules - # but that is an edge-case we can worry about later + # this will falesly also connect two molecules with the + # same molecule name, if they are from_itp and consecutively + # we deal with that below for idx, jdx in nx.dfs_edges(meta_molecule): - # the two nodes are restart nodes if idx in restart_attr and jdx in restart_attr: - restart_graph.add_edge(idx, jdx) + if restart_attr[idx] == restart_attr[jdx]: + restart_graph.add_edge(idx, jdx) else: regular_graph.add_edge(idx, jdx) @@ -151,17 +151,30 @@ def match_nodes_to_blocks(self, meta_molecule): self.node_to_block[node] = meta_molecule.nodes[node]["resname"] # fragment nodes match parts of blocks, which describe molecules - # with more than one residue + # with more than one residue. Sometimes multiple molecules come + # after each other in that case the connected component needs to + # be an integer multiple of the block for fragment in nx.connected_components(restart_graph): - block_name = restart_attr[list(fragment)[0]] - if all([restart_attr[node] == block_name for node in fragment]): - self.fragments.append(fragment) - for node in fragment: - self.node_to_block[node] = block_name - self.node_to_fragment[node] = len(self.fragments) - 1 + frag_nodes = list(fragment) + block = self.force_field.blocks[restart_attr[frag_nodes[0]]] + block_res = make_residue_graph(block, attrs=('resid', 'resname')) + len_block = len(block_res) + len_frag = len(fragment) + # here we check if the fragment is an integer multiple + # of the multiresidue block + if len_frag%len_block == 0: + n_blocks = len_frag//len_block else: + # if it is not raise an error raise IOError + for fdx in range(0, n_blocks): + current_frag_nodes = frag_nodes[fdx*len_block: (fdx+1)*len_block] + self.fragments.append(current_frag_nodes) + for node in current_frag_nodes: + self.node_to_block[node] = restart_attr[frag_nodes[0]] + self.node_to_fragment[node] = len(self.fragments) - 1 + def add_blocks(self, meta_molecule): """ Add disconnected blocks to :class:`vermouth.molecule.Moleclue` diff --git a/polyply/tests/test_map_to_molecule.py b/polyply/tests/test_map_to_molecule.py index a827f264..a9c52d85 100644 --- a/polyply/tests/test_map_to_molecule.py +++ b/polyply/tests/test_map_to_molecule.py @@ -147,7 +147,34 @@ Interaction(atoms=(7, 8), parameters=['1', '0.37', '8000'], meta={})], [(0, 1), (1, 2), (2, 3), (5, 6), (6, 7), (7, 8)], 9, - {0: "MIX", 1: "MIX", 3: "MIX", 4:"MIX"}) + {0: "MIX", 1: "MIX", 3: "MIX", 4:"MIX"}), + # test two consecutive multiblock fragments + (""" + [ moleculetype ] + ; name nexcl. + MIX 1 + ; + [ atoms ] + 1 SN1a 1 R1 C1 1 0.000 45 + 2 SN1a 1 R1 C2 1 0.000 45 + 3 SC1 2 R2 C1 2 0.000 45 + 4 SC1 2 R2 C2 2 0.000 45 + [ bonds ] + ; back bone bonds + 1 2 1 0.37 7000 + 2 3 1 0.37 7000 + 3 4 1 0.37 8000 + """, + ["R1", "R2", "R1", "R2"], + [Interaction(atoms=(0, 1), parameters=['1', '0.37', '7000'], meta={}), + Interaction(atoms=(1, 2), parameters=['1', '0.37', '7000'], meta={}), + Interaction(atoms=(2, 3), parameters=['1', '0.37', '8000'], meta={}), + Interaction(atoms=(4, 5), parameters=['1', '0.37', '7000'], meta={}), + Interaction(atoms=(5, 6), parameters=['1', '0.37', '7000'], meta={}), + Interaction(atoms=(6, 7), parameters=['1', '0.37', '8000'], meta={})], + [(0, 1), (1, 2), (2, 3), (4, 5), (5, 6), (6, 7)], + 8, + {0: "MIX", 1: "MIX", 2: "MIX", 3:"MIX"}) )) def test_multiresidue_block(lines, monomers, bonds, edges, nnodes, from_itp): """ @@ -166,7 +193,6 @@ def test_multiresidue_block(lines, monomers, bonds, edges, nnodes, from_itp): # map to molecule new_meta_mol = polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) # check that the disconnected molecule is properly done - #print(new_meta_mol.nodes) for node in new_meta_mol.nodes: assert len(new_meta_mol.nodes[node]['graph'].nodes) != 0 From 67e967ceea808399082f8ccd0636f4bb1267fe61 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 29 Jul 2022 13:13:56 +0200 Subject: [PATCH 107/275] add error message details and test for when multiblock doesn't match resgraph sequence --- polyply/src/map_to_molecule.py | 7 +++- polyply/tests/test_map_to_molecule.py | 59 +++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 608202f1..74bd467c 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -166,7 +166,12 @@ def match_nodes_to_blocks(self, meta_molecule): n_blocks = len_frag//len_block else: # if it is not raise an error - raise IOError + molname = restart_attr[frag_nodes[0]] + msg = (f"When mapping the molecule {molname} onto the residue graph " + "nodes labeled with from_itp, a mismatch in the length between " + "the provided molecule and the residue graph is found. Make " + "sure that all residues are in the residue graph and input itp-file.") + raise IOError(msg) for fdx in range(0, n_blocks): current_frag_nodes = frag_nodes[fdx*len_block: (fdx+1)*len_block] diff --git a/polyply/tests/test_map_to_molecule.py b/polyply/tests/test_map_to_molecule.py index a9c52d85..0a3967d7 100644 --- a/polyply/tests/test_map_to_molecule.py +++ b/polyply/tests/test_map_to_molecule.py @@ -353,3 +353,62 @@ def test_riase_multiresidue_error(lines, monomers, bonds, edges, nnodes, from_it nx.set_node_attributes(meta_mol, from_itp, "from_itp") with pytest.raises(IOError): new_meta_mol = polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) + +@pytest.mark.parametrize('lines, monomers, from_itp', ( + # we are missing one residue in the multiblock graph + (""" + [ moleculetype ] + ; name nexcl. + MIX 1 + ; + [ atoms ] + 1 SN1a 1 R1 C1 1 0.000 45 + 2 SN1a 1 R1 C2 1 0.000 45 + 3 SC1 2 R2 C1 2 0.000 45 + 4 SC1 2 R2 C2 2 0.000 45 + [ bonds ] + ; back bone bonds + 1 2 1 0.37 7000 + 2 3 1 0.37 7000 + 3 4 1 0.37 8000 + """, + ["R1", "R2", "R1"], + {0: "MIX", 1: "MIX", 2: "MIX"}), + # we have a residue too many in the residue graph provided + (""" + [ moleculetype ] + ; name nexcl. + MIX 1 + ; + [ atoms ] + 1 SN1a 1 R1 C1 1 0.000 45 + 2 SN1a 1 R1 C2 1 0.000 45 + 3 SC1 2 R2 C1 2 0.000 45 + 4 SC1 2 R2 C2 2 0.000 45 + [ bonds ] + ; back bone bonds + 1 2 1 0.37 7000 + 2 3 1 0.37 7000 + 3 4 1 0.37 8000 + """, + ["R1", "R2", "R3", "R1", "R2"], + {0: "MIX", 1: "MIX", 2: "MIX", 3:"MIX"}) + )) +def test_error_missing_residues_multi(lines, monomers, from_itp): + """ + It can happen that there is a length mismatch between a multiblock as identified + from the residue graph sequence and provided in the blocks file. We check that + an error is raised. + """ + lines = textwrap.dedent(lines).splitlines() + ff = vermouth.forcefield.ForceField(name='test_ff') + polyply.src.polyply_parser.read_polyply(lines, ff) + # build the meta-molecule + meta_mol = MetaMolecule(name="test", force_field=ff) + meta_mol.add_monomer(0, monomers[0], []) + for node, monomer in enumerate(monomers[1:]): + meta_mol.add_monomer(node+1, monomer, [(node, node+1)]) + nx.set_node_attributes(meta_mol, from_itp, "from_itp") + # map to molecule + with pytest.raises(IOError): + polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) From 09df05a1d513e8ed378a251c943e9c9a8f4dc739 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 1 Aug 2022 14:41:21 +0200 Subject: [PATCH 108/275] fix multi-block for single residue --- polyply/src/map_to_molecule.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 74bd467c..878a5e45 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -129,6 +129,7 @@ def match_nodes_to_blocks(self, meta_molecule): regular_graph = nx.Graph() restart_graph = nx.Graph() restart_attr = nx.get_node_attributes(meta_molecule, "from_itp") + restart_graph.add_nodes_from(restart_attr.keys()) # in case we only have a single residue # we assume the user is sane and that residue is not from @@ -146,6 +147,7 @@ def match_nodes_to_blocks(self, meta_molecule): else: regular_graph.add_edge(idx, jdx) + print(restart_graph.nodes) # regular nodes have to match a block in the force-field by resname for node in regular_graph.nodes: self.node_to_block[node] = meta_molecule.nodes[node]["resname"] @@ -299,6 +301,7 @@ def run_molecule(self, meta_molecule): # a block which consists of multiple residues. This # gets entangled here self.match_nodes_to_blocks(meta_molecule) + print(self.node_to_block) # raise an error if a block is not known to the library _assert_blocks_in_FF(self.node_to_block.values(), self.force_field) From 49515e3025d0ddeb0848f81aab841f7bc7e07c30 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 1 Aug 2022 14:48:57 +0200 Subject: [PATCH 109/275] remove prints --- polyply/src/map_to_molecule.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 878a5e45..8972a43d 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -147,7 +147,6 @@ def match_nodes_to_blocks(self, meta_molecule): else: regular_graph.add_edge(idx, jdx) - print(restart_graph.nodes) # regular nodes have to match a block in the force-field by resname for node in regular_graph.nodes: self.node_to_block[node] = meta_molecule.nodes[node]["resname"] @@ -301,7 +300,6 @@ def run_molecule(self, meta_molecule): # a block which consists of multiple residues. This # gets entangled here self.match_nodes_to_blocks(meta_molecule) - print(self.node_to_block) # raise an error if a block is not known to the library _assert_blocks_in_FF(self.node_to_block.values(), self.force_field) From 8a253e88b379a17aa2fd3ff07147cb6cd4b7203e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Mon, 1 Aug 2022 14:49:16 +0200 Subject: [PATCH 110/275] add test for two single residue mol multiblocks --- polyply/tests/test_map_to_molecule.py | 32 ++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/polyply/tests/test_map_to_molecule.py b/polyply/tests/test_map_to_molecule.py index 0a3967d7..aa62a500 100644 --- a/polyply/tests/test_map_to_molecule.py +++ b/polyply/tests/test_map_to_molecule.py @@ -174,7 +174,37 @@ Interaction(atoms=(6, 7), parameters=['1', '0.37', '8000'], meta={})], [(0, 1), (1, 2), (2, 3), (4, 5), (5, 6), (6, 7)], 8, - {0: "MIX", 1: "MIX", 2: "MIX", 3:"MIX"}) + {0: "MIX", 1: "MIX", 2: "MIX", 3:"MIX"}), + # test two consecutive multiblock fragments with single residues + # and different mol-name + (""" + [ moleculetype ] + ; name nexcl. + OTR 1 + ; + [ atoms ] + 1 SN1a 1 R2 C1 1 0.000 45 + 2 SN1a 1 R2 C2 1 0.000 45 + [ bonds ] + ; back bone bonds + 1 2 1 0.4 7000 + [ moleculetype ] + ; name nexcl. + MIX 1 + ; + [ atoms ] + 1 SN1a 1 R1 C1 1 0.000 45 + 2 SN1a 1 R1 C2 1 0.000 45 + [ bonds ] + ; back bone bonds + 1 2 1 0.37 7000 + """, + ["R1", "R2"], + [Interaction(atoms=(0, 1), parameters=['1', '0.37', '7000'], meta={}), + Interaction(atoms=(2, 3), parameters=['1', '0.4', '7000'], meta={}),], + [(0, 1), (2, 3),], + 4, + {0: "MIX", 1: "OTR"}) )) def test_multiresidue_block(lines, monomers, bonds, edges, nnodes, from_itp): """ From aa4f155949ac516e5c7c8500cb55ae0f4c704995 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Tue, 2 Aug 2022 16:05:39 +0200 Subject: [PATCH 111/275] fix typos --- polyply/src/gen_coords.py | 2 +- polyply/src/topology.py | 2 +- polyply/tests/test_gen_coords_logic.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 028282b5..b41a1bd1 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -210,7 +210,7 @@ def gen_coords(toppath, skip_res=build_res, resolution='mol') - # read in meta-molecule coordaintes of there are any + # read in meta-molecule coordinates of there are any if coordpath_meta: LOGGER.info("loading meta_molecule coordinates", type="step") topology.add_positions_from_file(coordpath_meta, diff --git a/polyply/src/topology.py b/polyply/src/topology.py index a0efffc0..101a239a 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -367,7 +367,7 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): Note that molecule coordinates will also set the meta_molecule coordinates. Coordinates for a single residue must be complete. - Currently .gro and .pdb file parsers are supoprted for the + Currently .gro and .pdb file parsers are supported for the coordinate reading. See `_coord_parsers` for more information. Parameters diff --git a/polyply/tests/test_gen_coords_logic.py b/polyply/tests/test_gen_coords_logic.py index 3f7be8a9..8c9c51cd 100644 --- a/polyply/tests/test_gen_coords_logic.py +++ b/polyply/tests/test_gen_coords_logic.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. """ -This collection of tests check some basic I/O workflows of the gen_coords +This collection of tests checks some basic I/O workflows of the gen_coords function. For example, that it runs through when no coordinates are requested to be generated. """ From ab824872bbbdc962b7b48bb2306ec2ddba61b713 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Tue, 2 Aug 2022 17:34:06 +0200 Subject: [PATCH 112/275] raise warning if meta-mol coordinates are incomplete --- polyply/src/gen_coords.py | 6 ++++++ polyply/tests/test_gen_coords_logic.py | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index b41a1bd1..a18bc271 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -216,6 +216,12 @@ def gen_coords(toppath, topology.add_positions_from_file(coordpath_meta, skip_res=build_res, resolution='meta_mol') + last_node = len(topology.molecules[-1].nodes) - 1 + if topology.molecules[-1].nodes[last_node]["build"]: + msg = ("You provided metamolecule coordiantes. However, " + "there were not enough coordinates for all metamolecule " + "residues. Polyply will built the missing residues.") + LOGGER.warning(msg) # load in built file if build: diff --git a/polyply/tests/test_gen_coords_logic.py b/polyply/tests/test_gen_coords_logic.py index 8c9c51cd..9f544c85 100644 --- a/polyply/tests/test_gen_coords_logic.py +++ b/polyply/tests/test_gen_coords_logic.py @@ -16,6 +16,7 @@ function. For example, that it runs through when no coordinates are requested to be generated. """ +import logging import pathlib import pytest import numpy as np @@ -75,3 +76,23 @@ def test_backmap_only(tmp_path, monkeypatch): ref_pos = meta_in.nodes[node]['position'] # tolerance comes from finite tolerance in gro file assert np.allclose(res_pos, ref_pos, atol=0.0009) + +def test_warning_partial_metamol_coords(tmp_path, monkeypatch, caplog): + caplog.set_level(logging.WARNING) + top_file = TEST_DATA + "/topology_test/system.top" + pos_file = TEST_DATA + "/topology_test/cog_missing.gro" + out_file = tmp_path / "out.gro" + + with caplog.at_level(logging.WARNING): + gen_coords(toppath=top_file, + coordpath_meta=pos_file, + outpath=out_file, + name="test", + box=np.array([11, 11, 11]) + ) + print(caplog.records) + for record in caplog.records: + assert record.levelname == "WARNING" + break + else: + assert False From b1dc6e2cb35c173254a578ff6535749b41f42576 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Tue, 2 Aug 2022 17:36:23 +0200 Subject: [PATCH 113/275] add test file with missing cog coords --- polyply/tests/test_data/topology_test/cog_missing.gro | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 polyply/tests/test_data/topology_test/cog_missing.gro diff --git a/polyply/tests/test_data/topology_test/cog_missing.gro b/polyply/tests/test_data/topology_test/cog_missing.gro new file mode 100644 index 00000000..7b2e5aad --- /dev/null +++ b/polyply/tests/test_data/topology_test/cog_missing.gro @@ -0,0 +1,5 @@ +/coarse/fabian/current-projects/polymer_itp_builder/vermouth_dev/venv_py38/bin/polyply gen_coords -p system.top -o complete.gro -c test.gro -box 11 11 11 -name test +2 + 1PMMA C 1 0.000 0.000 0.250 + 2PMMA C 2 0.000 0.000 0.500 +11.0 11.0 11.0 From 58371f8f385edc4567439787c5e09cff889cb762 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Wed, 3 Aug 2022 10:36:06 +0200 Subject: [PATCH 114/275] make volume code cleaner to read by removing continue statement --- polyply/src/generate_templates.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/polyply/src/generate_templates.py b/polyply/src/generate_templates.py index 351c633b..4939353c 100644 --- a/polyply/src/generate_templates.py +++ b/polyply/src/generate_templates.py @@ -179,10 +179,9 @@ def compute_volume(block, coords, nonbond_params, treshold=1e-18): atom_key = block.nodes[node]["atype"] rad = float(nonbond_params[frozenset([atom_key, atom_key])]["nb1"]) diff = coord - res_center_of_geometry - if np.linalg.norm(diff) < treshold: - continue - geom_vects[idx, :] = diff + u_vect(diff) * rad - idx += 1 + if np.linalg.norm(diff) > treshold: + geom_vects[idx, :] = diff + u_vect(diff) * rad + idx += 1 if geom_vects.shape[0] > 1: radgyr = radius_of_gyration(geom_vects) From b05c0977f48dabac4390028a25a492ecf1da1f05 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 3 Aug 2022 21:25:32 +0200 Subject: [PATCH 115/275] make sure self-links are applied --- polyply/src/apply_links.py | 40 ++++++++++++++++++++++++------- polyply/tests/test_apply_links.py | 14 +++++++++++ 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index 94affdca..a5ee81cc 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -341,6 +341,29 @@ def __init__(self, *args, debug=False, **kwargs): super().__init__(*args, **kwargs) self.applied_links = defaultdict(dict) + def _update_applied_links(self, interactions_dict, molecule, citations, mapping=None): + """ + Helper function for adding links to the applied links dictionary. + If mapping is given the interaction atoms are mapped to the molecule + atoms using mapping. Otherwise interactions are assumed to be written + in terms of molecule nodes. + """ + for inter_type, interactions in interactions_dict.items(): + for interaction in interactions: + # it is not guaranteed that interaction.atoms is a tuple + # the key is the atoms involved in the interaction and the version type so + # that multiple versions are kept and not overwritten + if mapping: + new_interaction = _build_link_interaction_from(molecule, + interaction, + mapping) + else: + new_interaction = interaction + + interaction_key = tuple(new_interaction.atoms) +\ + tuple([new_interaction.meta.get("version", 1)]) + self.applied_links[inter_type][interaction_key] = (new_interaction, citations) + def apply_link_between_residues(self, meta_molecule, link, link_to_resid): """ Applies a link between specific residues, if and only if @@ -387,15 +410,11 @@ def apply_link_between_residues(self, meta_molecule, link, link_to_resid): molecule.nodes[link_to_mol[node]].update(link.nodes[node].get('replace', {})) # based on the match we build the link interaction - for inter_type in link.interactions: - for interaction in link.interactions[inter_type]: - new_interaction = _build_link_interaction_from(molecule, interaction, link_to_mol) - # it is not guaranteed that interaction.atoms is a tuple - # the key is the atoms involved in the interaction and the version type so - # that multiple versions are kept and not overwritten - interaction_key = tuple(new_interaction.atoms) +\ - tuple([new_interaction.meta.get("version",1)]) - self.applied_links[inter_type][interaction_key] = (new_interaction, link.citations) + self._update_applied_links(link.interactions, + molecule, + link.citations, + mapping=link_to_mol) + # now we already add the edges of this link # links can overwrite each other but the edges must be the same # this is safer than using the make_edge method because it accounts @@ -423,6 +442,9 @@ def run_molecule(self, meta_molecule): """ molecule = meta_molecule.molecule force_field = meta_molecule.force_field + # we need to update the temporary interactions dict + self._update_applied_links(molecule.interactions, molecule, molecule.citations, mapping=None) + resnames = set(nx.get_node_attributes(molecule, "resname").values()) for link in tqdm(force_field.links): link_resnames = _get_link_resnames(link) diff --git a/polyply/tests/test_apply_links.py b/polyply/tests/test_apply_links.py index 5b94007e..22ba21d3 100644 --- a/polyply/tests/test_apply_links.py +++ b/polyply/tests/test_apply_links.py @@ -327,6 +327,20 @@ def test_match_link_and_residue_atoms_fail(example_meta_molecule, [[(1, 4, 1)], [(6, 9, 1)], [(1, 4, 5, 6, 1)]], [[(0, 0)], [(1, 0)], [(2, 0)]] ), + # 8 - simple check single residue but both nodes are the same + ([[(0, {'name': 'BB'}), + (1, {'name': 'BB1'}), + (2, {'name': 'SC1'})]], + [{0: 0, 1: 0, 2:0}], + ['angles'], + [[vermouth.molecule.Interaction(atoms=(0, 1, 2), + parameters=['1', '124', '500'], + meta={})]], + [[]], + [[]], + [[(0, 1, 2, 1)]], + [[(0, 0)]] + ), )) def test_apply_link_to_residue(example_meta_molecule, link_defs, From bdb7618d8decb24afe67c8394a3c4e07ff363734 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 3 Aug 2022 21:35:30 +0200 Subject: [PATCH 116/275] fix bug and implement option for removing nodes --- polyply/src/apply_links.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index a5ee81cc..b090f74c 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -340,6 +340,7 @@ def __init__(self, *args, debug=False, **kwargs): self.debug = debug super().__init__(*args, **kwargs) self.applied_links = defaultdict(dict) + self.nodes_to_remove = [] def _update_applied_links(self, interactions_dict, molecule, citations, mapping=None): """ @@ -407,7 +408,11 @@ def apply_link_between_residues(self, meta_molecule, link, link_to_resid): # if all atoms have a match the link applies and we first # replace any attributes from the link node section for node in link.nodes: - molecule.nodes[link_to_mol[node]].update(link.nodes[node].get('replace', {})) + # if the atomname is set to null we schedule the node to be removed + if "null" in link.nodes[node].get('replace', {}).get('atomname', {}): + self.nodes_to_remove.append(link_to_mol[node]) + else: + molecule.nodes[link_to_mol[node]].update(link.nodes[node].get('replace', {})) # based on the match we build the link interaction self._update_applied_links(link.interactions, @@ -444,6 +449,8 @@ def run_molecule(self, meta_molecule): force_field = meta_molecule.force_field # we need to update the temporary interactions dict self._update_applied_links(molecule.interactions, molecule, molecule.citations, mapping=None) + # now we can clear the molecule dict + molecule.interactions = defaultdict(list) resnames = set(nx.get_node_attributes(molecule, "resname").values()) for link in tqdm(force_field.links): @@ -485,5 +492,9 @@ def run_molecule(self, meta_molecule): if link.molecule_meta.get('by_atom_id'): apply_explicit_link(molecule, link) + # take care to remove nodes if there are any scheduled for removal + for node in self.nodes_to_remove: + molecule.remove_nodes(node) + expand_excl(molecule) return meta_molecule From d9ae4c1d397bfc115695223aeac79dc024e28bae Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 3 Aug 2022 22:03:21 +0200 Subject: [PATCH 117/275] add test that nodes can be scheduled for removal --- polyply/tests/test_apply_links.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/polyply/tests/test_apply_links.py b/polyply/tests/test_apply_links.py index 22ba21d3..2b605ae3 100644 --- a/polyply/tests/test_apply_links.py +++ b/polyply/tests/test_apply_links.py @@ -341,6 +341,21 @@ def test_match_link_and_residue_atoms_fail(example_meta_molecule, [[(0, 1, 2, 1)]], [[(0, 0)]] ), + # 9 - test node get scheduled for removal + ([[(0, {'name': 'BB'}), + (1, {'name': 'BB1'}), + (2, {'name': 'SC1'}), + (3, {'name': 'SC2', 'replace': {'atomname': None}})]], + [{0: 0, 1: 0, 2:0, 3:0}], + ['angles'], + [[vermouth.molecule.Interaction(atoms=(0, 1, 2), + parameters=['1', '124', '500'], + meta={})]], + [[]], + [[]], + [[(0, 1, 2, 1)]], + [[(0, 0)]] + ), )) def test_apply_link_to_residue(example_meta_molecule, link_defs, @@ -366,8 +381,14 @@ def test_apply_link_to_residue(example_meta_molecule, link.patterns = patterns link.make_edges_from_interaction_type(inter_type) processor.apply_link_between_residues(example_meta_molecule, - link, - link_to_resid) + link, + link_to_resid) + + for node in processor.nodes_to_remove: + node_name = example_meta_molecule.molecule.nodes[node]['name'] + for node in link.nodes: + if link.nodes[node]['name'] == node_name: + assert link.nodes[node]['replace']['atomname'] is None for nodes, inter_idxs, inter_type in zip(expected_nodes, expected_inters, inter_types): for inter_nodes, inter_idx in zip(nodes, inter_idxs): From dfd510d4ef1f5a7c8fc08d257e3121d0f212bf9e Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 3 Aug 2022 22:23:40 +0200 Subject: [PATCH 118/275] add integral test that nodes can be scheduled for removal --- polyply/src/apply_links.py | 6 ++-- .../test_data/gen_params/input/removal.ff | 36 +++++++++++++++++++ .../test_data/gen_params/output/removal.itp | 20 +++++++++++ .../test_data/gen_params/ref/removal.itp | 20 +++++++++++ polyply/tests/test_gen_params.py | 8 ++++- 5 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 polyply/tests/test_data/gen_params/input/removal.ff create mode 100644 polyply/tests/test_data/gen_params/output/removal.itp create mode 100644 polyply/tests/test_data/gen_params/ref/removal.itp diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index b090f74c..42331300 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -409,7 +409,7 @@ def apply_link_between_residues(self, meta_molecule, link, link_to_resid): # replace any attributes from the link node section for node in link.nodes: # if the atomname is set to null we schedule the node to be removed - if "null" in link.nodes[node].get('replace', {}).get('atomname', {}): + if link.nodes[node].get('replace', {}).get('atomname', False) is None: self.nodes_to_remove.append(link_to_mol[node]) else: molecule.nodes[link_to_mol[node]].update(link.nodes[node].get('replace', {})) @@ -492,9 +492,9 @@ def run_molecule(self, meta_molecule): if link.molecule_meta.get('by_atom_id'): apply_explicit_link(molecule, link) + print(molecule.interactions) # take care to remove nodes if there are any scheduled for removal - for node in self.nodes_to_remove: - molecule.remove_nodes(node) + molecule.remove_nodes_from(self.nodes_to_remove) expand_excl(molecule) return meta_molecule diff --git a/polyply/tests/test_data/gen_params/input/removal.ff b/polyply/tests/test_data/gen_params/input/removal.ff new file mode 100644 index 00000000..4f972b8d --- /dev/null +++ b/polyply/tests/test_data/gen_params/input/removal.ff @@ -0,0 +1,36 @@ +; Copyright 2020 University of Groningen +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +[ moleculetype ] +; name nexcl. +PEO 1 +; +[ atoms ] +1 SN1a 1 PEO EO 1 0.000 45 +2 SN2a 1 PEO EP 1 0.000 45 +[ bonds ] +1 2 1 0.44 7000 + +[ link ] +resname "PEO" +[ bonds ] +; back bone bonds +EP +EO 1 0.37 7000 + +[ link ] +resname "PEO" +[ atoms ] +EP {"replace": {"atomname": null}} +[ non-edges] +EP +EO diff --git a/polyply/tests/test_data/gen_params/output/removal.itp b/polyply/tests/test_data/gen_params/output/removal.itp new file mode 100644 index 00000000..69c2c5fd --- /dev/null +++ b/polyply/tests/test_data/gen_params/output/removal.itp @@ -0,0 +1,20 @@ +; /Users/fabian/ProgramDev/dev_env/bin/pytest test_gen_params.py + +; Please cite the following papers: + +[ moleculetype ] +test 1 + +[ atoms ] +1 SN1a 1 PEO EO 1 0.0 45.0 +2 SN2a 1 PEO EP 1 0.0 45.0 +3 SN1a 2 PEO EO 2 0.0 45.0 +4 SN2a 2 PEO EP 2 0.0 45.0 +5 SN1a 3 PEO EO 3 0.0 45.0 + +[ bonds ] +1 2 1 0.44 7000 +3 4 1 0.44 7000 +2 3 1 0.37 7000 +4 5 1 0.37 7000 + diff --git a/polyply/tests/test_data/gen_params/ref/removal.itp b/polyply/tests/test_data/gen_params/ref/removal.itp new file mode 100644 index 00000000..ccccdf43 --- /dev/null +++ b/polyply/tests/test_data/gen_params/ref/removal.itp @@ -0,0 +1,20 @@ +; /Users/fabian/ProgramDev/dev_env/bin/polyply gen_params -f ../input/test_removal.ff -seq PEO:3 -o removal.itp -name test -vv + +; Please cite the following papers: + +[ moleculetype ] +testref 1 + +[ atoms ] +1 SN1a 1 PEO EO 1 0.0 45.0 +2 SN2a 1 PEO EP 1 0.0 45.0 +3 SN1a 2 PEO EO 2 0.0 45.0 +4 SN2a 2 PEO EP 2 0.0 45.0 +5 SN1a 3 PEO EO 3 0.0 45.0 + +[ bonds ] +1 2 1 0.44 7000 +3 4 1 0.44 7000 +2 3 1 0.37 7000 +4 5 1 0.37 7000 + diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index c211a507..f85635ca 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -56,7 +56,13 @@ class TestGenParams(): "-seqf", TEST_DATA + "/gen_params/input/test_edge_attr.json", "-name", "test", "-o", TEST_DATA + "/gen_params/output/test_edge_attr_out.itp"], - TEST_DATA + "/gen_params/ref/test_edge_attr_ref.itp") + TEST_DATA + "/gen_params/ref/test_edge_attr_ref.itp"), + # check if nodes can be removed + (["-f", TEST_DATA+"/gen_params/input/removal.ff", + "-seq", "PEO:3", + "-name", "test", + "-o", TEST_DATA + "/gen_params/output/removal.itp"], + TEST_DATA + "/gen_params/ref/removal.itp") )) def test_gen_params(args_in, ref_file): parser = argparse.ArgumentParser( From 75116ae8b21012921313b5e6fe777f421a386526 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 4 Aug 2022 14:07:41 +0200 Subject: [PATCH 119/275] more efficient parameter removal --- polyply/src/apply_links.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index 42331300..a5f57912 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -482,19 +482,21 @@ def run_molecule(self, meta_molecule): except MatchError as error: LOGGER.debug(str(error), type='step') + # take care to remove nodes if there are any scheduled for removal + # we do this here becuase that's more efficent + molecule.remove_nodes_from(self.nodes_to_remove) + # now we add all interactions but not the ones that contain the removed + # nodes for inter_type in self.applied_links: - for interaction, citation in self.applied_links[inter_type].values(): - meta_molecule.molecule.interactions[inter_type].append(interaction) - if citation: - meta_molecule.molecule.citations.update(citation) + for atoms, (interaction, citation) in self.applied_links[inter_type].items(): + if not any([atom in self.nodes_to_remove for atom in atoms]): + meta_molecule.molecule.interactions[inter_type].append(interaction) + if citation: + meta_molecule.molecule.citations.update(citation) for link in force_field.links: if link.molecule_meta.get('by_atom_id'): apply_explicit_link(molecule, link) - print(molecule.interactions) - # take care to remove nodes if there are any scheduled for removal - molecule.remove_nodes_from(self.nodes_to_remove) - expand_excl(molecule) return meta_molecule From e80ade7d758b75a657b7d1e3f79d2221c6d6e9fb Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Thu, 4 Aug 2022 16:06:40 +0200 Subject: [PATCH 120/275] count num fragments instead of getting it from length of list --- polyply/src/map_to_molecule.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 8972a43d..63721ff7 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -137,7 +137,7 @@ def match_nodes_to_blocks(self, meta_molecule): if len(meta_molecule.nodes) == 1: regular_graph.add_nodes_from(meta_molecule.nodes) - # this will falesly also connect two molecules with the + # this will falsely also connect two molecules with the # same molecule name, if they are from_itp and consecutively # we deal with that below for idx, jdx in nx.dfs_edges(meta_molecule): @@ -155,6 +155,7 @@ def match_nodes_to_blocks(self, meta_molecule): # with more than one residue. Sometimes multiple molecules come # after each other in that case the connected component needs to # be an integer multiple of the block + n_fragments = 0 for fragment in nx.connected_components(restart_graph): frag_nodes = list(fragment) block = self.force_field.blocks[restart_attr[frag_nodes[0]]] @@ -179,7 +180,8 @@ def match_nodes_to_blocks(self, meta_molecule): self.fragments.append(current_frag_nodes) for node in current_frag_nodes: self.node_to_block[node] = restart_attr[frag_nodes[0]] - self.node_to_fragment[node] = len(self.fragments) - 1 + self.node_to_fragment[node] = n_fragments + n_fragments += 1 def add_blocks(self, meta_molecule): """ From f632b00fd7bdd435c4ef7db6aac3d9e8d0d2c14e Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 12 Aug 2022 11:11:06 +0200 Subject: [PATCH 121/275] Only parse known file extensions --- polyply/src/load_library.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 3baadaf4..5f6c8f30 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -71,12 +71,9 @@ def wrapper(parser, path, force_field): path = pathlib.Path(path) file_extension = path.suffix.casefold()[1:] - try: + if file_extension in FORCE_FIELD_PARSERS.keys(): parser = FORCE_FIELD_PARSERS[file_extension] wrapper(parser, path, force_field) - except KeyError: - raise IOError( - "Cannot parse file with extension {}.".format(file_extension)) return force_field From b0c14d0495db2b40666e22e707c4f0a8c0741ac3 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 12 Aug 2022 11:45:06 +0200 Subject: [PATCH 122/275] Add test --- polyply/tests/test_data/ff/DC_template.bld | 16 ++++++++++++++++ polyply/tests/test_load_library.py | 20 ++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 polyply/tests/test_data/ff/DC_template.bld diff --git a/polyply/tests/test_data/ff/DC_template.bld b/polyply/tests/test_data/ff/DC_template.bld new file mode 100644 index 00000000..c2c96328 --- /dev/null +++ b/polyply/tests/test_data/ff/DC_template.bld @@ -0,0 +1,16 @@ +[ template ] +resname DC +[ atoms ] +BB1 Q0 19.0 15.85 10.12 +BB2 SN0 20.58 14.06 7.39 +BB3 SC2 21.88 15.28 6.42 +SC1 TN0 20.0 16.59 5.02 +SC2 TY2 19.75 15.72 3.18 +SC3 TY3 18.78 18.5 3.87 +[ bonds ] +BB1 BB2 +BB2 BB3 +BB3 SC1 +SC1 SC2 +SC1 SC3 +SC2 SC3 diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index 7183bd19..efa72d2c 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -22,13 +22,17 @@ import networkx as nx import vermouth import polyply +from polyply import TEST_DATA +from polyply.src.load_library import _resolve_lib_paths +from polyply.src.load_library import read_ff_from_files -#from polyply import DATA_PATH +def test_read_ff_from_files(): + name = "ff" + force_field = vermouth.forcefield.ForceField(name) + lib_files = _resolve_lib_paths([name], TEST_DATA) + read_ff_from_files(lib_files, force_field) + + # Check if .ff files were parsed + assert force_field.blocks + assert force_field.links -#class TestLoadLibrary(): -# -# @staticmethod -# def test__resolve_lib_paths(): -# libnames = ["martini", "2016H66"] -# paths = -# _resolve_lib_paths(lib_names, DATA_PATH): From 2db9e8f7280e38e1d488ae35c52ba5b3f03a1edc Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Thu, 25 Aug 2022 11:43:07 +0200 Subject: [PATCH 123/275] add TXT FASTA and IG format to gen_params help text --- bin/polyply | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/polyply b/bin/polyply index 29e0b6ff..704eebed 100755 --- a/bin/polyply +++ b/bin/polyply @@ -73,7 +73,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements seq_group.add_argument('-seq', dest='seq', type=str, nargs='+', help='A linear sequence of residue names.') seq_group.add_argument('-seqf', dest='seq_file', type=Path, - help='A graph input file (JSON|ITP)') + help='A graph input file (JSON|TXT|FASTA|IG)') parser_gen_itp.set_defaults(func=gen_itp) From c9b378d065f9a325c0d74085bb3a007f7da5e966 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 30 Aug 2022 21:49:08 +0200 Subject: [PATCH 124/275] Create CONTRIBUTING.md --- .github/CONTRIBUTING.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..13e43c7e --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,23 @@ +## Contributing to polyply + +Thanks for contributing to polyply! + +Everyone is welcome to contribute to the polyply package as described below. + +#### Reporting issues + +If you've found something going wrong with polyply let us know by opnening an [issue](https://github.com/marrink-lab/polyply_1.0/issues). This way we can fix it as fast as possible. + +If your issue isn't a problem with the code and instead you would like some help using polyply for your project, let us know on the [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions). + +As a rule of thumb give a quick look to the [FAQs]( https://github.com/marrink-lab/polyply_1.0/wiki/FAQs) and [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions), +if you’re in doubt as to whether you are experiencing an actual bug or if the usage of polyply is unclear. In any case we’d love to know, so we can improve the situation. + +#### Contributing parameters + +Polyply curates a library of polymer parameters for different force-fields, especially the Martini force-field. We are happy to accept submissions of polymer parameters to the polyply library. To submit parameters simply open an [issue](https://github.com/marrink-lab/polyply_1.0/issues). More details on submitting parameters can be found +[here](https://github.com/marrink-lab/polyply_1.0/wiki/Submit-polymer-parameters). + +#### Contributing code + +To contribute code simply open a pull request. The dev-tream will try it’s best to assist with tips, tricks, and guidance to make a PR as successful as possible. If you are in doubt as to whether your code addition/project would be accepted simply open an issue and let us help you. From d406247ee4aafd9c347cb5ae3238a94850c0b414 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 30 Aug 2022 21:57:16 +0200 Subject: [PATCH 125/275] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..ea2f16e4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Create a report to help us improve polyply +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is and mention the polyply version. +To find the version run `polyply --version` + +**Command line arguments** +Provide all polyply calls and arguments needed to reproduce the issue: +``` +polyply gen_seq ... +polyply gen_itp ... +``` + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional Files** +If applicable, add all files needed in the reproduction. From ae1be4aefbec62238b7869328ffeb296600fb4a7 Mon Sep 17 00:00:00 2001 From: Riccardo Alessandri Date: Tue, 30 Aug 2022 14:58:16 -0500 Subject: [PATCH 126/275] Update .github/CONTRIBUTING.md --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 13e43c7e..a7670a7c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -20,4 +20,4 @@ Polyply curates a library of polymer parameters for different force-fields, espe #### Contributing code -To contribute code simply open a pull request. The dev-tream will try it’s best to assist with tips, tricks, and guidance to make a PR as successful as possible. If you are in doubt as to whether your code addition/project would be accepted simply open an issue and let us help you. +To contribute code simply open a pull request. The dev-tream will try its best to assist with tips, tricks, and guidance to make a PR as successful as possible. If you are in doubt as to whether your code addition/project would be accepted simply open an issue and let us help you. From 04aa678224adc74a9aab61d4f330cf7863925ff0 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:01:38 +0200 Subject: [PATCH 127/275] Update .github/CONTRIBUTING.md Co-authored-by: Riccardo Alessandri --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a7670a7c..af20015f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,7 +6,7 @@ Everyone is welcome to contribute to the polyply package as described below. #### Reporting issues -If you've found something going wrong with polyply let us know by opnening an [issue](https://github.com/marrink-lab/polyply_1.0/issues). This way we can fix it as fast as possible. +If you've found something going wrong with polyply let us know by opening an [issue](https://github.com/marrink-lab/polyply_1.0/issues). This way we can fix it as fast as possible. If your issue isn't a problem with the code and instead you would like some help using polyply for your project, let us know on the [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions). From 2272558e4af882d5aeb23e78ab78273d573f2066 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:01:49 +0200 Subject: [PATCH 128/275] Update .github/CONTRIBUTING.md Co-authored-by: Riccardo Alessandri --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index af20015f..17733a81 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -8,7 +8,7 @@ Everyone is welcome to contribute to the polyply package as described below. If you've found something going wrong with polyply let us know by opening an [issue](https://github.com/marrink-lab/polyply_1.0/issues). This way we can fix it as fast as possible. -If your issue isn't a problem with the code and instead you would like some help using polyply for your project, let us know on the [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions). +If your issue isn't a problem with the code and instead you would like some help using polyply for your project, let us know on the [discussion forum](https://github.com/marrink-lab/polyply_1.0/discussions). As a rule of thumb give a quick look to the [FAQs]( https://github.com/marrink-lab/polyply_1.0/wiki/FAQs) and [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions), if you’re in doubt as to whether you are experiencing an actual bug or if the usage of polyply is unclear. In any case we’d love to know, so we can improve the situation. From d80abb70497c221e8a5b06e7c2ddea251459a140 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:02:01 +0200 Subject: [PATCH 129/275] Update .github/CONTRIBUTING.md Co-authored-by: Riccardo Alessandri --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 17733a81..bf20d28d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -10,7 +10,7 @@ If you've found something going wrong with polyply let us know by opening an [is If your issue isn't a problem with the code and instead you would like some help using polyply for your project, let us know on the [discussion forum](https://github.com/marrink-lab/polyply_1.0/discussions). -As a rule of thumb give a quick look to the [FAQs]( https://github.com/marrink-lab/polyply_1.0/wiki/FAQs) and [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions), +As a rule of thumb, give a quick look to the [FAQs]( https://github.com/marrink-lab/polyply_1.0/wiki/FAQs) and [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions), if you’re in doubt as to whether you are experiencing an actual bug or if the usage of polyply is unclear. In any case we’d love to know, so we can improve the situation. #### Contributing parameters From 9f083a3c51b41cd6a04d2ab741de51b29a9359ae Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:02:08 +0200 Subject: [PATCH 130/275] Update .github/CONTRIBUTING.md Co-authored-by: Riccardo Alessandri --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index bf20d28d..590d4d69 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -11,7 +11,7 @@ If you've found something going wrong with polyply let us know by opening an [is If your issue isn't a problem with the code and instead you would like some help using polyply for your project, let us know on the [discussion forum](https://github.com/marrink-lab/polyply_1.0/discussions). As a rule of thumb, give a quick look to the [FAQs]( https://github.com/marrink-lab/polyply_1.0/wiki/FAQs) and [discussion forum]( https://github.com/marrink-lab/polyply_1.0/discussions), -if you’re in doubt as to whether you are experiencing an actual bug or if the usage of polyply is unclear. In any case we’d love to know, so we can improve the situation. +if you are in doubt as to whether you are experiencing an actual bug or if the usage of polyply is unclear. In any case we’d love to know, so we can improve the situation. #### Contributing parameters From e601403f76b338f92b41d8711a4e616a64750efd Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 1 Sep 2022 13:36:56 +0200 Subject: [PATCH 131/275] add buildfile parsing functionality --- bin/polyply | 4 +- polyply/src/gen_coords.py | 10 +- polyply/src/gen_itp.py | 4 +- polyply/src/gen_seq.py | 4 +- polyply/src/load_library.py | 84 ++++- .../test_data/gen_params/output/PS_out.itp | 320 ------------------ 6 files changed, 81 insertions(+), 345 deletions(-) delete mode 100644 polyply/tests/test_data/gen_params/output/PS_out.itp diff --git a/bin/polyply b/bin/polyply index 29e0b6ff..d83c7cb2 100755 --- a/bin/polyply +++ b/bin/polyply @@ -24,7 +24,7 @@ from pathlib import Path import numpy as np import polyply from polyply import (gen_itp, gen_coords, gen_seq, DATA_PATH) -from polyply.src.load_library import load_library +from polyply.src.load_library import load_ff_library from polyply.src.logging import LOGGER, LOGLEVELS VERSION = 'polyply version {}'.format(polyply.__version__) # pylint: disable=consider-using-f-string @@ -238,7 +238,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements parser.exit() if args.list_blocks: - force_field = load_library("libs", args.list_blocks, []) + force_field = load_ff_library("libs", args.list_blocks, []) msg = 'The following Blocks are present in the following libraries: {}:' print(msg.format(args.list_blocks)) for block in force_field.blocks: diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index a18bc271..1b5ef25d 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -26,7 +26,7 @@ from .topology import Topology from .build_system import BuildSystem from .annotate_ligands import AnnotateLigands, parse_residue_spec, _find_nodes -from .build_file_parser import read_build_file +from .load_library import load_build_options from .check_residue_equivalence import check_residue_equivalence LOGGER = StyleAdapter(get_logger(__name__)) @@ -115,6 +115,7 @@ def gen_coords(toppath, step_fudge=1.0, max_force=5*10**4.0, nrewind=5, + lib=None, bfudge=0.4): """ Subprogram for coordinate generation which implements the default @@ -224,11 +225,8 @@ def gen_coords(toppath, LOGGER.warning(msg) # load in built file - if build: - LOGGER.info("reading build file", type="step") - with open(build) as build_file: - lines = build_file.readlines() - read_build_file(lines, topology.molecules, topology) + LOGGER.info("reading build options", type="step") + load_build_options(topology, build, lib) # collect all starting points for the molecules start_dict = find_starting_node_from_spec(topology, start) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 2a6ab8ab..62605e24 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -31,7 +31,7 @@ from vermouth.graph_utils import make_residue_graph from polyply import (MetaMolecule, ApplyLinks, Monomer, MapToMolecule) from polyply.src.graph_utils import find_missing_edges -from .load_library import load_library +from .load_library import load_ff_library LOGGER = StyleAdapter(get_logger(__name__)) @@ -82,7 +82,7 @@ def gen_params(name, outpath, inpath=None, lib=None, seq=None, seq_file=None): """ # Import of Itp and FF files LOGGER.info("reading input and library files", type="step") - force_field = load_library(name, lib, inpath) + force_field = load_ff_library(name, lib, inpath) # Generate the MetaMolecule if seq: diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index 429ac7ec..ef040f3f 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -17,7 +17,7 @@ import networkx as nx from networkx.readwrite import json_graph from vermouth.graph_utils import make_residue_graph -from .load_library import load_library +from .load_library import load_ff_library from .generate_templates import find_atoms @@ -365,7 +365,7 @@ def gen_seq(name, macros = {} if from_file: - force_field = load_library("seq", None, inpath) + force_field = load_ff_library("seq", None, inpath) for tag_name in from_file: tag, name = tag_name.split(":") macros[tag] = MacroFile(name, force_field) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 5f6c8f30..aa9fe097 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -17,14 +17,18 @@ import vermouth from vermouth.gmx.rtp import read_rtp from vermouth.citation_parser import read_bib +from vermouth.log_helpers import StyleAdapter, get_logger from polyply import DATA_PATH from .ff_parser_sub import read_ff +from .build_file_parser import read_build_file from .polyply_parser import read_polyply +from .topology import Topology +LOGGER = StyleAdapter(get_logger(__name__)) FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib} -def _resolve_lib_paths(lib_names, data_path): +def _resolve_lib_paths(lib_names, data_path, allowed_extensions): """ select the appropiate files from data_path according to library names given. @@ -35,13 +39,17 @@ def _resolve_lib_paths(lib_names, data_path): list of library names data_path: location of library files + allowed_extensions: list[str] + list of allowed file extensions """ files = [] for name in lib_names: directory = os.path.join(data_path, name) for _file in os.listdir(directory): - _file = os.path.join(directory, _file) - files.append(_file) + _, file_extension = os.path.splitext(_file) + if file_extension in allowed_extensions: + _file = os.path.join(directory, _file) + files.append(_file) return files @@ -51,8 +59,8 @@ def read_ff_from_files(paths, force_field): Parameters ---------- - paths: list - List of vaild file paths + paths: list[`os.path`] + List of valid file paths force_field: class:`vermouth.force_field.ForceField` Returns @@ -71,14 +79,13 @@ def wrapper(parser, path, force_field): path = pathlib.Path(path) file_extension = path.suffix.casefold()[1:] - if file_extension in FORCE_FIELD_PARSERS.keys(): - parser = FORCE_FIELD_PARSERS[file_extension] - wrapper(parser, path, force_field) + parser = FORCE_FIELD_PARSERS[file_extension] + wrapper(parser, path, force_field) return force_field -def load_library(name, lib_names, extra_files): +def load_ff_library(name, lib_names, extra_files): """ Load libraries and extra-files into vermouth force-field. @@ -87,9 +94,9 @@ def load_library(name, lib_names, extra_files): ---------- name: str Force-field name - lib_names: list + lib_names: list[`os.path`] List of lirbary names - extra_files: list + extra_files: list[`os.path`] List of extra files to include Returns @@ -98,12 +105,63 @@ def load_library(name, lib_names, extra_files): """ force_field = vermouth.forcefield.ForceField(name) if lib_names and extra_files: - lib_files = _resolve_lib_paths(lib_names, DATA_PATH) + lib_files = _resolve_lib_paths(lib_names, DATA_PATH, + FORCE_FIELD_PARSERS.keys()) all_files = lib_files + extra_files elif lib_names: - all_files = _resolve_lib_paths(lib_names, DATA_PATH) + all_files = _resolve_lib_paths(lib_names, DATA_PATH, + FORCE_FIELD_PARSERS.keys()) elif extra_files: all_files = extra_files read_ff_from_files(all_files, force_field) return force_field + + +def read_from_build_files(paths, topology): + """ + read the input files for the build file options. + + Parameters + ---------- + paths: list[`os.path`] + List of valid file paths + force_field: class:`vermouth.force_field.ForceField` + + Returns + ------- + + """ + for path in paths: + with open(path, 'r') as file_: + lines = file_.readlines() + read_build_file(lines, topology.molecules, topology) + + +def load_build_options(topology, build_files, lib_names): + """ + Load build file options and molecule templates into topology. + + Parameters + ---------- + topology: :class:`polyply.src.topology` + build_files: list[str] + List of build files to parse + lib_names: list[str] + List of library names for which to load templates + + Returns + ------- + + """ + if lib_names and build_files: + lib_files = _resolve_lib_paths(lib_names, DATA_PATH, ['bld']) + all_files = lib_files + build_files + elif lib_names: + all_files = _resolve_lib_paths(lib_names, DATA_PATH, ['bld']) + elif build_files: + all_files = build_files + else: + return + + read_from_build_files(all_files, topology) diff --git a/polyply/tests/test_data/gen_params/output/PS_out.itp b/polyply/tests/test_data/gen_params/output/PS_out.itp deleted file mode 100644 index b7701178..00000000 --- a/polyply/tests/test_data/gen_params/output/PS_out.itp +++ /dev/null @@ -1,320 +0,0 @@ -; /coarse/fabian/current-projects/polymer_itp_builder/vermouth_dev/venvv/bin/pytest test_gen_params.py - -; Please cite the following papers: - -[ moleculetype ] -PS 1 - -[ atoms ] - 1 STY 1 PS R1 1 0.0 45.0 - 2 STY 1 PS R2 2 0.0 45.0 - 3 STY 1 PS R3 3 0.0 45.0 - 4 SCY 1 PS B 4 0.0 45.0 - 5 STY 2 PS R1 5 0.0 45.0 - 6 STY 2 PS R2 6 0.0 45.0 - 7 STY 2 PS R3 7 0.0 45.0 - 8 SCY 2 PS B 8 0.0 45.0 - 9 STY 3 PS R1 9 0.0 45.0 -10 STY 3 PS R2 10 0.0 45.0 -11 STY 3 PS R3 11 0.0 45.0 -12 SCY 3 PS B 12 0.0 45.0 -13 STY 4 PS R1 13 0.0 45.0 -14 STY 4 PS R2 14 0.0 45.0 -15 STY 4 PS R3 15 0.0 45.0 -16 SCY 4 PS B 16 0.0 45.0 -17 STY 5 PS R1 17 0.0 45.0 -18 STY 5 PS R2 18 0.0 45.0 -19 STY 5 PS R3 19 0.0 45.0 -20 SCY 5 PS B 20 0.0 45.0 -21 STY 6 PS R1 21 0.0 45.0 -22 STY 6 PS R2 22 0.0 45.0 -23 STY 6 PS R3 23 0.0 45.0 -24 SCY 6 PS B 24 0.0 45.0 -25 STY 7 PS R1 25 0.0 45.0 -26 STY 7 PS R2 26 0.0 45.0 -27 STY 7 PS R3 27 0.0 45.0 -28 SCY 7 PS B 28 0.0 45.0 -29 STY 8 PS R1 29 0.0 45.0 -30 STY 8 PS R2 30 0.0 45.0 -31 STY 8 PS R3 31 0.0 45.0 -32 SCY 8 PS B 32 0.0 45.0 -33 STY 9 PS R1 33 0.0 45.0 -34 STY 9 PS R2 34 0.0 45.0 -35 STY 9 PS R3 35 0.0 45.0 -36 SCY 9 PS B 36 0.0 45.0 -37 STY 10 PS R1 37 0.0 45.0 -38 STY 10 PS R2 38 0.0 45.0 -39 STY 10 PS R3 39 0.0 45.0 -40 SCY 10 PS B 40 0.0 45.0 - -[ bonds ] - 1 4 1 0.270000 8000.000000 - 5 8 1 0.270000 8000.000000 - 9 12 1 0.270000 8000.000000 -13 16 1 0.270000 8000.000000 -17 20 1 0.270000 8000.000000 -21 24 1 0.270000 8000.000000 -25 28 1 0.270000 8000.000000 -29 32 1 0.270000 8000.000000 -33 36 1 0.270000 8000.000000 -37 40 1 0.270000 8000.000000 - 4 5 1 0.270000 8000.000000 - 8 9 1 0.270000 8000.000000 -12 13 1 0.270000 8000.000000 -16 17 1 0.270000 8000.000000 -20 21 1 0.270000 8000.000000 -24 25 1 0.270000 8000.000000 -28 29 1 0.270000 8000.000000 -32 33 1 0.270000 8000.000000 -36 37 1 0.270000 8000.000000 - -[ constraints ] - 2 3 1 0.270000 - 3 1 1 0.270000 - 1 2 1 0.270000 - 6 7 1 0.270000 - 7 5 1 0.270000 - 5 6 1 0.270000 -10 11 1 0.270000 -11 9 1 0.270000 - 9 10 1 0.270000 -14 15 1 0.270000 -15 13 1 0.270000 -13 14 1 0.270000 -18 19 1 0.270000 -19 17 1 0.270000 -17 18 1 0.270000 -22 23 1 0.270000 -23 21 1 0.270000 -21 22 1 0.270000 -26 27 1 0.270000 -27 25 1 0.270000 -25 26 1 0.270000 -30 31 1 0.270000 -31 29 1 0.270000 -29 30 1 0.270000 -34 35 1 0.270000 -35 33 1 0.270000 -33 34 1 0.270000 -38 39 1 0.270000 -39 37 1 0.270000 -37 38 1 0.270000 - -[ exclusions ] - 1 2 - 1 3 - 1 4 - 2 3 - 2 4 - 3 4 - 5 6 - 5 7 - 5 8 - 6 7 - 6 8 - 7 8 - 9 10 - 9 11 - 9 12 -10 11 -10 12 -11 12 -13 14 -13 15 -13 16 -14 15 -14 16 -15 16 -17 18 -17 19 -17 20 -18 19 -18 20 -19 20 -21 22 -21 23 -21 24 -22 23 -22 24 -23 24 -25 26 -25 27 -25 28 -26 27 -26 28 -27 28 -29 30 -29 31 -29 32 -30 31 -30 32 -31 32 -33 34 -33 35 -33 36 -34 35 -34 36 -35 36 -37 38 -37 39 -37 40 -38 39 -38 40 -39 40 - 1 5 - 5 9 - 9 13 -13 17 -17 21 -21 25 -25 29 -29 33 -33 37 - 1 6 - 5 10 - 9 14 -13 18 -17 22 -21 26 -25 30 -29 34 -33 38 - 1 7 - 5 11 - 9 15 -13 19 -17 23 -21 27 -25 31 -29 35 -33 39 - 1 8 - 5 12 - 9 16 -13 20 -17 24 -21 28 -25 32 -29 36 -33 40 - 2 5 - 6 9 -10 13 -14 17 -18 21 -22 25 -26 29 -30 33 -34 37 - 3 5 - 7 9 -11 13 -15 17 -19 21 -23 25 -27 29 -31 33 -35 37 - 4 5 - 8 9 -12 13 -16 17 -20 21 -24 25 -28 29 -32 33 -36 37 - 4 6 - 8 10 -12 14 -16 18 -20 22 -24 26 -28 30 -32 34 -36 38 - 4 7 - 8 11 -12 15 -16 19 -20 23 -24 27 -28 31 -32 35 -36 39 - 4 8 - 8 12 -12 16 -16 20 -20 24 -24 28 -28 32 -32 36 -36 40 - 4 9 - 8 13 -12 17 -16 21 -20 25 -24 29 -28 33 -32 37 - -[ angles ] - 4 1 2 1 136.000000 100.000000 - 4 1 3 1 136.000000 100.000000 - 8 5 6 1 136.000000 100.000000 - 8 5 7 1 136.000000 100.000000 -12 9 10 1 136.000000 100.000000 -12 9 11 1 136.000000 100.000000 -16 13 14 1 136.000000 100.000000 -16 13 15 1 136.000000 100.000000 -20 17 18 1 136.000000 100.000000 -20 17 19 1 136.000000 100.000000 -24 21 22 1 136.000000 100.000000 -24 21 23 1 136.000000 100.000000 -28 25 26 1 136.000000 100.000000 -28 25 27 1 136.000000 100.000000 -32 29 30 1 136.000000 100.000000 -32 29 31 1 136.000000 100.000000 -36 33 34 1 136.000000 100.000000 -36 33 35 1 136.000000 100.000000 -40 37 38 1 136.000000 100.000000 -40 37 39 1 136.000000 100.000000 - 4 5 6 1 136.000000 100.000000 - 8 9 10 1 136.000000 100.000000 -12 13 14 1 136.000000 100.000000 -16 17 18 1 136.000000 100.000000 -20 21 22 1 136.000000 100.000000 -24 25 26 1 136.000000 100.000000 -28 29 30 1 136.000000 100.000000 -32 33 34 1 136.000000 100.000000 -36 37 38 1 136.000000 100.000000 - 4 5 7 1 136.000000 100.000000 - 8 9 11 1 136.000000 100.000000 -12 13 15 1 136.000000 100.000000 -16 17 19 1 136.000000 100.000000 -20 21 23 1 136.000000 100.000000 -24 25 27 1 136.000000 100.000000 -28 29 31 1 136.000000 100.000000 -32 33 35 1 136.000000 100.000000 -36 37 39 1 136.000000 100.000000 - 1 4 5 1 120.000000 25.000000 - 5 8 9 1 120.000000 25.000000 - 9 12 13 1 120.000000 25.000000 -13 16 17 1 120.000000 25.000000 -17 20 21 1 120.000000 25.000000 -21 24 25 1 120.000000 25.000000 -25 28 29 1 120.000000 25.000000 -29 32 33 1 120.000000 25.000000 -33 36 37 1 120.000000 25.000000 - 4 5 8 1 52.000000 550.000000 - 8 9 12 1 52.000000 550.000000 -12 13 16 1 52.000000 550.000000 -16 17 20 1 52.000000 550.000000 -20 21 24 1 52.000000 550.000000 -24 25 28 1 52.000000 550.000000 -28 29 32 1 52.000000 550.000000 -32 33 36 1 52.000000 550.000000 -36 37 40 1 52.000000 550.000000 - From ce7d98743f36f95d004335aaceedcc5723a158d7 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 1 Sep 2022 13:50:02 +0200 Subject: [PATCH 132/275] add buildfile parsing functionality --- polyply/src/load_library.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index aa9fe097..b56e870b 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -138,14 +138,14 @@ def read_from_build_files(paths, topology): read_build_file(lines, topology.molecules, topology) -def load_build_options(topology, build_files, lib_names): +def load_build_options(topology, build_file, lib_names): """ Load build file options and molecule templates into topology. Parameters ---------- topology: :class:`polyply.src.topology` - build_files: list[str] + build_file: str List of build files to parse lib_names: list[str] List of library names for which to load templates @@ -156,11 +156,11 @@ def load_build_options(topology, build_files, lib_names): """ if lib_names and build_files: lib_files = _resolve_lib_paths(lib_names, DATA_PATH, ['bld']) - all_files = lib_files + build_files + all_files = lib_files + [build_file] elif lib_names: all_files = _resolve_lib_paths(lib_names, DATA_PATH, ['bld']) - elif build_files: - all_files = build_files + elif build_file: + all_files = [build_file] else: return From 05e09deefae16216a717e8e3e0f667fa1e131142 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 1 Sep 2022 14:02:25 +0200 Subject: [PATCH 133/275] revert accidental commits --- polyply/tests/test_data/ff/DC_template.bld | 16 - .../test_data/gen_params/output/PS_out.itp | 320 ++++++++++++++++++ 2 files changed, 320 insertions(+), 16 deletions(-) delete mode 100644 polyply/tests/test_data/ff/DC_template.bld create mode 100644 polyply/tests/test_data/gen_params/output/PS_out.itp diff --git a/polyply/tests/test_data/ff/DC_template.bld b/polyply/tests/test_data/ff/DC_template.bld deleted file mode 100644 index c2c96328..00000000 --- a/polyply/tests/test_data/ff/DC_template.bld +++ /dev/null @@ -1,16 +0,0 @@ -[ template ] -resname DC -[ atoms ] -BB1 Q0 19.0 15.85 10.12 -BB2 SN0 20.58 14.06 7.39 -BB3 SC2 21.88 15.28 6.42 -SC1 TN0 20.0 16.59 5.02 -SC2 TY2 19.75 15.72 3.18 -SC3 TY3 18.78 18.5 3.87 -[ bonds ] -BB1 BB2 -BB2 BB3 -BB3 SC1 -SC1 SC2 -SC1 SC3 -SC2 SC3 diff --git a/polyply/tests/test_data/gen_params/output/PS_out.itp b/polyply/tests/test_data/gen_params/output/PS_out.itp new file mode 100644 index 00000000..b7701178 --- /dev/null +++ b/polyply/tests/test_data/gen_params/output/PS_out.itp @@ -0,0 +1,320 @@ +; /coarse/fabian/current-projects/polymer_itp_builder/vermouth_dev/venvv/bin/pytest test_gen_params.py + +; Please cite the following papers: + +[ moleculetype ] +PS 1 + +[ atoms ] + 1 STY 1 PS R1 1 0.0 45.0 + 2 STY 1 PS R2 2 0.0 45.0 + 3 STY 1 PS R3 3 0.0 45.0 + 4 SCY 1 PS B 4 0.0 45.0 + 5 STY 2 PS R1 5 0.0 45.0 + 6 STY 2 PS R2 6 0.0 45.0 + 7 STY 2 PS R3 7 0.0 45.0 + 8 SCY 2 PS B 8 0.0 45.0 + 9 STY 3 PS R1 9 0.0 45.0 +10 STY 3 PS R2 10 0.0 45.0 +11 STY 3 PS R3 11 0.0 45.0 +12 SCY 3 PS B 12 0.0 45.0 +13 STY 4 PS R1 13 0.0 45.0 +14 STY 4 PS R2 14 0.0 45.0 +15 STY 4 PS R3 15 0.0 45.0 +16 SCY 4 PS B 16 0.0 45.0 +17 STY 5 PS R1 17 0.0 45.0 +18 STY 5 PS R2 18 0.0 45.0 +19 STY 5 PS R3 19 0.0 45.0 +20 SCY 5 PS B 20 0.0 45.0 +21 STY 6 PS R1 21 0.0 45.0 +22 STY 6 PS R2 22 0.0 45.0 +23 STY 6 PS R3 23 0.0 45.0 +24 SCY 6 PS B 24 0.0 45.0 +25 STY 7 PS R1 25 0.0 45.0 +26 STY 7 PS R2 26 0.0 45.0 +27 STY 7 PS R3 27 0.0 45.0 +28 SCY 7 PS B 28 0.0 45.0 +29 STY 8 PS R1 29 0.0 45.0 +30 STY 8 PS R2 30 0.0 45.0 +31 STY 8 PS R3 31 0.0 45.0 +32 SCY 8 PS B 32 0.0 45.0 +33 STY 9 PS R1 33 0.0 45.0 +34 STY 9 PS R2 34 0.0 45.0 +35 STY 9 PS R3 35 0.0 45.0 +36 SCY 9 PS B 36 0.0 45.0 +37 STY 10 PS R1 37 0.0 45.0 +38 STY 10 PS R2 38 0.0 45.0 +39 STY 10 PS R3 39 0.0 45.0 +40 SCY 10 PS B 40 0.0 45.0 + +[ bonds ] + 1 4 1 0.270000 8000.000000 + 5 8 1 0.270000 8000.000000 + 9 12 1 0.270000 8000.000000 +13 16 1 0.270000 8000.000000 +17 20 1 0.270000 8000.000000 +21 24 1 0.270000 8000.000000 +25 28 1 0.270000 8000.000000 +29 32 1 0.270000 8000.000000 +33 36 1 0.270000 8000.000000 +37 40 1 0.270000 8000.000000 + 4 5 1 0.270000 8000.000000 + 8 9 1 0.270000 8000.000000 +12 13 1 0.270000 8000.000000 +16 17 1 0.270000 8000.000000 +20 21 1 0.270000 8000.000000 +24 25 1 0.270000 8000.000000 +28 29 1 0.270000 8000.000000 +32 33 1 0.270000 8000.000000 +36 37 1 0.270000 8000.000000 + +[ constraints ] + 2 3 1 0.270000 + 3 1 1 0.270000 + 1 2 1 0.270000 + 6 7 1 0.270000 + 7 5 1 0.270000 + 5 6 1 0.270000 +10 11 1 0.270000 +11 9 1 0.270000 + 9 10 1 0.270000 +14 15 1 0.270000 +15 13 1 0.270000 +13 14 1 0.270000 +18 19 1 0.270000 +19 17 1 0.270000 +17 18 1 0.270000 +22 23 1 0.270000 +23 21 1 0.270000 +21 22 1 0.270000 +26 27 1 0.270000 +27 25 1 0.270000 +25 26 1 0.270000 +30 31 1 0.270000 +31 29 1 0.270000 +29 30 1 0.270000 +34 35 1 0.270000 +35 33 1 0.270000 +33 34 1 0.270000 +38 39 1 0.270000 +39 37 1 0.270000 +37 38 1 0.270000 + +[ exclusions ] + 1 2 + 1 3 + 1 4 + 2 3 + 2 4 + 3 4 + 5 6 + 5 7 + 5 8 + 6 7 + 6 8 + 7 8 + 9 10 + 9 11 + 9 12 +10 11 +10 12 +11 12 +13 14 +13 15 +13 16 +14 15 +14 16 +15 16 +17 18 +17 19 +17 20 +18 19 +18 20 +19 20 +21 22 +21 23 +21 24 +22 23 +22 24 +23 24 +25 26 +25 27 +25 28 +26 27 +26 28 +27 28 +29 30 +29 31 +29 32 +30 31 +30 32 +31 32 +33 34 +33 35 +33 36 +34 35 +34 36 +35 36 +37 38 +37 39 +37 40 +38 39 +38 40 +39 40 + 1 5 + 5 9 + 9 13 +13 17 +17 21 +21 25 +25 29 +29 33 +33 37 + 1 6 + 5 10 + 9 14 +13 18 +17 22 +21 26 +25 30 +29 34 +33 38 + 1 7 + 5 11 + 9 15 +13 19 +17 23 +21 27 +25 31 +29 35 +33 39 + 1 8 + 5 12 + 9 16 +13 20 +17 24 +21 28 +25 32 +29 36 +33 40 + 2 5 + 6 9 +10 13 +14 17 +18 21 +22 25 +26 29 +30 33 +34 37 + 3 5 + 7 9 +11 13 +15 17 +19 21 +23 25 +27 29 +31 33 +35 37 + 4 5 + 8 9 +12 13 +16 17 +20 21 +24 25 +28 29 +32 33 +36 37 + 4 6 + 8 10 +12 14 +16 18 +20 22 +24 26 +28 30 +32 34 +36 38 + 4 7 + 8 11 +12 15 +16 19 +20 23 +24 27 +28 31 +32 35 +36 39 + 4 8 + 8 12 +12 16 +16 20 +20 24 +24 28 +28 32 +32 36 +36 40 + 4 9 + 8 13 +12 17 +16 21 +20 25 +24 29 +28 33 +32 37 + +[ angles ] + 4 1 2 1 136.000000 100.000000 + 4 1 3 1 136.000000 100.000000 + 8 5 6 1 136.000000 100.000000 + 8 5 7 1 136.000000 100.000000 +12 9 10 1 136.000000 100.000000 +12 9 11 1 136.000000 100.000000 +16 13 14 1 136.000000 100.000000 +16 13 15 1 136.000000 100.000000 +20 17 18 1 136.000000 100.000000 +20 17 19 1 136.000000 100.000000 +24 21 22 1 136.000000 100.000000 +24 21 23 1 136.000000 100.000000 +28 25 26 1 136.000000 100.000000 +28 25 27 1 136.000000 100.000000 +32 29 30 1 136.000000 100.000000 +32 29 31 1 136.000000 100.000000 +36 33 34 1 136.000000 100.000000 +36 33 35 1 136.000000 100.000000 +40 37 38 1 136.000000 100.000000 +40 37 39 1 136.000000 100.000000 + 4 5 6 1 136.000000 100.000000 + 8 9 10 1 136.000000 100.000000 +12 13 14 1 136.000000 100.000000 +16 17 18 1 136.000000 100.000000 +20 21 22 1 136.000000 100.000000 +24 25 26 1 136.000000 100.000000 +28 29 30 1 136.000000 100.000000 +32 33 34 1 136.000000 100.000000 +36 37 38 1 136.000000 100.000000 + 4 5 7 1 136.000000 100.000000 + 8 9 11 1 136.000000 100.000000 +12 13 15 1 136.000000 100.000000 +16 17 19 1 136.000000 100.000000 +20 21 23 1 136.000000 100.000000 +24 25 27 1 136.000000 100.000000 +28 29 31 1 136.000000 100.000000 +32 33 35 1 136.000000 100.000000 +36 37 39 1 136.000000 100.000000 + 1 4 5 1 120.000000 25.000000 + 5 8 9 1 120.000000 25.000000 + 9 12 13 1 120.000000 25.000000 +13 16 17 1 120.000000 25.000000 +17 20 21 1 120.000000 25.000000 +21 24 25 1 120.000000 25.000000 +25 28 29 1 120.000000 25.000000 +29 32 33 1 120.000000 25.000000 +33 36 37 1 120.000000 25.000000 + 4 5 8 1 52.000000 550.000000 + 8 9 12 1 52.000000 550.000000 +12 13 16 1 52.000000 550.000000 +16 17 20 1 52.000000 550.000000 +20 21 24 1 52.000000 550.000000 +24 25 28 1 52.000000 550.000000 +28 29 32 1 52.000000 550.000000 +32 33 36 1 52.000000 550.000000 +36 37 40 1 52.000000 550.000000 + From 2a6fde9271334a02070850c0d5ab5be2c0026d5d Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 1 Sep 2022 14:08:14 +0200 Subject: [PATCH 134/275] small fixes --- polyply/src/load_library.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index b56e870b..265d185c 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -118,15 +118,16 @@ def load_ff_library(name, lib_names, extra_files): return force_field -def read_from_build_files(paths, topology): +def read_build_options_from_files(paths, topology): """ - read the input files for the build file options. + read the input files for the build options and + molecule templates. Parameters ---------- paths: list[`os.path`] List of valid file paths - force_field: class:`vermouth.force_field.ForceField` + topology: :class:`polyply.src.topology` Returns ------- @@ -154,7 +155,7 @@ def load_build_options(topology, build_file, lib_names): ------- """ - if lib_names and build_files: + if lib_names and build_file: lib_files = _resolve_lib_paths(lib_names, DATA_PATH, ['bld']) all_files = lib_files + [build_file] elif lib_names: @@ -164,4 +165,4 @@ def load_build_options(topology, build_file, lib_names): else: return - read_from_build_files(all_files, topology) + read_build_options_from_files(all_files, topology) From 0dedb3b8eac4fd73bb268ae37b25cccd5dac83c8 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 1 Sep 2022 17:16:48 +0200 Subject: [PATCH 135/275] Fix failing tests --- polyply/src/load_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 265d185c..18d6331e 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -47,7 +47,7 @@ def _resolve_lib_paths(lib_names, data_path, allowed_extensions): directory = os.path.join(data_path, name) for _file in os.listdir(directory): _, file_extension = os.path.splitext(_file) - if file_extension in allowed_extensions: + if file_extension[1:] in allowed_extensions: _file = os.path.join(directory, _file) files.append(_file) return files From c708f33bcc5734126236e24260a75231c4f35e44 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 1 Sep 2022 17:26:53 +0200 Subject: [PATCH 136/275] Fix failing tests (now really) --- polyply/tests/test_load_library.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index efa72d2c..e61b4517 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -25,11 +25,12 @@ from polyply import TEST_DATA from polyply.src.load_library import _resolve_lib_paths from polyply.src.load_library import read_ff_from_files +from polyply.src.load_library import FORCE_FIELD_PARSERS def test_read_ff_from_files(): name = "ff" force_field = vermouth.forcefield.ForceField(name) - lib_files = _resolve_lib_paths([name], TEST_DATA) + lib_files = _resolve_lib_paths([name], TEST_DATA, FORCE_FIELD_PARSERS.keys()) read_ff_from_files(lib_files, force_field) # Check if .ff files were parsed From 06b1695f7bc2cb4161e153b6df12b44ee5bf14cf Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 2 Sep 2022 15:02:54 +0200 Subject: [PATCH 137/275] add development branch to CI --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 6afacf68..548d2a08 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -5,9 +5,9 @@ name: test package on: push: - branches: [ master ] + branches: [ master, develop ] pull_request: - branches: [ master ] + branches: [ master. develop ] jobs: build: From d396f9b309ce7d1fa942c5a52d2970384e791d81 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 2 Sep 2022 16:15:13 +0200 Subject: [PATCH 138/275] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 548d2a08..599a8cec 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -7,7 +7,7 @@ on: push: branches: [ master, develop ] pull_request: - branches: [ master. develop ] + branches: [ master, develop ] jobs: build: From 504e3a709fb16ea083e15ac54a60f70e1a96d5ac Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Wed, 7 Sep 2022 10:35:11 +0200 Subject: [PATCH 139/275] Update issue templates Add issue template for parameter submission --- .../ISSUE_TEMPLATE/parameter-submission.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/parameter-submission.md diff --git a/.github/ISSUE_TEMPLATE/parameter-submission.md b/.github/ISSUE_TEMPLATE/parameter-submission.md new file mode 100644 index 00000000..567e8c92 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/parameter-submission.md @@ -0,0 +1,23 @@ +--- +name: Parameter Submission +about: Submit parameters to polyply library. +title: "[PARAMETERS]" +labels: parameter submission +assignees: '' + +--- + +**Parameter Description** +A brief description of the parameters you want to add to the library providing the following information: +- residue/monomer name +- citation if available +- force-field +- simulation program (currently only GROMACS is supported) +- are the termini different? + +** Additional Files & Resources** +If you want us to implement the parameters please provide the following files. However, we encourage users to try implementing files themselves by opening a PR. + +- reference itp file +- link to force-field definition if it is a new force-field not part of the library +- From f0930c1d603fd45a5e7db4f3a195a87f91d4eba9 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:12:50 +0200 Subject: [PATCH 140/275] Update .github/ISSUE_TEMPLATE/parameter-submission.md Co-authored-by: Peter C Kroon --- .github/ISSUE_TEMPLATE/parameter-submission.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/parameter-submission.md b/.github/ISSUE_TEMPLATE/parameter-submission.md index 567e8c92..f6f79303 100644 --- a/.github/ISSUE_TEMPLATE/parameter-submission.md +++ b/.github/ISSUE_TEMPLATE/parameter-submission.md @@ -20,4 +20,3 @@ If you want us to implement the parameters please provide the following files. H - reference itp file - link to force-field definition if it is a new force-field not part of the library -- From 7d6ed9803864f98de6f71a9177088298dfa995fa Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:10:42 +0200 Subject: [PATCH 141/275] Update polyply/src/apply_links.py Co-authored-by: Peter C Kroon --- polyply/src/apply_links.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index a5f57912..ef1f69a6 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -361,8 +361,7 @@ def _update_applied_links(self, interactions_dict, molecule, citations, mapping= else: new_interaction = interaction - interaction_key = tuple(new_interaction.atoms) +\ - tuple([new_interaction.meta.get("version", 1)]) + interaction_key = (*new_interaction.atoms, new_interaction.meta.get("version", 1)) self.applied_links[inter_type][interaction_key] = (new_interaction, citations) def apply_link_between_residues(self, meta_molecule, link, link_to_resid): From 59da569ec49160cc3360c476f67b8f82448f1475 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:10:53 +0200 Subject: [PATCH 142/275] Update polyply/src/apply_links.py Co-authored-by: Peter C Kroon --- polyply/src/apply_links.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index ef1f69a6..c5ab4164 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -488,7 +488,7 @@ def run_molecule(self, meta_molecule): # nodes for inter_type in self.applied_links: for atoms, (interaction, citation) in self.applied_links[inter_type].items(): - if not any([atom in self.nodes_to_remove for atom in atoms]): + if not any(atom in self.nodes_to_remove for atom in atoms): meta_molecule.molecule.interactions[inter_type].append(interaction) if citation: meta_molecule.molecule.citations.update(citation) From 3acd0dcc655525fc037bace0ec6ddc0effb59539 Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Wed, 7 Sep 2022 17:24:28 +0200 Subject: [PATCH 143/275] address comments --- polyply/src/apply_links.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index c5ab4164..ac89e6d5 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -342,7 +342,7 @@ def __init__(self, *args, debug=False, **kwargs): self.applied_links = defaultdict(dict) self.nodes_to_remove = [] - def _update_applied_links(self, interactions_dict, molecule, citations, mapping=None): + def _update_interactions_dict(self, interactions_dict, molecule, citations, mapping=None): """ Helper function for adding links to the applied links dictionary. If mapping is given the interaction atoms are mapped to the molecule @@ -414,10 +414,10 @@ def apply_link_between_residues(self, meta_molecule, link, link_to_resid): molecule.nodes[link_to_mol[node]].update(link.nodes[node].get('replace', {})) # based on the match we build the link interaction - self._update_applied_links(link.interactions, - molecule, - link.citations, - mapping=link_to_mol) + self._update_interactions_dict(link.interactions, + molecule, + link.citations, + mapping=link_to_mol) # now we already add the edges of this link # links can overwrite each other but the edges must be the same @@ -447,7 +447,7 @@ def run_molecule(self, meta_molecule): molecule = meta_molecule.molecule force_field = meta_molecule.force_field # we need to update the temporary interactions dict - self._update_applied_links(molecule.interactions, molecule, molecule.citations, mapping=None) + self._update_interactions_dict(molecule.interactions, molecule, molecule.citations, mapping=None) # now we can clear the molecule dict molecule.interactions = defaultdict(list) @@ -490,8 +490,7 @@ def run_molecule(self, meta_molecule): for atoms, (interaction, citation) in self.applied_links[inter_type].items(): if not any(atom in self.nodes_to_remove for atom in atoms): meta_molecule.molecule.interactions[inter_type].append(interaction) - if citation: - meta_molecule.molecule.citations.update(citation) + meta_molecule.molecule.citations.update(citation) for link in force_field.links: if link.molecule_meta.get('by_atom_id'): From 95efef8382a1b641bc3deb08ddd693926f7f7cb9 Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Thu, 8 Sep 2022 17:00:24 +0200 Subject: [PATCH 144/275] fix bug in topology reading --- polyply/src/topology.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 1435413c..b46c0d64 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -388,7 +388,8 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): for meta_mol in self.molecules: for meta_node in meta_mol.nodes: resname = meta_mol.nodes[meta_node]["resname"] - mol_nodes = meta_mol.nodes[meta_node]['graph'].nodes + # the fragment graph nodes are not sorted + mol_nodes = sorted(meta_mol.nodes[meta_node]['graph'].nodes) # skip residue if resname is to be skipped or # if the no more coordinates are available # in that case we want to build the node and @@ -413,6 +414,7 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): # based on a non-complete residue try: meta_mol.molecule.nodes[mol_node]["position"] = positions[total] + print(mol_node, positions[total]) except IndexError: resid = meta_mol.nodes[meta_node]['resid'] mol_name = meta_mol.mol_name From 5df76eebd5d98345e061f25cd2f177c1e7b12e14 Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Thu, 8 Sep 2022 17:08:26 +0200 Subject: [PATCH 145/275] fix bug in topology reading and add test --- polyply/src/topology.py | 1 - polyply/tests/test_topology.py | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index b46c0d64..684ea378 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -414,7 +414,6 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): # based on a non-complete residue try: meta_mol.molecule.nodes[mol_node]["position"] = positions[total] - print(mol_node, positions[total]) except IndexError: resid = meta_mol.nodes[meta_node]['resid'] mol_name = meta_mol.mol_name diff --git a/polyply/tests/test_topology.py b/polyply/tests/test_topology.py index 76230c89..92b7810b 100644 --- a/polyply/tests/test_topology.py +++ b/polyply/tests/test_topology.py @@ -18,9 +18,11 @@ import textwrap import pytest import math +import numpy as np import vermouth.forcefield import vermouth.molecule from vermouth.molecule import Interaction +from vermouth.pdb.pdb import read_pdb import polyply.src.meta_molecule from polyply import TEST_DATA from polyply.src.topology import Topology @@ -87,9 +89,12 @@ def test_add_positions_from_pdb(): """ top = Topology.from_gmx_topfile(TEST_DATA + "/topology_test/pdb.top", "test") top.add_positions_from_file(TEST_DATA + "/topology_test/test.pdb") - for meta_mol in top.molecules: + + pdb_mols = read_pdb(TEST_DATA + "/topology_test/test.pdb") + for idx, meta_mol in enumerate(top.molecules): for node in meta_mol.molecule.nodes: - assert "position" in meta_mol.molecule.nodes[node].keys() + ref_pos = pdb_mols[idx].nodes[node]['position'] + assert np.all(ref_pos == meta_mol.molecule.nodes[node]['position']) for meta_mol in top.molecules: for node in meta_mol.nodes: From b84edc5e5cd138227fa88338faf26fd81cf89bad Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Sat, 10 Sep 2022 19:52:24 +0200 Subject: [PATCH 146/275] sort graph nodes of meta-mol node attribute by index when reading positions --- polyply/src/topology.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 684ea378..704e9f46 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -388,8 +388,11 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): for meta_mol in self.molecules: for meta_node in meta_mol.nodes: resname = meta_mol.nodes[meta_node]["resname"] - # the fragment graph nodes are not sorted - mol_nodes = sorted(meta_mol.nodes[meta_node]['graph'].nodes) + # the fragment graph nodes are not sorted so we sort them by index + # as defined in the itp-file to capture cases, where the molecule + # graph nodes are permuted with respect to the index + idx_nodes = nx.get_node_attributes(meta_mol.nodes[meta_node]['graph'], "index") + mol_nodes = [node for _, node in sorted(zip(idx_nodes.values(), idx_nodes.keys()))] # skip residue if resname is to be skipped or # if the no more coordinates are available # in that case we want to build the node and From 718e58c583697eee97f9c98414a2ca4d4989336c Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 12 Sep 2022 15:41:29 +0200 Subject: [PATCH 147/275] Update polyply/src/topology.py Co-authored-by: Peter C Kroon --- polyply/src/topology.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 704e9f46..71624797 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -392,7 +392,7 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): # as defined in the itp-file to capture cases, where the molecule # graph nodes are permuted with respect to the index idx_nodes = nx.get_node_attributes(meta_mol.nodes[meta_node]['graph'], "index") - mol_nodes = [node for _, node in sorted(zip(idx_nodes.values(), idx_nodes.keys()))] + mol_nodes = sorted(meta_mol, key=idx_nodex.get) # skip residue if resname is to be skipped or # if the no more coordinates are available # in that case we want to build the node and From d7aa901a7b7d150bd4c320edf0fd76a75063711c Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 13 Sep 2022 10:21:02 +0200 Subject: [PATCH 148/275] Update topology.py Fox minor spelling bug --- polyply/src/topology.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 71624797..3d0cf627 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -392,7 +392,7 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): # as defined in the itp-file to capture cases, where the molecule # graph nodes are permuted with respect to the index idx_nodes = nx.get_node_attributes(meta_mol.nodes[meta_node]['graph'], "index") - mol_nodes = sorted(meta_mol, key=idx_nodex.get) + mol_nodes = sorted(meta_mol, key=idx_nodes.get) # skip residue if resname is to be skipped or # if the no more coordinates are available # in that case we want to build the node and From 4ae11bba653f6a4b8b297e8b06c196edd84d85bb Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 13 Sep 2022 10:35:43 +0200 Subject: [PATCH 149/275] Update topology.py --- polyply/src/topology.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 3d0cf627..f32d93d0 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -392,7 +392,7 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): # as defined in the itp-file to capture cases, where the molecule # graph nodes are permuted with respect to the index idx_nodes = nx.get_node_attributes(meta_mol.nodes[meta_node]['graph'], "index") - mol_nodes = sorted(meta_mol, key=idx_nodes.get) + mol_nodes = sorted(meta_mol.nodes, key=idx_nodes.get) # skip residue if resname is to be skipped or # if the no more coordinates are available # in that case we want to build the node and From 80233dd50a5a3ac1903df26ba0dfa7a738afb7a0 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 13 Sep 2022 11:00:33 +0200 Subject: [PATCH 150/275] Update topology.py --- polyply/src/topology.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index f32d93d0..125fcf08 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -390,9 +390,9 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): resname = meta_mol.nodes[meta_node]["resname"] # the fragment graph nodes are not sorted so we sort them by index # as defined in the itp-file to capture cases, where the molecule - # graph nodes are permuted with respect to the index + # graph nodes are permuted with respect to the index] idx_nodes = nx.get_node_attributes(meta_mol.nodes[meta_node]['graph'], "index") - mol_nodes = sorted(meta_mol.nodes, key=idx_nodes.get) + mol_nodes = sorted(idx_nodes, key=idx_nodes.get) # skip residue if resname is to be skipped or # if the no more coordinates are available # in that case we want to build the node and From e07658d1af43bed0a93ef4c33057b5fc841e9c4b Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 13 Sep 2022 11:02:23 +0200 Subject: [PATCH 151/275] Update polyply/src/topology.py Co-authored-by: Peter C Kroon --- polyply/src/topology.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 125fcf08..6101d3d7 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -390,7 +390,7 @@ def add_positions_from_file(self, path, skip_res=[], resolution='mol'): resname = meta_mol.nodes[meta_node]["resname"] # the fragment graph nodes are not sorted so we sort them by index # as defined in the itp-file to capture cases, where the molecule - # graph nodes are permuted with respect to the index] + # graph nodes are permuted with respect to the index idx_nodes = nx.get_node_attributes(meta_mol.nodes[meta_node]['graph'], "index") mol_nodes = sorted(idx_nodes, key=idx_nodes.get) # skip residue if resname is to be skipped or From f1140970a4c963c25a68c15d1761d199b61f426f Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Thu, 6 Oct 2022 11:58:49 -0500 Subject: [PATCH 152/275] Add PTMA CG M3 model to polyply library [arXiv:2209.02072] --- polyply/data/martini3/PTMA.martini3.ff | 60 ++++++++++++++++++++++++++ polyply/data/martini3/citations.bib | 11 +++++ 2 files changed, 71 insertions(+) create mode 100644 polyply/data/martini3/PTMA.martini3.ff diff --git a/polyply/data/martini3/PTMA.martini3.ff b/polyply/data/martini3/PTMA.martini3.ff new file mode 100644 index 00000000..4c313728 --- /dev/null +++ b/polyply/data/martini3/PTMA.martini3.ff @@ -0,0 +1,60 @@ +[ moleculetype ] +; name nexcl. +PTMA 1 + +[ atoms ] +; id type resnr residu atom cgnr charge mass + 1 SC3 1 PTMA VNL 1 0.0 54 + 2 SN4a 1 PTMA EST 2 0.0 54 + 3 SC3 1 PTMA C1 3 0.0 54 + 4 SC3 1 PTMA C2 4 0.0 54 + 5 SC3 1 PTMA C3 5 0.0 54 + 6 TP5 1 PTMA N4 6 0.0 36 + +[ bonds ] +; i j funct length + 1 2 1 0.262 15000 { "comment": "M3 PMMA model [10.1038/s41467-021-27627-4] shortened"} + 2 3 1 0.253 15000 { "comment": "PMMA-TEMPO connection"} + 3 4 1 0.326 25000 { "comment": "cog (TEMPO)"} + 3 5 1 0.326 25000 { "comment": "cog (TEMPO)"} + 3 6 1 0.310 100000 {"ifdef": "FLEXIBLE", "comment": "cog (TEMPO)"} + 4 6 1 0.238 100000 {"ifdef": "FLEXIBLE", "comment": "cog (TEMPO)"} + 5 6 1 0.238 100000 {"ifdef": "FLEXIBLE", "comment": "cog (TEMPO)"} + +[constraints] +; i j funct length + 3 6 1 0.310 {"ifndef": "FLEXIBLE", "comment": "cog (TEMPO)"} + 4 6 1 0.238 {"ifndef": "FLEXIBLE", "comment": "cog (TEMPO)"} + 5 6 1 0.238 {"ifndef": "FLEXIBLE", "comment": "cog (TEMPO)"} + +[ angles ] +; i j k funct length force k + 1 2 3 2 132.9 70 { "comment": "PMMA-TEMPO connection"} + 2 3 4 2 129.0 60 { "comment": "PMMA-TEMPO connection"} + 2 3 5 2 121.9 95 { "comment": "PMMA-TEMPO connection"} + +[dihedrals] +; i j k l funct ref.angle force_k + 3 4 5 6 2 140.00 20 { "comment": "cog (TEMPO)"} + 2 4 5 6 2 150.00 80 { "comment": "PMMA-TEMPO connection"} + + +[ link ] +resname "PTMA" +[ bonds ] +VNL +VNL 1 0.315 4000 {"group": "vinyl backbone"} + +[ link ] +resname "PTMA" +[ angles ] +VNL +VNL ++VNL 2 115 35 {"group": "vinyl backbone"} + +[ link ] +resname "PTMA" +[ angles ] +EST VNL +VNL 2 70 20 + +[ citation ] +2022RAlessandri-arXiv +Martini3 +polyply diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index 9a3746d7..3080c9e2 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -31,3 +31,14 @@ @article{PPEs publisher={The Royal Society of Chemistry}, url={http://dx.doi.org/10.1039/D1CP04237H}, } + +@article{2022RAlessandri-arXiv, + title={Predicting Electronic Properties of Radical-Containing Polymers at Coarse-Grained Resolutions}, + author={Riccardo Alessandri and Juan J. de Pablo}, + year={2022}, + eprint={2209.02072}, + archivePrefix={arXiv}, + primaryClass={cond-mat.soft}, + doi={https://doi.org/10.48550/arXiv.2209.02072} +} + From 5b4d85888e579e63666cfcc6ae4ab5e215b0b132 Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Thu, 13 Oct 2022 12:11:34 -0500 Subject: [PATCH 153/275] Name in citations.bib need to be {Surname, Last Name} --- polyply/data/martini3/citations.bib | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index 3080c9e2..77879133 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -31,14 +31,12 @@ @article{PPEs publisher={The Royal Society of Chemistry}, url={http://dx.doi.org/10.1039/D1CP04237H}, } - @article{2022RAlessandri-arXiv, title={Predicting Electronic Properties of Radical-Containing Polymers at Coarse-Grained Resolutions}, - author={Riccardo Alessandri and Juan J. de Pablo}, + author={Alessandri, Riccardo and de Pablo, Juan J.}, + journal={arXiv}, year={2022}, eprint={2209.02072}, - archivePrefix={arXiv}, primaryClass={cond-mat.soft}, doi={https://doi.org/10.48550/arXiv.2209.02072} } - From 560ff0ce35856fa13d75be02907f9a4277707a92 Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Thu, 13 Oct 2022 12:12:30 -0500 Subject: [PATCH 154/275] Add test for PTMA M3 model --- .../martini3/PTMA/polyply/PTMA.itp | 265 ++++++++++++++++++ .../martini3/PTMA/polyply/command | 1 + 2 files changed, 266 insertions(+) create mode 100644 polyply/tests/test_data/library_tests/martini3/PTMA/polyply/PTMA.itp create mode 100644 polyply/tests/test_data/library_tests/martini3/PTMA/polyply/command diff --git a/polyply/tests/test_data/library_tests/martini3/PTMA/polyply/PTMA.itp b/polyply/tests/test_data/library_tests/martini3/PTMA/polyply/PTMA.itp new file mode 100644 index 00000000..72ef9688 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PTMA/polyply/PTMA.itp @@ -0,0 +1,265 @@ +; /Users/alessandri/miniconda3/envs/polyply/bin/polyply gen_params -lib martini3 -seq PTMA:10 -o PTMA.itp -name PTMA + +; Please cite the following papers: +; Alessandri, R; de Pablo, J J; arXiv 2022; https://doi.org/10.48550/arXiv.2209.02072 +; Souza, P C T; Alessandri, R; Barnoud, J; Thallmair, S; Faustino, I; Grünewald, F; Patmanidis, I; Abdizadeh, H; Bruininks, B M H; Wassenaar, T A; Kroon, P C; Melcr, J; Nieto, V; Corradi, V; Khan, H M; Domański, J; Javanainen, M; Martinez-Seara, H; Reuter, N; Best, R B; Vattulainen, I; Monticelli, L; Periole, X; Tieleman, D P; de Vries, A H; Marrink, S J; Nature Methods 2021; 10.1038/s41592-021-01098-3 +; Grunewald, F; Alessandri, R; Kroon, P C; Monticelli, L; Souza, P C; Marrink, S J; Nature Communications 2022; 10.1038/s41467-021-27627-4 + +[ moleculetype ] +PTMA 1 + +[ atoms ] + 1 SC3 1 PTMA VNL 1 0.0 54.0 + 2 SN4a 1 PTMA EST 2 0.0 54.0 + 3 SC3 1 PTMA C1 3 0.0 54.0 + 4 SC3 1 PTMA C2 4 0.0 54.0 + 5 SC3 1 PTMA C3 5 0.0 54.0 + 6 TP5 1 PTMA N4 6 0.0 36.0 + 7 SC3 2 PTMA VNL 7 0.0 54.0 + 8 SN4a 2 PTMA EST 8 0.0 54.0 + 9 SC3 2 PTMA C1 9 0.0 54.0 +10 SC3 2 PTMA C2 10 0.0 54.0 +11 SC3 2 PTMA C3 11 0.0 54.0 +12 TP5 2 PTMA N4 12 0.0 36.0 +13 SC3 3 PTMA VNL 13 0.0 54.0 +14 SN4a 3 PTMA EST 14 0.0 54.0 +15 SC3 3 PTMA C1 15 0.0 54.0 +16 SC3 3 PTMA C2 16 0.0 54.0 +17 SC3 3 PTMA C3 17 0.0 54.0 +18 TP5 3 PTMA N4 18 0.0 36.0 +19 SC3 4 PTMA VNL 19 0.0 54.0 +20 SN4a 4 PTMA EST 20 0.0 54.0 +21 SC3 4 PTMA C1 21 0.0 54.0 +22 SC3 4 PTMA C2 22 0.0 54.0 +23 SC3 4 PTMA C3 23 0.0 54.0 +24 TP5 4 PTMA N4 24 0.0 36.0 +25 SC3 5 PTMA VNL 25 0.0 54.0 +26 SN4a 5 PTMA EST 26 0.0 54.0 +27 SC3 5 PTMA C1 27 0.0 54.0 +28 SC3 5 PTMA C2 28 0.0 54.0 +29 SC3 5 PTMA C3 29 0.0 54.0 +30 TP5 5 PTMA N4 30 0.0 36.0 +31 SC3 6 PTMA VNL 31 0.0 54.0 +32 SN4a 6 PTMA EST 32 0.0 54.0 +33 SC3 6 PTMA C1 33 0.0 54.0 +34 SC3 6 PTMA C2 34 0.0 54.0 +35 SC3 6 PTMA C3 35 0.0 54.0 +36 TP5 6 PTMA N4 36 0.0 36.0 +37 SC3 7 PTMA VNL 37 0.0 54.0 +38 SN4a 7 PTMA EST 38 0.0 54.0 +39 SC3 7 PTMA C1 39 0.0 54.0 +40 SC3 7 PTMA C2 40 0.0 54.0 +41 SC3 7 PTMA C3 41 0.0 54.0 +42 TP5 7 PTMA N4 42 0.0 36.0 +43 SC3 8 PTMA VNL 43 0.0 54.0 +44 SN4a 8 PTMA EST 44 0.0 54.0 +45 SC3 8 PTMA C1 45 0.0 54.0 +46 SC3 8 PTMA C2 46 0.0 54.0 +47 SC3 8 PTMA C3 47 0.0 54.0 +48 TP5 8 PTMA N4 48 0.0 36.0 +49 SC3 9 PTMA VNL 49 0.0 54.0 +50 SN4a 9 PTMA EST 50 0.0 54.0 +51 SC3 9 PTMA C1 51 0.0 54.0 +52 SC3 9 PTMA C2 52 0.0 54.0 +53 SC3 9 PTMA C3 53 0.0 54.0 +54 TP5 9 PTMA N4 54 0.0 36.0 +55 SC3 10 PTMA VNL 55 0.0 54.0 +56 SN4a 10 PTMA EST 56 0.0 54.0 +57 SC3 10 PTMA C1 57 0.0 54.0 +58 SC3 10 PTMA C2 58 0.0 54.0 +59 SC3 10 PTMA C3 59 0.0 54.0 +60 TP5 10 PTMA N4 60 0.0 36.0 + +[ bonds ] + 1 2 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened + 2 3 1 0.253 15000 ; PMMA-TEMPO connection + 3 4 1 0.326 25000 ; cog (TEMPO) + 3 5 1 0.326 25000 ; cog (TEMPO) + 7 8 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened + 8 9 1 0.253 15000 ; PMMA-TEMPO connection + 9 10 1 0.326 25000 ; cog (TEMPO) + 9 11 1 0.326 25000 ; cog (TEMPO) +13 14 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +14 15 1 0.253 15000 ; PMMA-TEMPO connection +15 16 1 0.326 25000 ; cog (TEMPO) +15 17 1 0.326 25000 ; cog (TEMPO) +19 20 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +20 21 1 0.253 15000 ; PMMA-TEMPO connection +21 22 1 0.326 25000 ; cog (TEMPO) +21 23 1 0.326 25000 ; cog (TEMPO) +25 26 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +26 27 1 0.253 15000 ; PMMA-TEMPO connection +27 28 1 0.326 25000 ; cog (TEMPO) +27 29 1 0.326 25000 ; cog (TEMPO) +31 32 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +32 33 1 0.253 15000 ; PMMA-TEMPO connection +33 34 1 0.326 25000 ; cog (TEMPO) +33 35 1 0.326 25000 ; cog (TEMPO) +37 38 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +38 39 1 0.253 15000 ; PMMA-TEMPO connection +39 40 1 0.326 25000 ; cog (TEMPO) +39 41 1 0.326 25000 ; cog (TEMPO) +43 44 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +44 45 1 0.253 15000 ; PMMA-TEMPO connection +45 46 1 0.326 25000 ; cog (TEMPO) +45 47 1 0.326 25000 ; cog (TEMPO) +49 50 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +50 51 1 0.253 15000 ; PMMA-TEMPO connection +51 52 1 0.326 25000 ; cog (TEMPO) +51 53 1 0.326 25000 ; cog (TEMPO) +55 56 1 0.262 15000 ; M3 PMMA model [10.1038/s41467-021-27627-4] shortened +56 57 1 0.253 15000 ; PMMA-TEMPO connection +57 58 1 0.326 25000 ; cog (TEMPO) +57 59 1 0.326 25000 ; cog (TEMPO) + +; vinyl backbone + 1 7 1 0.315 4000 + 7 13 1 0.315 4000 +13 19 1 0.315 4000 +19 25 1 0.315 4000 +25 31 1 0.315 4000 +31 37 1 0.315 4000 +37 43 1 0.315 4000 +43 49 1 0.315 4000 +49 55 1 0.315 4000 + +#ifdef FLEXIBLE + 3 6 1 0.310 100000 ; cog (TEMPO) + 4 6 1 0.238 100000 ; cog (TEMPO) + 5 6 1 0.238 100000 ; cog (TEMPO) + 9 12 1 0.310 100000 ; cog (TEMPO) +10 12 1 0.238 100000 ; cog (TEMPO) +11 12 1 0.238 100000 ; cog (TEMPO) +15 18 1 0.310 100000 ; cog (TEMPO) +16 18 1 0.238 100000 ; cog (TEMPO) +17 18 1 0.238 100000 ; cog (TEMPO) +21 24 1 0.310 100000 ; cog (TEMPO) +22 24 1 0.238 100000 ; cog (TEMPO) +23 24 1 0.238 100000 ; cog (TEMPO) +27 30 1 0.310 100000 ; cog (TEMPO) +28 30 1 0.238 100000 ; cog (TEMPO) +29 30 1 0.238 100000 ; cog (TEMPO) +33 36 1 0.310 100000 ; cog (TEMPO) +34 36 1 0.238 100000 ; cog (TEMPO) +35 36 1 0.238 100000 ; cog (TEMPO) +39 42 1 0.310 100000 ; cog (TEMPO) +40 42 1 0.238 100000 ; cog (TEMPO) +41 42 1 0.238 100000 ; cog (TEMPO) +45 48 1 0.310 100000 ; cog (TEMPO) +46 48 1 0.238 100000 ; cog (TEMPO) +47 48 1 0.238 100000 ; cog (TEMPO) +51 54 1 0.310 100000 ; cog (TEMPO) +52 54 1 0.238 100000 ; cog (TEMPO) +53 54 1 0.238 100000 ; cog (TEMPO) +57 60 1 0.310 100000 ; cog (TEMPO) +58 60 1 0.238 100000 ; cog (TEMPO) +59 60 1 0.238 100000 ; cog (TEMPO) +#endif + +[ constraints ] +#ifndef FLEXIBLE + 3 6 1 0.310 ; cog (TEMPO) + 4 6 1 0.238 ; cog (TEMPO) + 5 6 1 0.238 ; cog (TEMPO) + 9 12 1 0.310 ; cog (TEMPO) +10 12 1 0.238 ; cog (TEMPO) +11 12 1 0.238 ; cog (TEMPO) +15 18 1 0.310 ; cog (TEMPO) +16 18 1 0.238 ; cog (TEMPO) +17 18 1 0.238 ; cog (TEMPO) +21 24 1 0.310 ; cog (TEMPO) +22 24 1 0.238 ; cog (TEMPO) +23 24 1 0.238 ; cog (TEMPO) +27 30 1 0.310 ; cog (TEMPO) +28 30 1 0.238 ; cog (TEMPO) +29 30 1 0.238 ; cog (TEMPO) +33 36 1 0.310 ; cog (TEMPO) +34 36 1 0.238 ; cog (TEMPO) +35 36 1 0.238 ; cog (TEMPO) +39 42 1 0.310 ; cog (TEMPO) +40 42 1 0.238 ; cog (TEMPO) +41 42 1 0.238 ; cog (TEMPO) +45 48 1 0.310 ; cog (TEMPO) +46 48 1 0.238 ; cog (TEMPO) +47 48 1 0.238 ; cog (TEMPO) +51 54 1 0.310 ; cog (TEMPO) +52 54 1 0.238 ; cog (TEMPO) +53 54 1 0.238 ; cog (TEMPO) +57 60 1 0.310 ; cog (TEMPO) +58 60 1 0.238 ; cog (TEMPO) +59 60 1 0.238 ; cog (TEMPO) +#endif + +[ angles ] + 1 2 3 2 132.9 70 ; PMMA-TEMPO connection + 2 3 4 2 129.0 60 ; PMMA-TEMPO connection + 2 3 5 2 121.9 95 ; PMMA-TEMPO connection + 7 8 9 2 132.9 70 ; PMMA-TEMPO connection + 8 9 10 2 129.0 60 ; PMMA-TEMPO connection + 8 9 11 2 121.9 95 ; PMMA-TEMPO connection +13 14 15 2 132.9 70 ; PMMA-TEMPO connection +14 15 16 2 129.0 60 ; PMMA-TEMPO connection +14 15 17 2 121.9 95 ; PMMA-TEMPO connection +19 20 21 2 132.9 70 ; PMMA-TEMPO connection +20 21 22 2 129.0 60 ; PMMA-TEMPO connection +20 21 23 2 121.9 95 ; PMMA-TEMPO connection +25 26 27 2 132.9 70 ; PMMA-TEMPO connection +26 27 28 2 129.0 60 ; PMMA-TEMPO connection +26 27 29 2 121.9 95 ; PMMA-TEMPO connection +31 32 33 2 132.9 70 ; PMMA-TEMPO connection +32 33 34 2 129.0 60 ; PMMA-TEMPO connection +32 33 35 2 121.9 95 ; PMMA-TEMPO connection +37 38 39 2 132.9 70 ; PMMA-TEMPO connection +38 39 40 2 129.0 60 ; PMMA-TEMPO connection +38 39 41 2 121.9 95 ; PMMA-TEMPO connection +43 44 45 2 132.9 70 ; PMMA-TEMPO connection +44 45 46 2 129.0 60 ; PMMA-TEMPO connection +44 45 47 2 121.9 95 ; PMMA-TEMPO connection +49 50 51 2 132.9 70 ; PMMA-TEMPO connection +50 51 52 2 129.0 60 ; PMMA-TEMPO connection +50 51 53 2 121.9 95 ; PMMA-TEMPO connection +55 56 57 2 132.9 70 ; PMMA-TEMPO connection +56 57 58 2 129.0 60 ; PMMA-TEMPO connection +56 57 59 2 121.9 95 ; PMMA-TEMPO connection + 2 1 7 2 70 20 + 8 7 13 2 70 20 +14 13 19 2 70 20 +20 19 25 2 70 20 +26 25 31 2 70 20 +32 31 37 2 70 20 +38 37 43 2 70 20 +44 43 49 2 70 20 +50 49 55 2 70 20 + +; vinyl backbone + 1 7 13 2 115 35 + 7 13 19 2 115 35 +13 19 25 2 115 35 +19 25 31 2 115 35 +25 31 37 2 115 35 +31 37 43 2 115 35 +37 43 49 2 115 35 +43 49 55 2 115 35 + +[ dihedrals ] + 3 4 5 6 2 140.00 20 ; cog (TEMPO) + 2 4 5 6 2 150.00 80 ; PMMA-TEMPO connection + 9 10 11 12 2 140.00 20 ; cog (TEMPO) + 8 10 11 12 2 150.00 80 ; PMMA-TEMPO connection +15 16 17 18 2 140.00 20 ; cog (TEMPO) +14 16 17 18 2 150.00 80 ; PMMA-TEMPO connection +21 22 23 24 2 140.00 20 ; cog (TEMPO) +20 22 23 24 2 150.00 80 ; PMMA-TEMPO connection +27 28 29 30 2 140.00 20 ; cog (TEMPO) +26 28 29 30 2 150.00 80 ; PMMA-TEMPO connection +33 34 35 36 2 140.00 20 ; cog (TEMPO) +32 34 35 36 2 150.00 80 ; PMMA-TEMPO connection +39 40 41 42 2 140.00 20 ; cog (TEMPO) +38 40 41 42 2 150.00 80 ; PMMA-TEMPO connection +45 46 47 48 2 140.00 20 ; cog (TEMPO) +44 46 47 48 2 150.00 80 ; PMMA-TEMPO connection +51 52 53 54 2 140.00 20 ; cog (TEMPO) +50 52 53 54 2 150.00 80 ; PMMA-TEMPO connection +57 58 59 60 2 140.00 20 ; cog (TEMPO) +56 58 59 60 2 150.00 80 ; PMMA-TEMPO connection + diff --git a/polyply/tests/test_data/library_tests/martini3/PTMA/polyply/command b/polyply/tests/test_data/library_tests/martini3/PTMA/polyply/command new file mode 100644 index 00000000..a28e2f61 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PTMA/polyply/command @@ -0,0 +1 @@ +polyply gen_params -lib martini3 -seq PTMA:10 -o PTMA.itp -name PTMA From 1521af8699e3ce9ad145c1ff527a9342f9185ddc Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Thu, 13 Oct 2022 12:13:56 -0500 Subject: [PATCH 155/275] Add test for PTMA M3 model (part 2/2) --- polyply/tests/test_lib_files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/polyply/tests/test_lib_files.py b/polyply/tests/test_lib_files.py index 56b5ec5f..0a387b92 100644 --- a/polyply/tests/test_lib_files.py +++ b/polyply/tests/test_lib_files.py @@ -185,6 +185,7 @@ def _interaction_equal(interaction1, interaction2, inter_type): ['martini3', 'DEX'], ['martini3', 'P3HT'], ['martini3', 'PPE'], + ['martini3', 'PTMA'], ['martini2', 'PEO'], ['martini2', 'PS'], ['martini2', 'PEL'], From 745c30e1937ef8991e0769b9ead6849966c8a35e Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Wed, 19 Oct 2022 09:50:21 -0500 Subject: [PATCH 156/275] Add draft of library table (summarizing available models) --- LIBRARY.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 LIBRARY.md diff --git a/LIBRARY.md b/LIBRARY.md new file mode 100644 index 00000000..e12846e2 --- /dev/null +++ b/LIBRARY.md @@ -0,0 +1,7 @@ + +| polymer | All-Atom | Coarse-Grained | +|---------|-------------------------------------------------------------------------|------------------------------------------------------| +| PEO | [gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) | [Martini 2](polyply/data/martini2/PEO.martini.2.itp) | +| | [oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) | [Martini 3](polyply/data/martini2/PEO.martini3.ff) | +| P3HT | [gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) | [Martini 2](polyply/data/martini2/P3HT.martini.2.itp)| +| | | [Martini 3](polyply/data/martini2/P3HT.martini3.ff) | From 8b77f5519d5f1cfabfca5d56cca2945ce3d6a0db Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Wed, 19 Oct 2022 12:10:08 -0500 Subject: [PATCH 157/275] Add column with full polymer name to LIBRARY table --- LIBRARY.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/LIBRARY.md b/LIBRARY.md index e12846e2..995c7e79 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -1,7 +1,7 @@ -| polymer | All-Atom | Coarse-Grained | -|---------|-------------------------------------------------------------------------|------------------------------------------------------| -| PEO | [gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) | [Martini 2](polyply/data/martini2/PEO.martini.2.itp) | -| | [oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) | [Martini 3](polyply/data/martini2/PEO.martini3.ff) | -| P3HT | [gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) | [Martini 2](polyply/data/martini2/P3HT.martini.2.itp)| -| | | [Martini 3](polyply/data/martini2/P3HT.martini3.ff) | +| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) | +|------------------------|--------------|-------------------------------------------------------------------------|------------------------------------------------------| +| Polyethylene oxide | PEO | [gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) | [Martini 2](polyply/data/martini2/PEO.martini.2.itp) | +| | | [oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) | [Martini 3](polyply/data/martini2/PEO.martini3.ff) | +| Poly(3-hexylthiophene) | P3HT | [gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) | [Martini 2](polyply/data/martini2/P3HT.martini.2.itp)| +| | | | [Martini 3](polyply/data/martini2/P3HT.martini3.ff) | From ddd70573b0a1e6e08d6510fa2dd820be67f5e7ad Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Thu, 20 Oct 2022 09:18:10 -0500 Subject: [PATCH 158/275] All the models as in Supp. Table 1 of the NatCommun polyply paper --- LIBRARY.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/LIBRARY.md b/LIBRARY.md index 995c7e79..716cf442 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -1,7 +1,17 @@ -| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) | -|------------------------|--------------|-------------------------------------------------------------------------|------------------------------------------------------| -| Polyethylene oxide | PEO | [gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) | [Martini 2](polyply/data/martini2/PEO.martini.2.itp) | -| | | [oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) | [Martini 3](polyply/data/martini2/PEO.martini3.ff) | -| Poly(3-hexylthiophene) | P3HT | [gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) | [Martini 2](polyply/data/martini2/P3HT.martini.2.itp)| -| | | | [Martini 3](polyply/data/martini2/P3HT.martini3.ff) | +| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) | +|------------------------|-----------------------------|-------------------------------------------------------------------------|------------------------------------------------------| +| Polyethylene oxide | PEO | [gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) | [martini2](polyply/data/martini2/PEO.martini.2.itp) | +| | | [oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) | [martini3](polyply/data/martini3/PEO.martini3.ff) | +| Polystyrene | PS | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini2](polyply/data/martini2/PS.martini.2.itp) | +| | | | [martini3](polyply/data/martini3/PS.martini3.ff) | +| Polymethyl acrylate | PMA | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PMA.martini3.ff) | +| Polymethyl methacrylate| PMMA | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PMMA.martini3.ff) | +| Polyethylene | PE | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PE.martini3.ff) | +| Poly(3-hexylthiophene) | P3HT | [gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) | [martini2](polyply/data/martini2/P3HT.martini.2.itp) | +| | | | [martini3](polyply/data/martini3/P3HT.martini3.ff) | +| Polyvinyl alcohol | PVA | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PVA.martini3.ff) | +| Dextran | DEX | | [martini3](polyply/data/martini3/dextran.martini3.ff)| +| DNA nucleobases | Dx, Tx5, Dx3 with x=T,G,A,C | [parmbsc1](polyply/data/parmbsc1/dna_final.ff) | | +| Aminoacids | 3 letter code | | [martini3](polyply/data/martini3/aminoacids.ff) | + From 14e3da16ed42f9c653ce8503743605a7b1d4c1ce Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Thu, 20 Oct 2022 09:20:03 -0500 Subject: [PATCH 159/275] Add link to LIBRARY.md in main README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f379319f..92dd96d4 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ force-field, molecule parameters and this program. ## Quick references [Installation Guide](https://github.com/marrink-lab/polyply_1.0/wiki/Installation)\ [FAQs](https://github.com/marrink-lab/polyply_1.0/wiki/FAQs)\ +[Current Polyply Polymer Library](./LIBRARY.md)\ [Submissions to Martini Polymer Library](https://github.com/marrink-lab/polyply_1.0/wiki/Submit-polymer-parameters)\ [Tutorial: Martini Polymers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-martini-polymer-melts)\ [Tutorial: GROMOS Polymers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-GROMOS-polymer-melts)\ From 3d117661e40f403a596c488c1acf0ef4e5218118 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 21 Oct 2022 13:46:32 +0200 Subject: [PATCH 160/275] add extension check for user provided files --- polyply/src/gen_coords.py | 10 ++++++---- polyply/src/gen_itp.py | 4 +++- polyply/src/load_library.py | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index 1b5ef25d..efd8da12 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -26,7 +26,7 @@ from .topology import Topology from .build_system import BuildSystem from .annotate_ligands import AnnotateLigands, parse_residue_spec, _find_nodes -from .load_library import load_build_options +from .load_library import load_build_options, check_extensions_bld from .check_residue_equivalence import check_residue_equivalence LOGGER = StyleAdapter(get_logger(__name__)) @@ -98,7 +98,7 @@ def gen_coords(toppath, name, coordpath=None, coordpath_meta=None, - build=None, + build=[], build_res=[], ignore=[], cycles=[], @@ -224,9 +224,11 @@ def gen_coords(toppath, "residues. Polyply will built the missing residues.") LOGGER.warning(msg) - # load in built file + # load in build file LOGGER.info("reading build options", type="step") - load_build_options(topology, build, lib) + if build: + check_extensions_bld(build) + load_build_options(topology, lib, build) # collect all starting points for the molecules start_dict = find_starting_node_from_spec(topology, start) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 62605e24..79d7098e 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -31,7 +31,7 @@ from vermouth.graph_utils import make_residue_graph from polyply import (MetaMolecule, ApplyLinks, Monomer, MapToMolecule) from polyply.src.graph_utils import find_missing_edges -from .load_library import load_ff_library +from .load_library import load_ff_library, check_extensions_ff, check_extensions_ff LOGGER = StyleAdapter(get_logger(__name__)) @@ -82,6 +82,8 @@ def gen_params(name, outpath, inpath=None, lib=None, seq=None, seq_file=None): """ # Import of Itp and FF files LOGGER.info("reading input and library files", type="step") + if inpath: + check_extensions_ff(inpath) force_field = load_ff_library(name, lib, inpath) # Generate the MetaMolecule diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 18d6331e..5135aecb 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -28,6 +28,38 @@ FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib} +def check_extensions_bld(bld_files): + """ + check the extensions of the + user provided build files + + Parameters + ---------- + bld_files: list[`pathlib.PosixPath`] + list of build files + """ + for _file in bld_files: + file_extension = _file.suffix[1:] + if file_extension != 'bld': + msg = "Cannot parse build file with extension {}".format(file_extension) + raise IOError(msg) + +def check_extensions_ff(ff_files): + """ + check the extensions of the + user provided forcefield files + + Parameters + ---------- + ff_files: list[`pathlib.PosixPath`] + list of forcefield files + """ + for _file in ff_files: + file_extension = _file.suffix[1:] + if file_extension not in FORCE_FIELD_PARSERS: + msg = "Cannot parse forcefield file with extension {}".format(file_extension) + raise IOError(msg) + def _resolve_lib_paths(lib_names, data_path, allowed_extensions): """ select the appropiate files from data_path @@ -139,7 +171,7 @@ def read_build_options_from_files(paths, topology): read_build_file(lines, topology.molecules, topology) -def load_build_options(topology, build_file, lib_names): +def load_build_options(topology, lib_names, build_file): """ Load build file options and molecule templates into topology. From 1dbfede85b727c0c246f7e7452711b8abf7bbb74 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 21 Oct 2022 15:15:15 +0200 Subject: [PATCH 161/275] Partially working tests --- polyply/tests/test_data/struc_build/PEO.bld | 6 ++++ polyply/tests/test_load_library.py | 39 ++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 polyply/tests/test_data/struc_build/PEO.bld diff --git a/polyply/tests/test_data/struc_build/PEO.bld b/polyply/tests/test_data/struc_build/PEO.bld new file mode 100644 index 00000000..dfa96bf3 --- /dev/null +++ b/polyply/tests/test_data/struc_build/PEO.bld @@ -0,0 +1,6 @@ +[ template ] +resname PEO +[ atoms ] +COC EO 1.0 1.0 1.0 +[ volumes ] +PEO 1 diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index e61b4517..59b614a9 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -17,15 +17,38 @@ import textwrap import pytest +from contextlib import nullcontext as does_not_raise +from pathlib import Path import numpy as np +import os import math import networkx as nx import vermouth import polyply from polyply import TEST_DATA +from polyply.src.topology import Topology +from polyply.src.load_library import FORCE_FIELD_PARSERS from polyply.src.load_library import _resolve_lib_paths from polyply.src.load_library import read_ff_from_files -from polyply.src.load_library import FORCE_FIELD_PARSERS +from polyply.src.load_library import load_build_options +from polyply.src.load_library import check_extensions_ff +from polyply.src.load_library import check_extensions_bld + +@pytest.mark.parametrize("ff_file, expectation", [ + [[Path('forcefield.ff')], does_not_raise()], + [[Path('forcefield.bld')], pytest.raises(IOError)], +]) +def test_check_extensions_ff(ff_file, expectation): + with expectation as e: + check_extensions_ff(ff_file) + +@pytest.mark.parametrize("bld_file, expectation", [ + [[Path('forcefield.ff')], pytest.raises(IOError)], + [[Path('forcefield.bld')], does_not_raise()], +]) +def test_check_extensions_bld(bld_file, expectation): + with expectation as e: + check_extensions_bld(bld_file) def test_read_ff_from_files(): name = "ff" @@ -37,3 +60,17 @@ def test_read_ff_from_files(): assert force_field.blocks assert force_field.links +def test_read_build_options_from_files(): + + topfile = 'struc_build/system.top' + bldfile = 'struc_build/PEO.bld' + lib_names = ['martini2'] + toppath = os.path.join(TEST_DATA, topfile) + topology = Topology.from_gmx_topfile(name='test', path=toppath) + bldpath = os.path.join(TEST_DATA, bldfile) + load_build_options(topology, lib_names, bldpath) + + # check if build files are parsed + molecule = topology.molecules[0] + assert molecule.templates + assert molecule.volume From cf2342689a13e4ac0c7c7189e5e766c812792ac8 Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Fri, 21 Oct 2022 10:06:34 -0500 Subject: [PATCH 162/275] Add all the M2 models to the LIBRARY.md file --- LIBRARY.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/LIBRARY.md b/LIBRARY.md index 716cf442..5b1dac62 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -1,17 +1,21 @@ -| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) | -|------------------------|-----------------------------|-------------------------------------------------------------------------|------------------------------------------------------| -| Polyethylene oxide | PEO | [gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) | [martini2](polyply/data/martini2/PEO.martini.2.itp) | -| | | [oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) | [martini3](polyply/data/martini3/PEO.martini3.ff) | -| Polystyrene | PS | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini2](polyply/data/martini2/PS.martini.2.itp) | -| | | | [martini3](polyply/data/martini3/PS.martini3.ff) | -| Polymethyl acrylate | PMA | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PMA.martini3.ff) | -| Polymethyl methacrylate| PMMA | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PMMA.martini3.ff) | -| Polyethylene | PE | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PE.martini3.ff) | -| Poly(3-hexylthiophene) | P3HT | [gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) | [martini2](polyply/data/martini2/P3HT.martini.2.itp) | -| | | | [martini3](polyply/data/martini3/P3HT.martini3.ff) | -| Polyvinyl alcohol | PVA | [gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | [martini3](polyply/data/martini3/PVA.martini3.ff) | -| Dextran | DEX | | [martini3](polyply/data/martini3/dextran.martini3.ff)| -| DNA nucleobases | Dx, Tx5, Dx3 with x=T,G,A,C | [parmbsc1](polyply/data/parmbsc1/dna_final.ff) | | -| Aminoacids | 3 letter code | | [martini3](polyply/data/martini3/aminoacids.ff) | +| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) | +|-----------------------------|--------------------------|------------------------------------------------------------------------|------------------------------------------------------| +|Polyethylene oxide |PEO |[gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) |[martini2](polyply/data/martini2/PEO.martini.2.itp) | +| | |[oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) |[martini3](polyply/data/martini3/PEO.martini3.ff) | +|Polystyrene |PS |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini2](polyply/data/martini2/PS.martini.2.itp) | +| | | |[martini3](polyply/data/martini3/PS.martini3.ff) | +|Polymethyl acrylate |PMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMA.martini3.ff) | +|Polymethyl methacrylate |PMMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMMA.martini3.ff) | +|Polyethylene |PE |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PE.martini3.ff) | +| | | |[martini2](polyply/data/martini2/PE.martini.2.itp) | +|Polypropylene |PP | |[martini2](polyply/data/martini2/PP.martini.2.itp) | +|Poly(3-hexylthiophene) |P3HT |[gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) |[martini2](polyply/data/martini2/P3HT.martini.2.itp) | +| | | |[martini3](polyply/data/martini3/P3HT.martini3.ff) | +|Polyvinyl alcohol |PVA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PVA.martini3.ff) | +|Poly(diallyldimethylammonium)|PDADMA | |[martini2](polyply/data/martini2/PDADMA.martini.2.itp)| +|Polystyrene sulfonate |PSS | |[martini2](polyply/data/martini2/PSS.martini.2.itp) | +|Dextran |DEX | |[martini3](polyply/data/martini3/dextran.martini3.ff) | +|DNA nucleobases |Dx, Tx5, Dx3 w/ x=T,G,A,C |[parmbsc1](polyply/data/parmbsc1/dna_final.ff) |[martini2](polyply/data/martini2/DNA_M2.ff) | +|Aminoacids |3 letter code | |[martini3](polyply/data/martini3/aminoacids.ff) | From 39cf33aa2229a664b171efff16b3053f36373582 Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Fri, 21 Oct 2022 10:29:42 -0500 Subject: [PATCH 163/275] Add all the M3 models to LIBRARY.md --- LIBRARY.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/LIBRARY.md b/LIBRARY.md index 5b1dac62..d8549e98 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -1,21 +1,25 @@ -| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) | -|-----------------------------|--------------------------|------------------------------------------------------------------------|------------------------------------------------------| -|Polyethylene oxide |PEO |[gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) |[martini2](polyply/data/martini2/PEO.martini.2.itp) | -| | |[oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff) |[martini3](polyply/data/martini3/PEO.martini3.ff) | -|Polystyrene |PS |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini2](polyply/data/martini2/PS.martini.2.itp) | -| | | |[martini3](polyply/data/martini3/PS.martini3.ff) | -|Polymethyl acrylate |PMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMA.martini3.ff) | -|Polymethyl methacrylate |PMMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMMA.martini3.ff) | -|Polyethylene |PE |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PE.martini3.ff) | -| | | |[martini2](polyply/data/martini2/PE.martini.2.itp) | -|Polypropylene |PP | |[martini2](polyply/data/martini2/PP.martini.2.itp) | -|Poly(3-hexylthiophene) |P3HT |[gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) |[martini2](polyply/data/martini2/P3HT.martini.2.itp) | -| | | |[martini3](polyply/data/martini3/P3HT.martini3.ff) | -|Polyvinyl alcohol |PVA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PVA.martini3.ff) | -|Poly(diallyldimethylammonium)|PDADMA | |[martini2](polyply/data/martini2/PDADMA.martini.2.itp)| -|Polystyrene sulfonate |PSS | |[martini2](polyply/data/martini2/PSS.martini.2.itp) | -|Dextran |DEX | |[martini3](polyply/data/martini3/dextran.martini3.ff) | -|DNA nucleobases |Dx, Tx5, Dx3 w/ x=T,G,A,C |[parmbsc1](polyply/data/parmbsc1/dna_final.ff) |[martini2](polyply/data/martini2/DNA_M2.ff) | -|Aminoacids |3 letter code | |[martini3](polyply/data/martini3/aminoacids.ff) | +| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) | +|-------------------------------|-------------------------|-----------------------------------------------------------------------|------------------------------------------------------| +|Polyethylene oxide |PEO |[gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) |[martini2](polyply/data/martini2/PEO.martini.2.itp) | +| | |[oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff)|[martini3](polyply/data/martini3/PEO.martini3.ff) | +|Polystyrene |PS |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini2](polyply/data/martini2/PS.martini.2.itp) | +| | | |[martini3](polyply/data/martini3/PS.martini3.ff) | +|Polystyrene-b-poly(ethylene oxide)|PS-PEO | |[martini3](polyply/data/martini3/PS_PEO_link.ff) | +|Polymethyl acrylate |PMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMA.martini3.ff) | +|Polymethyl methacrylate |PMMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMMA.martini3.ff) | +|Polyethylene |PE |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PE.martini3.ff) | +| | | |[martini2](polyply/data/martini2/PE.martini.2.itp) | +|Polypropylene |PP | |[martini2](polyply/data/martini2/PP.martini.2.itp) | +|Poly(3-hexylthiophene) |P3HT |[gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) |[martini2](polyply/data/martini2/P3HT.martini.2.itp) | +| | | |[martini3](polyply/data/martini3/P3HT.martini3.ff) | +|Polyvinyl alcohol |PVA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PVA.martini3.ff) | +|Poly(diallyldimethylammonium) |PDADMA | |[martini2](polyply/data/martini2/PDADMA.martini.2.itp)| +|Polystyrene sulfonate |PSS | |[martini2](polyply/data/martini2/PSS.martini.2.itp) | +| | | |[martini3](polyply/data/martini3/PSS.martini3.ff) | +|Poly(para-phenylene ethynylene)|PPE | |[martini3](polyply/data/martini3/PPE.martini3.ff) | +|Poly(TEMPO methacrylate) |PTMA | |[martini3](polyply/data/martini3/PPE.martini3.ff) | +|Dextran |DEX | |[martini3](polyply/data/martini3/PTMA.martini3.ff) | +|DNA nucleobases |Dx, Tx5, Dx3 w/ x=T,G,A,C|[parmbsc1](polyply/data/parmbsc1/dna_final.ff) |[martini2](polyply/data/martini2/DNA_M2.ff) | +|Aminoacids |3 letter code | |[martini3](polyply/data/martini3/aminoacids.ff) | From 0b8c629a0999d50838387d9d20cd65bccd58d6ef Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Fri, 21 Oct 2022 10:31:55 -0500 Subject: [PATCH 164/275] Add more 2016H66 to LIBRARY.md --- LIBRARY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LIBRARY.md b/LIBRARY.md index d8549e98..83cda4a6 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -10,7 +10,7 @@ |Polymethyl methacrylate |PMMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMMA.martini3.ff) | |Polyethylene |PE |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PE.martini3.ff) | | | | |[martini2](polyply/data/martini2/PE.martini.2.itp) | -|Polypropylene |PP | |[martini2](polyply/data/martini2/PP.martini.2.itp) | +|Polypropylene |PP |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini2](polyply/data/martini2/PP.martini.2.itp) | |Poly(3-hexylthiophene) |P3HT |[gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) |[martini2](polyply/data/martini2/P3HT.martini.2.itp) | | | | |[martini3](polyply/data/martini3/P3HT.martini3.ff) | |Polyvinyl alcohol |PVA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PVA.martini3.ff) | From 538baf3c74612fda99c6d61589acecd0289cea88 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 21 Oct 2022 19:43:21 +0200 Subject: [PATCH 165/275] (finally) Working tests --- .../tests/test_data/topology_test/test.bld | 22 +++++++++++++++++++ polyply/tests/test_load_library.py | 9 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 polyply/tests/test_data/topology_test/test.bld diff --git a/polyply/tests/test_data/topology_test/test.bld b/polyply/tests/test_data/topology_test/test.bld new file mode 100644 index 00000000..120a3b70 --- /dev/null +++ b/polyply/tests/test_data/topology_test/test.bld @@ -0,0 +1,22 @@ +[ template ] +resname PMMA + +[ atoms ] +C1 CH2 1 1 1 +C2 C 2 2 2 +C3 CH3 3 3 3 +C4 C 4 4 4 +O1 O 5 5 5 +O2 OE 5 5 5 +C5 CH3 6 6 6 + +[ bonds ] +C1 C2 +C2 C3 +C2 C4 +C4 O1 +C4 O2 +O2 C5 + +[ volumes ] +PMMA 1 diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index 59b614a9..fef80a8d 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -62,15 +62,16 @@ def test_read_ff_from_files(): def test_read_build_options_from_files(): - topfile = 'struc_build/system.top' - bldfile = 'struc_build/PEO.bld' - lib_names = ['martini2'] + topfile = 'topology_test/system.top' + bldfile = 'topology_test/test.bld' + lib_names = ['2016H66'] toppath = os.path.join(TEST_DATA, topfile) topology = Topology.from_gmx_topfile(name='test', path=toppath) + topology.preprocess() bldpath = os.path.join(TEST_DATA, bldfile) load_build_options(topology, lib_names, bldpath) # check if build files are parsed + assert topology.volumes == {'PMMA': 1.0} molecule = topology.molecules[0] assert molecule.templates - assert molecule.volume From e73d83389062fb66bbbdea3b06098c2aea444912 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 21 Oct 2022 19:55:05 +0200 Subject: [PATCH 166/275] add support for older python versions --- polyply/tests/test_load_library.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index fef80a8d..37d528df 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -17,11 +17,11 @@ import textwrap import pytest -from contextlib import nullcontext as does_not_raise from pathlib import Path import numpy as np import os import math +from contextlib import contextmanager import networkx as nx import vermouth import polyply @@ -34,8 +34,13 @@ from polyply.src.load_library import check_extensions_ff from polyply.src.load_library import check_extensions_bld + +@contextmanager +def nullcontext(enter_result=None): + yield enter_result + @pytest.mark.parametrize("ff_file, expectation", [ - [[Path('forcefield.ff')], does_not_raise()], + [[Path('forcefield.ff')], nullcontext()], [[Path('forcefield.bld')], pytest.raises(IOError)], ]) def test_check_extensions_ff(ff_file, expectation): @@ -44,7 +49,7 @@ def test_check_extensions_ff(ff_file, expectation): @pytest.mark.parametrize("bld_file, expectation", [ [[Path('forcefield.ff')], pytest.raises(IOError)], - [[Path('forcefield.bld')], does_not_raise()], + [[Path('forcefield.bld')], nullcontext()], ]) def test_check_extensions_bld(bld_file, expectation): with expectation as e: From 48146c766897fe9a3f0498b12c69af70a4b11980 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 21 Oct 2022 19:59:11 +0200 Subject: [PATCH 167/275] fix indentation --- polyply/src/load_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 5135aecb..1c718b01 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -168,7 +168,7 @@ def read_build_options_from_files(paths, topology): for path in paths: with open(path, 'r') as file_: lines = file_.readlines() - read_build_file(lines, topology.molecules, topology) + read_build_file(lines, topology.molecules, topology) def load_build_options(topology, lib_names, build_file): From e2872e37f968e7e41a21862637d95e0819706cb3 Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Mon, 24 Oct 2022 08:35:32 -0500 Subject: [PATCH 168/275] Add HEA, PAM, PMAM (gromos2016H66) to LIBRARY.md; done --- LIBRARY.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LIBRARY.md b/LIBRARY.md index 83cda4a6..b70379e8 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -14,6 +14,9 @@ |Poly(3-hexylthiophene) |P3HT |[gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) |[martini2](polyply/data/martini2/P3HT.martini.2.itp) | | | | |[martini3](polyply/data/martini3/P3HT.martini3.ff) | |Polyvinyl alcohol |PVA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PVA.martini3.ff) | +|Poly(2-hydroxyethyl acrylate) |HEA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | | +|Polyacrylamide |PAM |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | | +|Poly(methacrylamide) |PMAM |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | | |Poly(diallyldimethylammonium) |PDADMA | |[martini2](polyply/data/martini2/PDADMA.martini.2.itp)| |Polystyrene sulfonate |PSS | |[martini2](polyply/data/martini2/PSS.martini.2.itp) | | | | |[martini3](polyply/data/martini3/PSS.martini3.ff) | From 1dc6008a0ca13e5bd05452261e6ad1e824bfe9e9 Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Mon, 24 Oct 2022 11:13:22 -0500 Subject: [PATCH 169/275] Fix typo in LIBRARY.md (links to martini3 PTMA and dextran) --- LIBRARY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LIBRARY.md b/LIBRARY.md index b70379e8..925a0748 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -21,8 +21,8 @@ |Polystyrene sulfonate |PSS | |[martini2](polyply/data/martini2/PSS.martini.2.itp) | | | | |[martini3](polyply/data/martini3/PSS.martini3.ff) | |Poly(para-phenylene ethynylene)|PPE | |[martini3](polyply/data/martini3/PPE.martini3.ff) | -|Poly(TEMPO methacrylate) |PTMA | |[martini3](polyply/data/martini3/PPE.martini3.ff) | -|Dextran |DEX | |[martini3](polyply/data/martini3/PTMA.martini3.ff) | +|Poly(TEMPO methacrylate) |PTMA | |[martini3](polyply/data/martini3/PTMA.martini3.ff) | +|Dextran |DEX | |[martini3](polyply/data/martini3/dextran.martini3.ff) | |DNA nucleobases |Dx, Tx5, Dx3 w/ x=T,G,A,C|[parmbsc1](polyply/data/parmbsc1/dna_final.ff) |[martini2](polyply/data/martini2/DNA_M2.ff) | |Aminoacids |3 letter code | |[martini3](polyply/data/martini3/aminoacids.ff) | From aec938ed2ecd54b1d90fbe2a3312b3f978c130c0 Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Tue, 25 Oct 2022 12:44:26 +0200 Subject: [PATCH 170/275] proper expansion of diehdral types from topology --- polyply/src/topology.py | 62 +++++++++++++++++++++++++++------- polyply/tests/test_topology.py | 46 ++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 14 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 6101d3d7..7ba72628 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -25,6 +25,7 @@ from vermouth.forcefield import ForceField from vermouth.gmx.gro import read_gro from vermouth.pdb import read_pdb +from vermouth.molecule import Interaction from .top_parser import read_topology from .linalg_functions import center_of_geometry @@ -221,7 +222,7 @@ def __init__(self, force_field, name=None): self.defines = {} self.description = [] self.atom_types = {} - self.types = defaultdict(dict) + self.types = defaultdict(lambda: defaultdict(list)) self.nonbond_params = {} self.mol_idx_by_name = defaultdict(list) self.persistences = [] @@ -288,19 +289,38 @@ def gen_pairs(self): def gen_bonded_interactions(self): """ - Check for each interaction if there is - no parameter for an interaction if that - parameter is defined in the bonded directive - of the topology. + Check for each interaction, if the parameter list is empty. If it is + check if the parameters are defined in the bonded types directive + of the topology. This essentially does part of the step done by + grompp. + + Updates + ------- + self.molecules.interactions + self.blocks.interactions + + Raises + ------ + OSError + no match for an interaction in the bonded types provided """ - for block in self.force_field.blocks.values(): + # We loop over blocks not molecules, because there is only + # one unique block per molecule, whereas there cab be a large number of + # duplicate molecules in the topology.molecules list. As the interactions + # in those molecules are still references to the blocks updating them here + # will propagate into the molecules. This works except for one case where + # a single dihedral directive is expanded into multiple ones. Updating the + # block dict will not propagate into the molecules. + for mol_name, block in self.force_field.blocks.items(): + additional_interactions = defaultdict(list) for inter_type, interactions in block.interactions.items(): + # these interactions have no types associated if inter_type in ["pairs", "exclusions", "virtual_sitesn", "virtual_sites2", "virtual_sites3", "virtual_sites4"]: continue + for interaction in interactions: if len(interaction.parameters) == 1: - # Some force-fields - in GMX library only OPLS - use bond-type # definitions. Each atomtype matches one bond-type, which # in turn matches an expression in the bondedtypes section @@ -312,14 +332,17 @@ def gen_bonded_interactions(self): else: atoms = tuple(block.nodes[node]["atype"] for node in interaction.atoms) + # now we match the atom or bondtypes to the types defined in the topology if atoms in self.types[inter_type]: - new_params, meta = self.types[inter_type][atoms] + new_params = self.types[inter_type][atoms] elif atoms[::-1] in self.types[inter_type]: - new_params, meta = self.types[inter_type][atoms[::-1]] + new_params = self.types[inter_type][atoms[::-1]] + # dihedrals are more complicated because they are treated as symmetric and + # can have wild-cards elif inter_type in "dihedrals": match = match_dihedral_interaction_types(atoms, self.types[inter_type]) if match: - new_params, meta = self.types[inter_type][match] + new_params = self.types[inter_type][match] else: msg = ("In section dihedrals interaction of atoms {} has no " "corresponding bonded type.") @@ -332,9 +355,22 @@ def gen_bonded_interactions(self): atoms = " ".join(list(map(lambda x: str(x), interaction.atoms))) raise OSError(msg.format(inter_type, atoms)) - interaction.parameters[:] = new_params[:] - if meta: - interaction.meta.update(meta) + for idx, (new_param, meta) in enumerate(new_params): + if not meta: + meta = {} + if idx > 0: + new_interaction = Interaction(atoms=tuple(interaction.atoms), + parameters=new_param, + meta=meta) + additional_interactions[inter_type].append(new_interaction) + else: + interaction.parameters[:] = new_param[:] + interaction.meta.update(meta) + + # here we add the expanded interactions into the molecules + for mol_idx in self.mol_idx_by_name[mol_name]: + for inter_type, new_inters in additional_interactions.items(): + self.molecules[mol_idx].molecule.interactions[inter_type] += new_inters def convert_nonbond_to_sig_eps(self): """ diff --git a/polyply/tests/test_topology.py b/polyply/tests/test_topology.py index 92b7810b..6c0b0945 100644 --- a/polyply/tests/test_topology.py +++ b/polyply/tests/test_topology.py @@ -617,6 +617,49 @@ def test_convert_nonbond_to_sig_eps(): "virtual_sites2": [Interaction(atoms=(3, 0, 8), parameters=["1", "0.5000"], meta={})], "virtual_sites3": [Interaction(atoms=(4, 3, 7, 0), parameters=["1", "0.200", "0.200"], meta={}), Interaction(atoms=(5, 3, 8, 1), parameters=["1", "0.200", "0.200"], meta={})]} + ), + # test multiple dihedrals are assigned + ( + """ + [ defaults ] + 1.0 1.0 yes 2.0 1.0 + [ atomtypes ] + CTL2 6 12.0110 -0.100 A 3.58141284692e-01 2.343040e-01 + CEL1 6 12.0110 -0.150 A 3.72395664183e-01 2.845120e-01 + [ bondtypes ] + CEL1 CEL1 1 1.340000e-01 3.681920e+05 + CEL1 CTL2 1 1.502000e-01 3.054320e+05 + CTL2 CTL2 1 1.538000e-01 1.861880e+05 + [ dihedraltypes ] + CEL1 CEL1 CTL2 CTL2 9 1.800000e+02 3.807440e+00 1 + CEL1 CEL1 CTL2 CTL2 9 1.800000e+02 7.531200e-01 2 + CEL1 CEL1 CTL2 CTL2 9 1.800000e+02 7.112800e-01 3 + + [ moleculetype ] + test 3 + [ atoms ] + ; CEL1 CEL1 CTL2 CTL2 + 1 CEL1 1 POPC C12 2 0.000000 12.0110 ; qtot -0.700 + 2 CEL1 1 POPC C12 2 0.000000 12.0110 ; qtot -0.700 + 3 CTL2 1 POPC C12 2 0.000000 12.0110 ; qtot -0.700 + 4 CTL2 1 POPC C12 2 0.000000 12.0110 ; qtot -0.700 + [ bonds ] + 1 2 1 + 2 3 1 + 3 4 1 + [ dihedrals ] + 1 2 3 4 9 + [ system ] + some title + [ molecules ] + test 1 + """, + {"bonds": [Interaction(atoms=(0, 1), parameters=["1", "1.340000e-01", "3.681920e+05"], meta={}), + Interaction(atoms=(1, 2), parameters=["1", "1.502000e-01", "3.054320e+05"], meta={}), + Interaction(atoms=(2, 3), parameters=["1", "1.538000e-01", "1.861880e+05"], meta={}),], + "dihedrals": [Interaction(atoms=(0, 1, 2, 3), parameters=["9", "1.800000e+02", "3.807440e+00", "1"], meta={}), + Interaction(atoms=(0, 1, 2, 3), parameters=["9", "1.800000e+02", "7.531200e-01", "2"], meta={}), + Interaction(atoms=(0, 1, 2, 3), parameters=["9", "1.800000e+02", "7.112800e-01", "3"], meta={}),]} ) )) def test_replace_types(lines, outcome): @@ -627,7 +670,8 @@ def test_replace_types(lines, outcome): polyply.src.top_parser.read_topology(new_lines, top) top.gen_bonded_interactions() for inter_type in outcome: - assert top.molecules[0].molecule.interactions[inter_type] == outcome[inter_type] + for inter in top.molecules[0].molecule.interactions[inter_type]: + assert top.molecules[0].molecule.interactions[inter_type] == outcome[inter_type] @staticmethod def test_replace_types_fail(): From 6fa4956b064331617fce50a4c8f22f5375fec3af Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Tue, 25 Oct 2022 12:57:23 +0200 Subject: [PATCH 171/275] add test multiple dihedrals --- polyply/tests/test_top_parser.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/polyply/tests/test_top_parser.py b/polyply/tests/test_top_parser.py index 08dd4750..56d6e3b2 100644 --- a/polyply/tests/test_top_parser.py +++ b/polyply/tests/test_top_parser.py @@ -106,8 +106,20 @@ class TestTopParsing: OM O 1 1.9670816e-03 8.5679450e-07 """, "types", - {"bonds": {("OM", "O"): (["1", "1.9670816e-03", "8.5679450e-07"], None)}} + {"bonds": {("OM", "O"): [(["1", "1.9670816e-03", "8.5679450e-07"], None)]}} ), + (""" + [ dihedraltypes ] + CEL1 CEL1 CTL2 CTL2 9 1.800000e+02 3.807440e+00 1 + CEL1 CEL1 CTL2 CTL2 9 1.800000e+02 7.531200e-01 2 + CEL1 CEL1 CTL2 CTL2 9 1.800000e+02 7.112800e-01 3 + """, + "types", + {"dihedrals": {("CEL1", "CEL1", "CTL2", "CTL2"): [(["9", "1.800000e+02", "3.807440e+00", "1"], None), + (["9", "1.800000e+02", "7.531200e-01", "2"], None), + (["9", "1.800000e+02", "7.112800e-01", "3"], None)]}} + ), + (""" [ system ] some multiline From a7bf5997df5901c9a6a031cb311dbefc5ab78647 Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Tue, 25 Oct 2022 12:57:47 +0200 Subject: [PATCH 172/275] allow multiple type directives --- polyply/src/top_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/top_parser.py b/polyply/src/top_parser.py index e085ca3b..d95bf5e8 100644 --- a/polyply/src/top_parser.py +++ b/polyply/src/top_parser.py @@ -356,7 +356,7 @@ def _type_params(self, line, lineno=0): atoms, params = self._split_atoms_and_parameters(line.split(), self.atom_idxs[section_name]) - self.topology.types[inter_type][tuple(atoms)] = (params, self.current_meta) + self.topology.types[inter_type][tuple(atoms)].append((params, self.current_meta)) @SectionLineParser.section_parser('implicit_genborn_params') From 3b7a888c04c14dfbd71496ac829b3f0bdf3dd4b2 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Fri, 28 Oct 2022 13:04:42 +0200 Subject: [PATCH 173/275] make name and output file optional --- bin/polyply | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/polyply b/bin/polyply index 704eebed..121f47db 100755 --- a/bin/polyply +++ b/bin/polyply @@ -56,8 +56,8 @@ def main(): # pylint: disable=too-many-locals,too-many-statements # Input Arguments for the itp generation tool # ============================================================================= - parser_gen_itp.add_argument('-name', required=True, type=str, dest="name", - help="name of the final molecule") + parser_gen_itp.add_argument('-name', required=False, type=str, dest="name", + help="name of the final molecule", default='polymer') parser_gen_itp.add_argument('-v', dest='verbosity', action='count', help='Enable debug logging output. Can be given ' 'multiple times.', default=0) @@ -68,7 +68,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements file_group.add_argument('-f', dest='inpath', required=False, type=Path, help='Input file (ITP|FF)', nargs="*") file_group.add_argument('-o', dest='outpath', type=Path, - help='Output ITP (ITP)') + help='Output ITP (ITP)', default=Path('polymer.itp')) seq_group = file_group.add_mutually_exclusive_group(required=True) seq_group.add_argument('-seq', dest='seq', type=str, nargs='+', help='A linear sequence of residue names.') From 771cda99c5b69224019f2dea4063beb4a92bbde1 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Fri, 28 Oct 2022 13:12:27 +0200 Subject: [PATCH 174/275] make name and output file optional in gen_params function --- polyply/src/gen_itp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 2a6ab8ab..fcd4edcf 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -17,6 +17,7 @@ """ import sys import networkx as nx +from pathlib import Path import vermouth import vermouth.forcefield from vermouth.log_helpers import StyleAdapter, get_logger @@ -58,7 +59,7 @@ def split_seq_string(sequence): monomers.append(Monomer(resname=resname, n_blocks=n_blocks)) return monomers -def gen_params(name, outpath, inpath=None, lib=None, seq=None, seq_file=None): +def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=None, lib=None, seq=None, seq_file=None): """ Top level function for running the polyply parameter generation. Parameters seq and seq_file are mutually exclusive. Set the other From a0b049536e38e6cd89ed94a1db0549a566f07444 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Fri, 28 Oct 2022 13:13:30 +0200 Subject: [PATCH 175/275] remove coverage file --- polyply/tests/.coverage | Bin 53248 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 polyply/tests/.coverage diff --git a/polyply/tests/.coverage b/polyply/tests/.coverage deleted file mode 100644 index 58f0774cab844e87ff8764d83c797177d8975d92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53248 zcmeI4e~27c9l&RHW`E4?&b}n)Wl7R&rixt7-rn91MU!|YXL{Hpm5?SF@siBV?!LX7 zWOrvXGkeKVY%@u1{9o`7g^FNF`;P{Sq);&jf@qbZMIl()ix#Yc(uzgV#5>MQ>E}vS#azS;d~CLGG4CD{RDrG#K+(#v!*nJ5u!ul(Ok8h-jL6T{9Py zvvgt5&ERXZ=>^+M03lSLZLl259>4g2V$v!#X`@Un&x$>IWgtCp`Kfd=-_yfip{`Gw zS%$w%mp72mab>Csg35+jVb+&Stx=w%)}W%bJuDkw=LOsI)->ux+fZtH!*#P^>9%e( z6ncS{TQ;q%>EIxP7Hj}7>I{&x8ud!G8v3~wZCC!F(kVIU zy3sHO73Ks)z$Y__{N5g(gQ%nztaCNE@lv&xZMf$uRK7X_AK9n3rjq&HyZI~U+(2P? z)RJyn?E|SRXxho^gbusDe%!ED(j6qM71e5rQFWUPE3J5y1JN9AGsOUgX0nE+7=A{u zbW@{^84ETjrJ7Odjx{%8ED8+-`hp-^wbdxIreZN4%Eml3wOKmkU-i0$%?>08oe?RK zpWMA(=(IyX9cdq?ogIl}e%CJklH`VwUt9hz*%d-TO|H?62AAqovsz}*k$g}m8Ilw~WP)FEj;_~A$*W@cnmwp{OefBSOnaol;CLg8?g?X(8y-8Ek zO=z;v2YVxc!ZKDg$gGu&mhHwbJ9Wd8jXfQEJprBbfIZ|IaI-`621VAs;6&-4(=68c zSp7=LFltn5ctZkYoU%ZbZYi$n)q~N2jtpyo$(Wt*cTEY#6xO>Rhqe|pD>$gvwMNAs zrr7A~Nrf(-wMnMO>pP&J(hqIXf|j{LW+2qR$~vk*{!kN8FsXH|;Z_QQ-x)5jdA1Yyk;q7lfp$9LI?VV52}4uN$LpuWV7THyOD8r^U3_f5A#mT zZ-ZXOosPbis!1Kf}R z57TO5~lQs?09-p)8wf<9S@JJ-DapX1f9{CGd3Ok6$NB{{S0VIF~kN^@u0!RP} zAOR$R1dzZ-l|WYLihgKmter2_OL^u-OFE9+7hn{XeTG z{<4TVIyCIAuD}vWk-dLfoR}!8s@~9TRfYFS)oqb0IP|5kf|FZ8!FZ$|gv>v=B}(a* zSuPs2ifY-dY8Bv26Og_?D%;!A*$ep1g=!9jAB|GD)`Ut{>qbSdy1xnnFa3j_SsC;k zi%Jh$d$Wq{Qw<_aZ!}vrQ2(giY;`qH?Ua^ot8k!L{v&xn0b)^zm;&7$^TjkWcnoRb|B*>1ec{AH# zO&ESz#xhKhUP^%UsVFU9UBxqT&@maQ4)&saD2S#-&=6@i66yh|0K$(%Wqzo6cgN7F z7^pcAt(uS*CwLG)7M1vrV7C6>lUn4+^QlGYA?Z@?8`t?R z@3uxNy*)$s=l@$yiq8JXY;Q~V=Ko|?bdE+UeC_#vZccQLMW!b-L0CEemp4k$%K3lx zjOd)$2#;1z4l@oga%bE^Q{MR8AyFF1F7&M`0p>rzMPKplCu*Q$d{i{7gg@5Z9I4DMeRk78{fZ^ z`OR~0_HoTTcb$6)O8xuS&yd}Bc<#S!Mh#o)-8{$DZ^XFY{Oea-><-^2f%wl$Z^kaZ zwKN~+{`T2BnU~1ok8Zzm`up6qLZUatOiexcOL94Wm;U0N>+jy}{q)lLR1%W6CASL) z(+N1*o=89ca_km~!?6-S{nz+|gV$aky2&R*NXUt?hXmL^0-PiSRF5h0h zdlwA4_{KX+^*h@WF_twJi}Rucd$#^BldBxL4Zr{Yck*YlL~fGbl2^#j$WP!|zz^XP zZb$$LAOR$R1dsp{Kmter2_OL^fCP}hy&=FR|GX@_yKL6oWiswA?LHXbCCNQYrQBUI z>FyE00|%gB!C2v01`j~NB{{S0VIF~ zHirOP|Ht|N=CDVtNB{{S0VIF~kN^@u0!RP}AOR$R1nw09_iY7S|G!tbQ4bP80!RP} WAOR$R1dsp{Kmter2_S(@A@Dyinpjx? From 0a76a13c55f1e77f19c14416f8ab988379a1e99d Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 15 Jul 2022 13:57:00 +0200 Subject: [PATCH 176/275] add preprint parameters for CEL and DEX --- polyply/data/martini3/cellulose.martini3.ff | 77 +++++++++++++ polyply/data/martini3/dextran.martini3.ff | 114 ++++++++------------ 2 files changed, 123 insertions(+), 68 deletions(-) create mode 100644 polyply/data/martini3/cellulose.martini3.ff diff --git a/polyply/data/martini3/cellulose.martini3.ff b/polyply/data/martini3/cellulose.martini3.ff new file mode 100644 index 00000000..cdb728dc --- /dev/null +++ b/polyply/data/martini3/cellulose.martini3.ff @@ -0,0 +1,77 @@ +; +; Martini model for cellulose +; +[ citations ] +Martini3 +polyply +M3_sugars + +[ moleculetype ] +; molname nrexcl + CEL 1 + +[ atoms ] +; nr type resnr residue atom cgnr charge mass + 1 SP4r 1 CEL A 1 0 54.0 + 2 SP4r 1 CEL B 2 0 54.0 + 3 SP1r 1 CEL C 3 0 54.0 + 4 TC4 1 CEL VS 4 0 0.00 +[ constraints ] +; i j funct length + 1 2 1 0.380 {"ifndef": "FLEXIBLE"} + 1 3 1 0.470 {"ifndef": "FLEXIBLE"} + 2 3 1 0.396 {"ifndef": "FLEXIBLE"} +[ bonds ] + 1 2 1 0.380 10000 {"ifdef": "FLEXIBLE"} + 1 3 1 0.470 10000 {"ifdef": "FLEXIBLE"} + 2 3 1 0.396 10000 {"ifdef": "FLEXIBLE"} +[ exclusions ] +4 1 2 3 + +[ virtual_sitesn ] +4 1 1 2 3 + +[ link ] +; beta 1->4 +resname "CEL" +[ atoms ] +A {"replace": {"atype": "SN6"} } +B { } +C { } ++A { } ++B {"replace": {"atype": "SP1r"}} ++C { } + +[ bonds ] +; i j funct length force constant + C +A 1 0.355 8500 {"group": "b14"} +; residue internal bonds + A B 1 0.320 10000 {"ifdef": "FLEXIBLE"} + A C 1 0.470 10000 {"ifdef": "FLEXIBLE"} + B C 1 0.390 10000 {"ifdef": "FLEXIBLE"} + +A +B 1 0.320 10000 {"ifdef": "FLEXIBLE"} + +A +C 1 0.470 10000 {"ifdef": "FLEXIBLE"} + +B +C 1 0.390 10000 {"ifdef": "FLEXIBLE"} +[ constraints ] +; i j funct length + A B 1 0.320 {"ifndef": "FLEXIBLE"} + A C 1 0.470 {"ifndef": "FLEXIBLE"} + B C 1 0.390 {"ifndef": "FLEXIBLE"} + +A +B 1 0.320 {"ifndef": "FLEXIBLE"} + +A +C 1 0.470 {"ifndef": "FLEXIBLE"} + +B +C 1 0.390 {"ifndef": "FLEXIBLE"} + +[ angles ] +; i j k funct angle force con. +A B +A 1 155 320 {"group": "ABA - b14"} +B +A +B 1 120 300 {"group": "BAB - b14"} +B +A +C 1 70 220 {"group": "BAC - b14"} +C B +A 1 20 230 {"group": "CBA - b14"} + +[ impropers ] +A B +A +B 2 -125 30 {"group": "ABAB - b14"} + +[ link ] +resname "CEL" +[ dihedrals ] +B +A +B ++A 2 5 15 {"group": "CACA - b14"} diff --git a/polyply/data/martini3/dextran.martini3.ff b/polyply/data/martini3/dextran.martini3.ff index 2b9ccf46..a617fc40 100644 --- a/polyply/data/martini3/dextran.martini3.ff +++ b/polyply/data/martini3/dextran.martini3.ff @@ -1,25 +1,26 @@ -[ citations ] -Martini3 -polyply - [ moleculetype ] ; molname nrexcl DEX 3 [ atoms ] ; nr type resnr residue atom cgnr charge mass - 1 SP3 1 DEX A 1 0 54.0 - 2 SP3 1 DEX B 2 0 54.0 - 3 SP2 1 DEX C 3 0 54.0 + 1 SP4r 1 DEX A 1 0 54.0 + 2 SP4r 1 DEX B 2 0 54.0 + 3 SP1r 1 DEX C 3 0 54.0 + 4 TC4 1 DEX VS 4 0 0.00 [ constraints ] ; i j funct length - 1 2 1 0.336 {"ifndef": "FLEXIBLE"} - 1 3 1 0.311 {"ifndef": "FLEXIBLE"} - 2 3 1 0.405 {"ifndef": "FLEXIBLE"} + 1 2 1 0.380 {"ifndef": "FLEXIBLE"} + 1 3 1 0.470 {"ifndef": "FLEXIBLE"} + 2 3 1 0.396 {"ifndef": "FLEXIBLE"} [ bonds ] - 1 2 1 0.336 10000 {"ifdef": "FLEXIBLE"} - 1 3 1 0.311 10000 {"ifdef": "FLEXIBLE"} - 2 3 1 0.405 10000 {"ifdef": "FLEXIBLE"} + 1 2 1 0.380 10000 {"ifdef": "FLEXIBLE"} + 1 3 1 0.470 10000 {"ifdef": "FLEXIBLE"} + 2 3 1 0.396 10000 {"ifdef": "FLEXIBLE"} +[ virtual_sitesn ] +4 1 1 2 3 +[ exclusions ] +4 1 2 3 ;============================================================ ; ALPHA 1,6 LINK @@ -31,71 +32,48 @@ resname "DEX" [ atoms ] A { } B { } -C {"replace": {"atype": "SP1"}} ->A {"replace": {"atype": "TP3"}} ->B { } ->C { } +C {"replace": {"atype": "SN6r"}} ++A {"replace": {"atype": "SN6"}} ++B { } ++C { } [ bonds ] ; i j funct length force constant - C >A 1 0.37 6500 {"group": "a16", "edge": false} + C +A 1 0.375 6500 {"group": "a16"} +; residue internal bonds + A B 1 0.345 10000 {"ifdef": "FLEXIBLE"} + A C 1 0.460 10000 {"ifdef": "FLEXIBLE"} + B C 1 0.368 10000 {"ifdef": "FLEXIBLE"} + +A +B 1 0.345 10000 {"ifdef": "FLEXIBLE"} + +A +C 1 0.460 10000 {"ifdef": "FLEXIBLE"} + +B +C 1 0.368 10000 {"ifdef": "FLEXIBLE"} +[ constraints ] +; i j funct length + A B 1 0.345 {"ifndef": "FLEXIBLE"} + A C 1 0.460 {"ifndef": "FLEXIBLE"} + B C 1 0.368 {"ifndef": "FLEXIBLE"} + +A +B 1 0.345 {"ifndef": "FLEXIBLE"} + +A +C 1 0.460 {"ifndef": "FLEXIBLE"} + +B +C 1 0.368 {"ifndef": "FLEXIBLE"} [ angles ] ; i j k funct angle force con. -A C >A 1 122 120 {"group": "ACA - a16", "edge": false} -C >A >C 1 70 170 {"group": "CAC - a16", "edge": false} -C >A >B 1 100 170 {"group": "CAB - a16", "edge": false} -; this one should be B C >A -B >C >A 1 76.0 120 {"group": "BCA - a16", "edge": false} +A C +A 10 115 160 {"group": "ACA - a16"} +C +A +C 10 68 320 {"group": "CAC - a16"} +C +A +B 1 100 180 {"group": "CAB - a16"} +B C +A 1 120 50 {"group": "BCA - a16"} [ dihedrals ] -A C >A >C 9 0 12 1 {"version": "1", "group": "ACAC - a16", "edge": false} -A C >A >C 9 0 8 2 {"version": "2", "group": "ACAC - a16", "edge": false} +A C +A +C 9 0 12 1 {"version": "1", "group": "ACAC - a16"} +A C +A +C 9 0 8 2 {"version": "2", "group": "ACAC - a16"} -;[ dihedral_restraints ] -;A C >A >C 1 -120 0.0 10.0006 {"edge": false} - -[ edges ] -C >A {"linktype": "a16"} +[ dihedral_restraints ] +A C >A >C 1 -120 0.0 4.9 {"group": "ACAC - a16"} [ link ] resname "DEX" [ dihedrals ] -C >A >C >>A 9 0 4 3 {"version": "1", "group": "CACA - a16", "edge": false} -C >A >C >>A 9 0 2 1 {"version": "2", "group": "CACA - a16", "edge": false} -[ edges ] -C >A {"linktype": "a16"} ->A >C {"linktype": "a16"} ->C >>A {"linktype": "a16"} - -;[ dihedral_restraints ] -;C >A >C >>A 1 -90 90.0 4.0006 {"edge": false} - -;============================================================ -; ALPHA 1,3 LINK -;============================================================ - -[ link ] -; alpha 1->3 -resname "DEX" -[ atoms ] -A { } -B {"replace": {"atype": "SP2"}} -C { } ->A {"replace": {"atype": "TP3"}} ->B { } ->C { } - -[ bonds ] -; i j funct length force constant - B >A 1 0.32 5500 {"group": "a13", "edge": "false"} - -[ angles ] -; i j k funct angle force con. -C B >A 1 180 180 {"edge": "flase", "group": "CBA - a13"} -B >A >B 1 115 180 {"edge": "flase", "group": "BAB - a13"} -A B >A 1 108 180 {"edge": "flase", "group": "ABA - a13"} -B >A >C 1 85 162 {"edge": "flase", "group": "BAC - a13"} - -[ edges ] -B >A {"linktype": "a13"} +C +A +C ++A 9 0 4 3 {"version": "1", "group": "CACA - a16"} +C +A +C ++A 9 0 2 1 {"version": "2", "group": "CACA - a16"} +[ dihedral_restraints ] +C +A +C ++A 1 -135 0.0 1.5 {"version": "1", "group": "CACA - a16"} From cfa1f29170c605b5eb2050c1419bc3d588271d58 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 15 Jul 2022 15:23:38 +0200 Subject: [PATCH 177/275] add preprint parameters for CEL and DEX --- polyply/data/martini3/cellulose.martini3.ff | 51 +- polyply/data/martini3/citations.bib | 11 +- polyply/data/martini3/dextran.martini3.ff | 54 +- .../library_tests/martini3/DEX/input.json | 484 -------- .../martini3/DEX/polyply/DEX.itp | 1063 ++++------------- .../martini3/DEX/polyply/command | 2 +- 6 files changed, 256 insertions(+), 1409 deletions(-) delete mode 100644 polyply/tests/test_data/library_tests/martini3/DEX/input.json diff --git a/polyply/data/martini3/cellulose.martini3.ff b/polyply/data/martini3/cellulose.martini3.ff index cdb728dc..d4600d30 100644 --- a/polyply/data/martini3/cellulose.martini3.ff +++ b/polyply/data/martini3/cellulose.martini3.ff @@ -16,26 +16,28 @@ M3_sugars 2 SP4r 1 CEL B 2 0 54.0 3 SP1r 1 CEL C 3 0 54.0 4 TC4 1 CEL VS 4 0 0.00 +[ bonds ] +; residue internal bonds + A B 1 0.320 10000 {"ifdef": "FLEXIBLE"} + A C 1 0.470 10000 {"ifdef": "FLEXIBLE"} + B C 1 0.390 10000 {"ifdef": "FLEXIBLE"} [ constraints ] ; i j funct length - 1 2 1 0.380 {"ifndef": "FLEXIBLE"} - 1 3 1 0.470 {"ifndef": "FLEXIBLE"} - 2 3 1 0.396 {"ifndef": "FLEXIBLE"} -[ bonds ] - 1 2 1 0.380 10000 {"ifdef": "FLEXIBLE"} - 1 3 1 0.470 10000 {"ifdef": "FLEXIBLE"} - 2 3 1 0.396 10000 {"ifdef": "FLEXIBLE"} + A B 1 0.320 {"ifndef": "FLEXIBLE"} + A C 1 0.470 {"ifndef": "FLEXIBLE"} + B C 1 0.390 {"ifndef": "FLEXIBLE"} [ exclusions ] 4 1 2 3 - [ virtual_sitesn ] -4 1 1 2 3 +4 1 2 3 -- 1 +[ edges ] +A VS [ link ] ; beta 1->4 resname "CEL" [ atoms ] -A {"replace": {"atype": "SN6"} } +A {"replace": {"atype": "SN6", "mass": "36"} } B { } C { } +A { } @@ -44,34 +46,23 @@ C { } [ bonds ] ; i j funct length force constant - C +A 1 0.355 8500 {"group": "b14"} -; residue internal bonds - A B 1 0.320 10000 {"ifdef": "FLEXIBLE"} - A C 1 0.470 10000 {"ifdef": "FLEXIBLE"} - B C 1 0.390 10000 {"ifdef": "FLEXIBLE"} - +A +B 1 0.320 10000 {"ifdef": "FLEXIBLE"} - +A +C 1 0.470 10000 {"ifdef": "FLEXIBLE"} - +B +C 1 0.390 10000 {"ifdef": "FLEXIBLE"} -[ constraints ] -; i j funct length - A B 1 0.320 {"ifndef": "FLEXIBLE"} - A C 1 0.470 {"ifndef": "FLEXIBLE"} - B C 1 0.390 {"ifndef": "FLEXIBLE"} - +A +B 1 0.320 {"ifndef": "FLEXIBLE"} - +A +C 1 0.470 {"ifndef": "FLEXIBLE"} - +B +C 1 0.390 {"ifndef": "FLEXIBLE"} + B +A 1 0.355 8500 {"group": "b14"} [ angles ] ; i j k funct angle force con. A B +A 1 155 320 {"group": "ABA - b14"} -B +A +B 1 120 300 {"group": "BAB - b14"} -B +A +C 1 70 220 {"group": "BAC - b14"} -C B +A 1 20 230 {"group": "CBA - b14"} +B +A +B 1 120 220 {"group": "BAB - b14"} +B +A +C 1 70 230 {"group": "BAC - b14"} +C B +A 1 75 260 {"group": "CBA - b14"} [ impropers ] A B +A +B 2 -125 30 {"group": "ABAB - b14"} [ link ] resname "CEL" -[ dihedrals ] +[ impropers ] B +A +B ++A 2 5 15 {"group": "CACA - b14"} +[ edges ] +B +A ++A +B ++B ++A diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index 77879133..669e9911 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -38,5 +38,12 @@ @article{2022RAlessandri-arXiv year={2022}, eprint={2209.02072}, primaryClass={cond-mat.soft}, - doi={https://doi.org/10.48550/arXiv.2209.02072} -} + doi={https://doi.org/10.48550/arXiv.2209.02072}} +@article{M3_sugars, + title={Martini 3 Coarse-Grained Force Field for Carbohydrates}, + author={Fabian, Grünewald and Mats H., Punt and Elizabeth E., Jefferys and Petteri A., Vainikka and Melanie, König and Valtteri, Virtanen and Travis A., Meyer and Weria, Pezeshkian and Adam J., Gormley and Maarit, Karonen and Mark S. P., Sansom and Paulo C. T, Souza and Siewert J., Marrink}, + year={2022}, + journal={JCTC}, + doi={10.1021/acs.jctc.2c00757}, + url={https://doi.org/10.1021/acs.jctc.2c00757}} + diff --git a/polyply/data/martini3/dextran.martini3.ff b/polyply/data/martini3/dextran.martini3.ff index a617fc40..7a1ebd84 100644 --- a/polyply/data/martini3/dextran.martini3.ff +++ b/polyply/data/martini3/dextran.martini3.ff @@ -1,3 +1,11 @@ +; +; Martini model for dextran +; +[ citations ] +Martini3 +polyply +M3_sugars + [ moleculetype ] ; molname nrexcl DEX 3 @@ -8,19 +16,22 @@ 2 SP4r 1 DEX B 2 0 54.0 3 SP1r 1 DEX C 3 0 54.0 4 TC4 1 DEX VS 4 0 0.00 +[ bonds ] +; residue internal bonds + A B 1 0.345 10000 {"ifdef": "FLEXIBLE"} + A C 1 0.460 10000 {"ifdef": "FLEXIBLE"} + B C 1 0.368 10000 {"ifdef": "FLEXIBLE"} [ constraints ] ; i j funct length - 1 2 1 0.380 {"ifndef": "FLEXIBLE"} - 1 3 1 0.470 {"ifndef": "FLEXIBLE"} - 2 3 1 0.396 {"ifndef": "FLEXIBLE"} -[ bonds ] - 1 2 1 0.380 10000 {"ifdef": "FLEXIBLE"} - 1 3 1 0.470 10000 {"ifdef": "FLEXIBLE"} - 2 3 1 0.396 10000 {"ifdef": "FLEXIBLE"} + A B 1 0.345 {"ifndef": "FLEXIBLE"} + A C 1 0.460 {"ifndef": "FLEXIBLE"} + B C 1 0.368 {"ifndef": "FLEXIBLE"} [ virtual_sitesn ] -4 1 1 2 3 +VS A B C -- 1 [ exclusions ] -4 1 2 3 +VS A B C +[ edges ] +A VS ;============================================================ ; ALPHA 1,6 LINK @@ -40,40 +51,25 @@ C {"replace": {"atype": "SN6r"}} [ bonds ] ; i j funct length force constant C +A 1 0.375 6500 {"group": "a16"} -; residue internal bonds - A B 1 0.345 10000 {"ifdef": "FLEXIBLE"} - A C 1 0.460 10000 {"ifdef": "FLEXIBLE"} - B C 1 0.368 10000 {"ifdef": "FLEXIBLE"} - +A +B 1 0.345 10000 {"ifdef": "FLEXIBLE"} - +A +C 1 0.460 10000 {"ifdef": "FLEXIBLE"} - +B +C 1 0.368 10000 {"ifdef": "FLEXIBLE"} -[ constraints ] -; i j funct length - A B 1 0.345 {"ifndef": "FLEXIBLE"} - A C 1 0.460 {"ifndef": "FLEXIBLE"} - B C 1 0.368 {"ifndef": "FLEXIBLE"} - +A +B 1 0.345 {"ifndef": "FLEXIBLE"} - +A +C 1 0.460 {"ifndef": "FLEXIBLE"} - +B +C 1 0.368 {"ifndef": "FLEXIBLE"} [ angles ] ; i j k funct angle force con. A C +A 10 115 160 {"group": "ACA - a16"} C +A +C 10 68 320 {"group": "CAC - a16"} -C +A +B 1 100 180 {"group": "CAB - a16"} -B C +A 1 120 50 {"group": "BCA - a16"} +C +A +B 2 100 180 {"group": "CAB - a16"} +B C +A 2 120 50 {"group": "BCA - a16"} [ dihedrals ] A C +A +C 9 0 12 1 {"version": "1", "group": "ACAC - a16"} A C +A +C 9 0 8 2 {"version": "2", "group": "ACAC - a16"} [ dihedral_restraints ] -A C >A >C 1 -120 0.0 4.9 {"group": "ACAC - a16"} +A C +A +C 1 -120 0.0 4.9 {"group": "ACAC - a16"} [ link ] resname "DEX" [ dihedrals ] -C +A +C ++A 9 0 4 3 {"version": "1", "group": "CACA - a16"} -C +A +C ++A 9 0 2 1 {"version": "2", "group": "CACA - a16"} +C +A +C ++A 9 0 4 4 {"version": "1", "group": "CACA - a16"} +C +A +C ++A 9 90 4 6 {"version": "2", "group": "CACA - a16"} [ dihedral_restraints ] C +A +C ++A 1 -135 0.0 1.5 {"version": "1", "group": "CACA - a16"} diff --git a/polyply/tests/test_data/library_tests/martini3/DEX/input.json b/polyply/tests/test_data/library_tests/martini3/DEX/input.json deleted file mode 100644 index bfa33e0e..00000000 --- a/polyply/tests/test_data/library_tests/martini3/DEX/input.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "directed": false, - "multigraph": false, - "graph": {}, - "nodes": [ - { - "resname": "DEX", - "resid": 1, - "id": 0 - }, - { - "resname": "DEX", - "resid": 2, - "id": 1 - }, - { - "resname": "DEX", - "resid": 3, - "id": 2 - }, - { - "resname": "DEX", - "resid": 4, - "id": 3 - }, - { - "resname": "DEX", - "resid": 5, - "id": 4 - }, - { - "resname": "DEX", - "resid": 6, - "id": 5 - }, - { - "resname": "DEX", - "resid": 7, - "id": 6 - }, - { - "resname": "DEX", - "resid": 8, - "id": 7 - }, - { - "resname": "DEX", - "resid": 9, - "id": 8 - }, - { - "resname": "DEX", - "resid": 10, - "id": 9 - }, - { - "resname": "DEX", - "resid": 11, - "id": 10 - }, - { - "resname": "DEX", - "resid": 12, - "id": 11 - }, - { - "resname": "DEX", - "resid": 13, - "id": 12 - }, - { - "resname": "DEX", - "resid": 14, - "id": 13 - }, - { - "resname": "DEX", - "resid": 15, - "id": 14 - }, - { - "resname": "DEX", - "resid": 16, - "id": 15 - }, - { - "resname": "DEX", - "resid": 17, - "id": 16 - }, - { - "resname": "DEX", - "resid": 18, - "id": 17 - }, - { - "resname": "DEX", - "resid": 19, - "id": 18 - }, - { - "resname": "DEX", - "resid": 20, - "id": 19 - }, - { - "resname": "DEX", - "resid": 21, - "id": 20 - }, - { - "resname": "DEX", - "resid": 22, - "id": 21 - }, - { - "resname": "DEX", - "resid": 23, - "id": 22 - }, - { - "resname": "DEX", - "resid": 24, - "id": 23 - }, - { - "resname": "DEX", - "resid": 25, - "id": 24 - }, - { - "resname": "DEX", - "resid": 26, - "id": 25 - }, - { - "resname": "DEX", - "resid": 27, - "id": 26 - }, - { - "resname": "DEX", - "resid": 28, - "id": 27 - }, - { - "resname": "DEX", - "resid": 29, - "id": 28 - }, - { - "resname": "DEX", - "resid": 30, - "id": 29 - }, - { - "resname": "DEX", - "resid": 31, - "id": 30 - }, - { - "resname": "DEX", - "resid": 32, - "id": 31 - }, - { - "resname": "DEX", - "resid": 33, - "id": 32 - }, - { - "resname": "DEX", - "resid": 34, - "id": 33 - }, - { - "resname": "DEX", - "resid": 35, - "id": 34 - }, - { - "resname": "DEX", - "resid": 36, - "id": 35 - }, - { - "resname": "DEX", - "resid": 37, - "id": 36 - }, - { - "resname": "DEX", - "resid": 38, - "id": 37 - }, - { - "resname": "DEX", - "resid": 39, - "id": 38 - }, - { - "resname": "DEX", - "resid": 40, - "id": 39 - }, - { - "resname": "DEX", - "resid": 41, - "id": 40 - }, - { - "resname": "DEX", - "resid": 42, - "id": 41 - }, - { - "resname": "DEX", - "resid": 43, - "id": 42 - }, - { - "resname": "DEX", - "resid": 44, - "id": 43 - }, - { - "resname": "DEX", - "resid": 45, - "id": 44 - }, - { - "resname": "DEX", - "resid": 46, - "id": 45 - }, - { - "resname": "DEX", - "resid": 47, - "id": 46 - }, - { - "resname": "DEX", - "resid": 48, - "id": 47 - } - ], - "links": [ - { - "linktype": "a16", - "source": 0, - "target": 1 - }, - { - "linktype": "a16", - "source": 1, - "target": 2 - }, - { - "linktype": "a16", - "source": 2, - "target": 3 - }, - { - "linktype": "a16", - "source": 3, - "target": 4 - }, - { - "linktype": "a16", - "source": 4, - "target": 5 - }, - { - "linktype": "a16", - "source": 5, - "target": 6 - }, - { - "linktype": "a16", - "source": 6, - "target": 7 - }, - { - "linktype": "a16", - "source": 7, - "target": 8 - }, - { - "linktype": "a16", - "source": 8, - "target": 9 - }, - { - "linktype": "a16", - "source": 9, - "target": 10 - }, - { - "linktype": "a16", - "source": 10, - "target": 11 - }, - { - "linktype": "a16", - "source": 11, - "target": 12 - }, - { - "linktype": "a16", - "source": 12, - "target": 13 - }, - { - "linktype": "a16", - "source": 13, - "target": 14 - }, - { - "linktype": "a13", - "source": 14, - "target": 15 - }, - { - "linktype": "a16", - "source": 14, - "target": 17 - }, - { - "linktype": "a16", - "source": 15, - "target": 16 - }, - { - "linktype": "a16", - "source": 17, - "target": 18 - }, - { - "linktype": "a16", - "source": 18, - "target": 19 - }, - { - "linktype": "a16", - "source": 19, - "target": 20 - }, - { - "linktype": "a16", - "source": 20, - "target": 21 - }, - { - "linktype": "a16", - "source": 21, - "target": 22 - }, - { - "linktype": "a16", - "source": 22, - "target": 23 - }, - { - "linktype": "a16", - "source": 23, - "target": 24 - }, - { - "linktype": "a16", - "source": 24, - "target": 25 - }, - { - "linktype": "a16", - "source": 25, - "target": 26 - }, - { - "linktype": "a13", - "source": 26, - "target": 27 - }, - { - "linktype": "a16", - "source": 26, - "target": 29 - }, - { - "linktype": "a16", - "source": 27, - "target": 28 - }, - { - "linktype": "a16", - "source": 29, - "target": 30 - }, - { - "linktype": "a16", - "source": 30, - "target": 31 - }, - { - "linktype": "a16", - "source": 31, - "target": 32 - }, - { - "linktype": "a16", - "source": 32, - "target": 33 - }, - { - "linktype": "a16", - "source": 33, - "target": 34 - }, - { - "linktype": "a16", - "source": 34, - "target": 35 - }, - { - "linktype": "a16", - "source": 35, - "target": 36 - }, - { - "linktype": "a16", - "source": 36, - "target": 37 - }, - { - "linktype": "a16", - "source": 37, - "target": 38 - }, - { - "linktype": "a16", - "source": 38, - "target": 39 - }, - { - "linktype": "a16", - "source": 39, - "target": 40 - }, - { - "linktype": "a16", - "source": 40, - "target": 41 - }, - { - "linktype": "a16", - "source": 41, - "target": 42 - }, - { - "linktype": "a16", - "source": 42, - "target": 43 - }, - { - "linktype": "a16", - "source": 43, - "target": 44 - }, - { - "linktype": "a16", - "source": 44, - "target": 45 - }, - { - "linktype": "a16", - "source": 45, - "target": 46 - }, - { - "linktype": "a16", - "source": 46, - "target": 47 - } - ] -} \ No newline at end of file diff --git a/polyply/tests/test_data/library_tests/martini3/DEX/polyply/DEX.itp b/polyply/tests/test_data/library_tests/martini3/DEX/polyply/DEX.itp index 1cd5c5a3..9d34eecf 100644 --- a/polyply/tests/test_data/library_tests/martini3/DEX/polyply/DEX.itp +++ b/polyply/tests/test_data/library_tests/martini3/DEX/polyply/DEX.itp @@ -1,4 +1,4 @@ -; /coarse/fabian/current-projects/polymer_itp_builder/vermouth_dev/venvv/bin/polyply gen_itp -lib martini3 -seqf input.json -o DEX.itp -name DEX +; /coarse/fabian/current-projects/polymer_itp_builder/vermouth_dev/venv_py38/bin/polyply gen_itp -f ../../sugars.ff -seq GLC:9 -name sugar -o init.itp ; Please cite the following papers: @@ -6,879 +6,216 @@ DEX 3 [ atoms ] - 1 SP3 1 DEX A 1 0.0 54.0 - 2 SP3 1 DEX B 2 0.0 54.0 - 3 SP1 1 DEX C 3 0.0 54.0 - 4 TP3 2 DEX A 4 0.0 54.0 - 5 SP3 2 DEX B 5 0.0 54.0 - 6 SP1 2 DEX C 6 0.0 54.0 - 7 TP3 3 DEX A 7 0.0 54.0 - 8 SP3 3 DEX B 8 0.0 54.0 - 9 SP1 3 DEX C 9 0.0 54.0 - 10 TP3 4 DEX A 10 0.0 54.0 - 11 SP3 4 DEX B 11 0.0 54.0 - 12 SP1 4 DEX C 12 0.0 54.0 - 13 TP3 5 DEX A 13 0.0 54.0 - 14 SP3 5 DEX B 14 0.0 54.0 - 15 SP1 5 DEX C 15 0.0 54.0 - 16 TP3 6 DEX A 16 0.0 54.0 - 17 SP3 6 DEX B 17 0.0 54.0 - 18 SP1 6 DEX C 18 0.0 54.0 - 19 TP3 7 DEX A 19 0.0 54.0 - 20 SP3 7 DEX B 20 0.0 54.0 - 21 SP1 7 DEX C 21 0.0 54.0 - 22 TP3 8 DEX A 22 0.0 54.0 - 23 SP3 8 DEX B 23 0.0 54.0 - 24 SP1 8 DEX C 24 0.0 54.0 - 25 TP3 9 DEX A 25 0.0 54.0 - 26 SP3 9 DEX B 26 0.0 54.0 - 27 SP1 9 DEX C 27 0.0 54.0 - 28 TP3 10 DEX A 28 0.0 54.0 - 29 SP3 10 DEX B 29 0.0 54.0 - 30 SP1 10 DEX C 30 0.0 54.0 - 31 TP3 11 DEX A 31 0.0 54.0 - 32 SP3 11 DEX B 32 0.0 54.0 - 33 SP1 11 DEX C 33 0.0 54.0 - 34 TP3 12 DEX A 34 0.0 54.0 - 35 SP3 12 DEX B 35 0.0 54.0 - 36 SP1 12 DEX C 36 0.0 54.0 - 37 TP3 13 DEX A 37 0.0 54.0 - 38 SP3 13 DEX B 38 0.0 54.0 - 39 SP1 13 DEX C 39 0.0 54.0 - 40 TP3 14 DEX A 40 0.0 54.0 - 41 SP3 14 DEX B 41 0.0 54.0 - 42 SP1 14 DEX C 42 0.0 54.0 - 43 TP3 15 DEX A 43 0.0 54.0 - 44 SP2 15 DEX B 44 0.0 54.0 - 45 SP1 15 DEX C 45 0.0 54.0 - 46 TP3 16 DEX A 46 0.0 54.0 - 47 SP3 16 DEX B 47 0.0 54.0 - 48 SP1 16 DEX C 48 0.0 54.0 - 49 TP3 17 DEX A 49 0.0 54.0 - 50 SP3 17 DEX B 50 0.0 54.0 - 51 SP2 17 DEX C 51 0.0 54.0 - 52 TP3 18 DEX A 52 0.0 54.0 - 53 SP3 18 DEX B 53 0.0 54.0 - 54 SP1 18 DEX C 54 0.0 54.0 - 55 TP3 19 DEX A 55 0.0 54.0 - 56 SP3 19 DEX B 56 0.0 54.0 - 57 SP1 19 DEX C 57 0.0 54.0 - 58 TP3 20 DEX A 58 0.0 54.0 - 59 SP3 20 DEX B 59 0.0 54.0 - 60 SP1 20 DEX C 60 0.0 54.0 - 61 TP3 21 DEX A 61 0.0 54.0 - 62 SP3 21 DEX B 62 0.0 54.0 - 63 SP1 21 DEX C 63 0.0 54.0 - 64 TP3 22 DEX A 64 0.0 54.0 - 65 SP3 22 DEX B 65 0.0 54.0 - 66 SP1 22 DEX C 66 0.0 54.0 - 67 TP3 23 DEX A 67 0.0 54.0 - 68 SP3 23 DEX B 68 0.0 54.0 - 69 SP1 23 DEX C 69 0.0 54.0 - 70 TP3 24 DEX A 70 0.0 54.0 - 71 SP3 24 DEX B 71 0.0 54.0 - 72 SP1 24 DEX C 72 0.0 54.0 - 73 TP3 25 DEX A 73 0.0 54.0 - 74 SP3 25 DEX B 74 0.0 54.0 - 75 SP1 25 DEX C 75 0.0 54.0 - 76 TP3 26 DEX A 76 0.0 54.0 - 77 SP3 26 DEX B 77 0.0 54.0 - 78 SP1 26 DEX C 78 0.0 54.0 - 79 TP3 27 DEX A 79 0.0 54.0 - 80 SP2 27 DEX B 80 0.0 54.0 - 81 SP1 27 DEX C 81 0.0 54.0 - 82 TP3 28 DEX A 82 0.0 54.0 - 83 SP3 28 DEX B 83 0.0 54.0 - 84 SP1 28 DEX C 84 0.0 54.0 - 85 TP3 29 DEX A 85 0.0 54.0 - 86 SP3 29 DEX B 86 0.0 54.0 - 87 SP2 29 DEX C 87 0.0 54.0 - 88 TP3 30 DEX A 88 0.0 54.0 - 89 SP3 30 DEX B 89 0.0 54.0 - 90 SP1 30 DEX C 90 0.0 54.0 - 91 TP3 31 DEX A 91 0.0 54.0 - 92 SP3 31 DEX B 92 0.0 54.0 - 93 SP1 31 DEX C 93 0.0 54.0 - 94 TP3 32 DEX A 94 0.0 54.0 - 95 SP3 32 DEX B 95 0.0 54.0 - 96 SP1 32 DEX C 96 0.0 54.0 - 97 TP3 33 DEX A 97 0.0 54.0 - 98 SP3 33 DEX B 98 0.0 54.0 - 99 SP1 33 DEX C 99 0.0 54.0 -100 TP3 34 DEX A 100 0.0 54.0 -101 SP3 34 DEX B 101 0.0 54.0 -102 SP1 34 DEX C 102 0.0 54.0 -103 TP3 35 DEX A 103 0.0 54.0 -104 SP3 35 DEX B 104 0.0 54.0 -105 SP1 35 DEX C 105 0.0 54.0 -106 TP3 36 DEX A 106 0.0 54.0 -107 SP3 36 DEX B 107 0.0 54.0 -108 SP1 36 DEX C 108 0.0 54.0 -109 TP3 37 DEX A 109 0.0 54.0 -110 SP3 37 DEX B 110 0.0 54.0 -111 SP1 37 DEX C 111 0.0 54.0 -112 TP3 38 DEX A 112 0.0 54.0 -113 SP3 38 DEX B 113 0.0 54.0 -114 SP1 38 DEX C 114 0.0 54.0 -115 TP3 39 DEX A 115 0.0 54.0 -116 SP3 39 DEX B 116 0.0 54.0 -117 SP1 39 DEX C 117 0.0 54.0 -118 TP3 40 DEX A 118 0.0 54.0 -119 SP3 40 DEX B 119 0.0 54.0 -120 SP1 40 DEX C 120 0.0 54.0 -121 TP3 41 DEX A 121 0.0 54.0 -122 SP3 41 DEX B 122 0.0 54.0 -123 SP1 41 DEX C 123 0.0 54.0 -124 TP3 42 DEX A 124 0.0 54.0 -125 SP3 42 DEX B 125 0.0 54.0 -126 SP1 42 DEX C 126 0.0 54.0 -127 TP3 43 DEX A 127 0.0 54.0 -128 SP3 43 DEX B 128 0.0 54.0 -129 SP1 43 DEX C 129 0.0 54.0 -130 TP3 44 DEX A 130 0.0 54.0 -131 SP3 44 DEX B 131 0.0 54.0 -132 SP1 44 DEX C 132 0.0 54.0 -133 TP3 45 DEX A 133 0.0 54.0 -134 SP3 45 DEX B 134 0.0 54.0 -135 SP1 45 DEX C 135 0.0 54.0 -136 TP3 46 DEX A 136 0.0 54.0 -137 SP3 46 DEX B 137 0.0 54.0 -138 SP1 46 DEX C 138 0.0 54.0 -139 TP3 47 DEX A 139 0.0 54.0 -140 SP3 47 DEX B 140 0.0 54.0 -141 SP1 47 DEX C 141 0.0 54.0 -142 TP3 48 DEX A 142 0.0 54.0 -143 SP3 48 DEX B 143 0.0 54.0 -144 SP2 48 DEX C 144 0.0 54.0 + 1 SP4r 1 GLC A 1 0.0 + 2 SP4r 1 GLC B 2 0.0 + 3 SN6r 1 GLC C 3 0.0 + 4 TC4 1 GLC D 4 0.0 0.0 + 5 SN6 2 GLC A 5 0.0 + 6 SP4r 2 GLC B 6 0.0 + 7 SN6r 2 GLC C 7 0.0 + 8 TC4 2 GLC D 8 0.0 0.0 + 9 SN6 3 GLC A 9 0.0 +10 SP4r 3 GLC B 10 0.0 +11 SN6r 3 GLC C 11 0.0 +12 TC4 3 GLC D 12 0.0 0.0 +13 SN6 4 GLC A 13 0.0 +14 SP4r 4 GLC B 14 0.0 +15 SN6r 4 GLC C 15 0.0 +16 TC4 4 GLC D 16 0.0 0.0 +17 SN6 5 GLC A 17 0.0 +18 SP4r 5 GLC B 18 0.0 +19 SN6r 5 GLC C 19 0.0 +20 TC4 5 GLC D 20 0.0 0.0 +21 SN6 6 GLC A 21 0.0 +22 SP4r 6 GLC B 22 0.0 +23 SN6r 6 GLC C 23 0.0 +24 TC4 6 GLC D 24 0.0 0.0 +25 SN6 7 GLC A 25 0.0 +26 SP4r 7 GLC B 26 0.0 +27 SN6r 7 GLC C 27 0.0 +28 TC4 7 GLC D 28 0.0 0.0 +29 SN6 8 GLC A 29 0.0 +30 SP4r 8 GLC B 30 0.0 +31 SN6r 8 GLC C 31 0.0 +32 TC4 8 GLC D 32 0.0 0.0 +33 SN6 9 GLC A 33 0.0 +34 SP4r 9 GLC B 34 0.0 +35 SP1r 9 GLC C 35 0.0 +36 TC4 9 GLC D 36 0.0 0.0 [ bonds ] -; a13 - 44 46 1 0.32 5500 - 80 82 1 0.32 5500 - -; a16 - 3 4 1 0.37 6500 - 6 7 1 0.37 6500 - 9 10 1 0.37 6500 - 12 13 1 0.37 6500 - 15 16 1 0.37 6500 - 18 19 1 0.37 6500 - 21 22 1 0.37 6500 - 24 25 1 0.37 6500 - 27 28 1 0.37 6500 - 30 31 1 0.37 6500 - 33 34 1 0.37 6500 - 36 37 1 0.37 6500 - 39 40 1 0.37 6500 - 42 43 1 0.37 6500 - 48 49 1 0.37 6500 - 45 52 1 0.37 6500 - 54 55 1 0.37 6500 - 57 58 1 0.37 6500 - 60 61 1 0.37 6500 - 63 64 1 0.37 6500 - 66 67 1 0.37 6500 - 69 70 1 0.37 6500 - 72 73 1 0.37 6500 - 75 76 1 0.37 6500 - 78 79 1 0.37 6500 - 84 85 1 0.37 6500 - 81 88 1 0.37 6500 - 90 91 1 0.37 6500 - 93 94 1 0.37 6500 - 96 97 1 0.37 6500 - 99 100 1 0.37 6500 -102 103 1 0.37 6500 -105 106 1 0.37 6500 -108 109 1 0.37 6500 -111 112 1 0.37 6500 -114 115 1 0.37 6500 -117 118 1 0.37 6500 -120 121 1 0.37 6500 -123 124 1 0.37 6500 -126 127 1 0.37 6500 -129 130 1 0.37 6500 -132 133 1 0.37 6500 -135 136 1 0.37 6500 -138 139 1 0.37 6500 -141 142 1 0.37 6500 + 3 5 1 0.375 6500 ; a16 + 7 9 1 0.375 6500 ; a16 +11 13 1 0.375 6500 ; a16 +15 17 1 0.375 6500 ; a16 +19 21 1 0.375 6500 ; a16 +23 25 1 0.375 6500 ; a16 +27 29 1 0.375 6500 ; a16 +31 33 1 0.375 6500 ; a16 #ifdef FLEXIBLE - 1 2 1 0.336 10000 - 1 3 1 0.311 10000 - 2 3 1 0.405 10000 - 4 5 1 0.336 10000 - 4 6 1 0.311 10000 - 5 6 1 0.405 10000 - 7 8 1 0.336 10000 - 7 9 1 0.311 10000 - 8 9 1 0.405 10000 - 10 11 1 0.336 10000 - 10 12 1 0.311 10000 - 11 12 1 0.405 10000 - 13 14 1 0.336 10000 - 13 15 1 0.311 10000 - 14 15 1 0.405 10000 - 16 17 1 0.336 10000 - 16 18 1 0.311 10000 - 17 18 1 0.405 10000 - 19 20 1 0.336 10000 - 19 21 1 0.311 10000 - 20 21 1 0.405 10000 - 22 23 1 0.336 10000 - 22 24 1 0.311 10000 - 23 24 1 0.405 10000 - 25 26 1 0.336 10000 - 25 27 1 0.311 10000 - 26 27 1 0.405 10000 - 28 29 1 0.336 10000 - 28 30 1 0.311 10000 - 29 30 1 0.405 10000 - 31 32 1 0.336 10000 - 31 33 1 0.311 10000 - 32 33 1 0.405 10000 - 34 35 1 0.336 10000 - 34 36 1 0.311 10000 - 35 36 1 0.405 10000 - 37 38 1 0.336 10000 - 37 39 1 0.311 10000 - 38 39 1 0.405 10000 - 40 41 1 0.336 10000 - 40 42 1 0.311 10000 - 41 42 1 0.405 10000 - 43 44 1 0.336 10000 - 43 45 1 0.311 10000 - 44 45 1 0.405 10000 - 46 47 1 0.336 10000 - 46 48 1 0.311 10000 - 47 48 1 0.405 10000 - 49 50 1 0.336 10000 - 49 51 1 0.311 10000 - 50 51 1 0.405 10000 - 52 53 1 0.336 10000 - 52 54 1 0.311 10000 - 53 54 1 0.405 10000 - 55 56 1 0.336 10000 - 55 57 1 0.311 10000 - 56 57 1 0.405 10000 - 58 59 1 0.336 10000 - 58 60 1 0.311 10000 - 59 60 1 0.405 10000 - 61 62 1 0.336 10000 - 61 63 1 0.311 10000 - 62 63 1 0.405 10000 - 64 65 1 0.336 10000 - 64 66 1 0.311 10000 - 65 66 1 0.405 10000 - 67 68 1 0.336 10000 - 67 69 1 0.311 10000 - 68 69 1 0.405 10000 - 70 71 1 0.336 10000 - 70 72 1 0.311 10000 - 71 72 1 0.405 10000 - 73 74 1 0.336 10000 - 73 75 1 0.311 10000 - 74 75 1 0.405 10000 - 76 77 1 0.336 10000 - 76 78 1 0.311 10000 - 77 78 1 0.405 10000 - 79 80 1 0.336 10000 - 79 81 1 0.311 10000 - 80 81 1 0.405 10000 - 82 83 1 0.336 10000 - 82 84 1 0.311 10000 - 83 84 1 0.405 10000 - 85 86 1 0.336 10000 - 85 87 1 0.311 10000 - 86 87 1 0.405 10000 - 88 89 1 0.336 10000 - 88 90 1 0.311 10000 - 89 90 1 0.405 10000 - 91 92 1 0.336 10000 - 91 93 1 0.311 10000 - 92 93 1 0.405 10000 - 94 95 1 0.336 10000 - 94 96 1 0.311 10000 - 95 96 1 0.405 10000 - 97 98 1 0.336 10000 - 97 99 1 0.311 10000 - 98 99 1 0.405 10000 -100 101 1 0.336 10000 -100 102 1 0.311 10000 -101 102 1 0.405 10000 -103 104 1 0.336 10000 -103 105 1 0.311 10000 -104 105 1 0.405 10000 -106 107 1 0.336 10000 -106 108 1 0.311 10000 -107 108 1 0.405 10000 -109 110 1 0.336 10000 -109 111 1 0.311 10000 -110 111 1 0.405 10000 -112 113 1 0.336 10000 -112 114 1 0.311 10000 -113 114 1 0.405 10000 -115 116 1 0.336 10000 -115 117 1 0.311 10000 -116 117 1 0.405 10000 -118 119 1 0.336 10000 -118 120 1 0.311 10000 -119 120 1 0.405 10000 -121 122 1 0.336 10000 -121 123 1 0.311 10000 -122 123 1 0.405 10000 -124 125 1 0.336 10000 -124 126 1 0.311 10000 -125 126 1 0.405 10000 -127 128 1 0.336 10000 -127 129 1 0.311 10000 -128 129 1 0.405 10000 -130 131 1 0.336 10000 -130 132 1 0.311 10000 -131 132 1 0.405 10000 -133 134 1 0.336 10000 -133 135 1 0.311 10000 -134 135 1 0.405 10000 -136 137 1 0.336 10000 -136 138 1 0.311 10000 -137 138 1 0.405 10000 -139 140 1 0.336 10000 -139 141 1 0.311 10000 -140 141 1 0.405 10000 -142 143 1 0.336 10000 -142 144 1 0.311 10000 -143 144 1 0.405 10000 + 1 2 1 0.345 10000 + 1 3 1 0.460 10000 + 2 3 1 0.368 10000 + 5 6 1 0.345 10000 + 5 7 1 0.460 10000 + 6 7 1 0.368 10000 + 9 10 1 0.345 10000 + 9 11 1 0.460 10000 +10 11 1 0.368 10000 +13 14 1 0.345 10000 +13 15 1 0.460 10000 +14 15 1 0.368 10000 +17 18 1 0.345 10000 +17 19 1 0.460 10000 +18 19 1 0.368 10000 +21 22 1 0.345 10000 +21 23 1 0.460 10000 +22 23 1 0.368 10000 +25 26 1 0.345 10000 +25 27 1 0.460 10000 +26 27 1 0.368 10000 +29 30 1 0.345 10000 +29 31 1 0.460 10000 +30 31 1 0.368 10000 +33 34 1 0.345 10000 +33 35 1 0.460 10000 +34 35 1 0.368 10000 #endif [ constraints ] #ifndef FLEXIBLE - 1 2 1 0.336 - 1 3 1 0.311 - 2 3 1 0.405 - 4 5 1 0.336 - 4 6 1 0.311 - 5 6 1 0.405 - 7 8 1 0.336 - 7 9 1 0.311 - 8 9 1 0.405 - 10 11 1 0.336 - 10 12 1 0.311 - 11 12 1 0.405 - 13 14 1 0.336 - 13 15 1 0.311 - 14 15 1 0.405 - 16 17 1 0.336 - 16 18 1 0.311 - 17 18 1 0.405 - 19 20 1 0.336 - 19 21 1 0.311 - 20 21 1 0.405 - 22 23 1 0.336 - 22 24 1 0.311 - 23 24 1 0.405 - 25 26 1 0.336 - 25 27 1 0.311 - 26 27 1 0.405 - 28 29 1 0.336 - 28 30 1 0.311 - 29 30 1 0.405 - 31 32 1 0.336 - 31 33 1 0.311 - 32 33 1 0.405 - 34 35 1 0.336 - 34 36 1 0.311 - 35 36 1 0.405 - 37 38 1 0.336 - 37 39 1 0.311 - 38 39 1 0.405 - 40 41 1 0.336 - 40 42 1 0.311 - 41 42 1 0.405 - 43 44 1 0.336 - 43 45 1 0.311 - 44 45 1 0.405 - 46 47 1 0.336 - 46 48 1 0.311 - 47 48 1 0.405 - 49 50 1 0.336 - 49 51 1 0.311 - 50 51 1 0.405 - 52 53 1 0.336 - 52 54 1 0.311 - 53 54 1 0.405 - 55 56 1 0.336 - 55 57 1 0.311 - 56 57 1 0.405 - 58 59 1 0.336 - 58 60 1 0.311 - 59 60 1 0.405 - 61 62 1 0.336 - 61 63 1 0.311 - 62 63 1 0.405 - 64 65 1 0.336 - 64 66 1 0.311 - 65 66 1 0.405 - 67 68 1 0.336 - 67 69 1 0.311 - 68 69 1 0.405 - 70 71 1 0.336 - 70 72 1 0.311 - 71 72 1 0.405 - 73 74 1 0.336 - 73 75 1 0.311 - 74 75 1 0.405 - 76 77 1 0.336 - 76 78 1 0.311 - 77 78 1 0.405 - 79 80 1 0.336 - 79 81 1 0.311 - 80 81 1 0.405 - 82 83 1 0.336 - 82 84 1 0.311 - 83 84 1 0.405 - 85 86 1 0.336 - 85 87 1 0.311 - 86 87 1 0.405 - 88 89 1 0.336 - 88 90 1 0.311 - 89 90 1 0.405 - 91 92 1 0.336 - 91 93 1 0.311 - 92 93 1 0.405 - 94 95 1 0.336 - 94 96 1 0.311 - 95 96 1 0.405 - 97 98 1 0.336 - 97 99 1 0.311 - 98 99 1 0.405 -100 101 1 0.336 -100 102 1 0.311 -101 102 1 0.405 -103 104 1 0.336 -103 105 1 0.311 -104 105 1 0.405 -106 107 1 0.336 -106 108 1 0.311 -107 108 1 0.405 -109 110 1 0.336 -109 111 1 0.311 -110 111 1 0.405 -112 113 1 0.336 -112 114 1 0.311 -113 114 1 0.405 -115 116 1 0.336 -115 117 1 0.311 -116 117 1 0.405 -118 119 1 0.336 -118 120 1 0.311 -119 120 1 0.405 -121 122 1 0.336 -121 123 1 0.311 -122 123 1 0.405 -124 125 1 0.336 -124 126 1 0.311 -125 126 1 0.405 -127 128 1 0.336 -127 129 1 0.311 -128 129 1 0.405 -130 131 1 0.336 -130 132 1 0.311 -131 132 1 0.405 -133 134 1 0.336 -133 135 1 0.311 -134 135 1 0.405 -136 137 1 0.336 -136 138 1 0.311 -137 138 1 0.405 -139 140 1 0.336 -139 141 1 0.311 -140 141 1 0.405 -142 143 1 0.336 -142 144 1 0.311 -143 144 1 0.405 + 1 2 1 0.345 + 1 3 1 0.460 + 2 3 1 0.368 + 5 6 1 0.345 + 5 7 1 0.460 + 6 7 1 0.368 + 9 10 1 0.345 + 9 11 1 0.460 +10 11 1 0.368 +13 14 1 0.345 +13 15 1 0.460 +14 15 1 0.368 +17 18 1 0.345 +17 19 1 0.460 +18 19 1 0.368 +21 22 1 0.345 +21 23 1 0.460 +22 23 1 0.368 +25 26 1 0.345 +25 27 1 0.460 +26 27 1 0.368 +29 30 1 0.345 +29 31 1 0.460 +30 31 1 0.368 +33 34 1 0.345 +33 35 1 0.460 +34 35 1 0.368 #endif [ angles ] -; ABA - a13 - 43 44 46 1 108 180 - 79 80 82 1 108 180 - -; ACA - a16 - 1 3 4 1 122 120 - 4 6 7 1 122 120 - 7 9 10 1 122 120 - 10 12 13 1 122 120 - 13 15 16 1 122 120 - 16 18 19 1 122 120 - 19 21 22 1 122 120 - 22 24 25 1 122 120 - 25 27 28 1 122 120 - 28 30 31 1 122 120 - 31 33 34 1 122 120 - 34 36 37 1 122 120 - 37 39 40 1 122 120 - 40 42 43 1 122 120 - 46 48 49 1 122 120 - 43 45 52 1 122 120 - 52 54 55 1 122 120 - 55 57 58 1 122 120 - 58 60 61 1 122 120 - 61 63 64 1 122 120 - 64 66 67 1 122 120 - 67 69 70 1 122 120 - 70 72 73 1 122 120 - 73 75 76 1 122 120 - 76 78 79 1 122 120 - 82 84 85 1 122 120 - 79 81 88 1 122 120 - 88 90 91 1 122 120 - 91 93 94 1 122 120 - 94 96 97 1 122 120 - 97 99 100 1 122 120 -100 102 103 1 122 120 -103 105 106 1 122 120 -106 108 109 1 122 120 -109 111 112 1 122 120 -112 114 115 1 122 120 -115 117 118 1 122 120 -118 120 121 1 122 120 -121 123 124 1 122 120 -124 126 127 1 122 120 -127 129 130 1 122 120 -130 132 133 1 122 120 -133 135 136 1 122 120 -136 138 139 1 122 120 -139 141 142 1 122 120 - -; BAB - a13 - 44 46 47 1 115 180 - 80 82 83 1 115 180 - -; BAC - a13 - 44 46 48 1 85 162 - 80 82 84 1 85 162 - -; BCA - a16 - 2 6 4 1 76.0 120 - 5 9 7 1 76.0 120 - 8 12 10 1 76.0 120 - 11 15 13 1 76.0 120 - 14 18 16 1 76.0 120 - 17 21 19 1 76.0 120 - 20 24 22 1 76.0 120 - 23 27 25 1 76.0 120 - 26 30 28 1 76.0 120 - 29 33 31 1 76.0 120 - 32 36 34 1 76.0 120 - 35 39 37 1 76.0 120 - 38 42 40 1 76.0 120 - 41 45 43 1 76.0 120 - 47 51 49 1 76.0 120 - 44 54 52 1 76.0 120 - 53 57 55 1 76.0 120 - 56 60 58 1 76.0 120 - 59 63 61 1 76.0 120 - 62 66 64 1 76.0 120 - 65 69 67 1 76.0 120 - 68 72 70 1 76.0 120 - 71 75 73 1 76.0 120 - 74 78 76 1 76.0 120 - 77 81 79 1 76.0 120 - 83 87 85 1 76.0 120 - 80 90 88 1 76.0 120 - 89 93 91 1 76.0 120 - 92 96 94 1 76.0 120 - 95 99 97 1 76.0 120 - 98 102 100 1 76.0 120 -101 105 103 1 76.0 120 -104 108 106 1 76.0 120 -107 111 109 1 76.0 120 -110 114 112 1 76.0 120 -113 117 115 1 76.0 120 -116 120 118 1 76.0 120 -119 123 121 1 76.0 120 -122 126 124 1 76.0 120 -125 129 127 1 76.0 120 -128 132 130 1 76.0 120 -131 135 133 1 76.0 120 -134 138 136 1 76.0 120 -137 141 139 1 76.0 120 -140 144 142 1 76.0 120 - -; CAB - a16 - 3 4 5 1 100 170 - 6 7 8 1 100 170 - 9 10 11 1 100 170 - 12 13 14 1 100 170 - 15 16 17 1 100 170 - 18 19 20 1 100 170 - 21 22 23 1 100 170 - 24 25 26 1 100 170 - 27 28 29 1 100 170 - 30 31 32 1 100 170 - 33 34 35 1 100 170 - 36 37 38 1 100 170 - 39 40 41 1 100 170 - 42 43 44 1 100 170 - 48 49 50 1 100 170 - 45 52 53 1 100 170 - 54 55 56 1 100 170 - 57 58 59 1 100 170 - 60 61 62 1 100 170 - 63 64 65 1 100 170 - 66 67 68 1 100 170 - 69 70 71 1 100 170 - 72 73 74 1 100 170 - 75 76 77 1 100 170 - 78 79 80 1 100 170 - 84 85 86 1 100 170 - 81 88 89 1 100 170 - 90 91 92 1 100 170 - 93 94 95 1 100 170 - 96 97 98 1 100 170 - 99 100 101 1 100 170 -102 103 104 1 100 170 -105 106 107 1 100 170 -108 109 110 1 100 170 -111 112 113 1 100 170 -114 115 116 1 100 170 -117 118 119 1 100 170 -120 121 122 1 100 170 -123 124 125 1 100 170 -126 127 128 1 100 170 -129 130 131 1 100 170 -132 133 134 1 100 170 -135 136 137 1 100 170 -138 139 140 1 100 170 -141 142 143 1 100 170 - -; CAC - a16 - 3 4 6 1 70 170 - 6 7 9 1 70 170 - 9 10 12 1 70 170 - 12 13 15 1 70 170 - 15 16 18 1 70 170 - 18 19 21 1 70 170 - 21 22 24 1 70 170 - 24 25 27 1 70 170 - 27 28 30 1 70 170 - 30 31 33 1 70 170 - 33 34 36 1 70 170 - 36 37 39 1 70 170 - 39 40 42 1 70 170 - 42 43 45 1 70 170 - 48 49 51 1 70 170 - 45 52 54 1 70 170 - 54 55 57 1 70 170 - 57 58 60 1 70 170 - 60 61 63 1 70 170 - 63 64 66 1 70 170 - 66 67 69 1 70 170 - 69 70 72 1 70 170 - 72 73 75 1 70 170 - 75 76 78 1 70 170 - 78 79 81 1 70 170 - 84 85 87 1 70 170 - 81 88 90 1 70 170 - 90 91 93 1 70 170 - 93 94 96 1 70 170 - 96 97 99 1 70 170 - 99 100 102 1 70 170 -102 103 105 1 70 170 -105 106 108 1 70 170 -108 109 111 1 70 170 -111 112 114 1 70 170 -114 115 117 1 70 170 -117 118 120 1 70 170 -120 121 123 1 70 170 -123 124 126 1 70 170 -126 127 129 1 70 170 -129 130 132 1 70 170 -132 133 135 1 70 170 -135 136 138 1 70 170 -138 139 141 1 70 170 -141 142 144 1 70 170 - -; CBA - a13 - 45 44 46 1 180 180 - 81 80 82 1 180 180 + 1 3 5 10 115 160 ; ACA + 3 5 7 10 68 320 ; CAC + 3 5 6 2 100 180 ; CAB + 2 3 5 2 120 50 ; BCA + 5 7 9 10 115 160 ; ACA + 7 9 11 10 68 320 ; CAC + 7 9 10 2 100 180 ; CAB + 6 7 9 2 120 50 ; BCA + 9 11 13 10 115 160 ; ACA +11 13 15 10 68 320 ; CAC +11 13 14 2 100 180 ; CAB +10 11 13 2 120 50 ; BCA +13 15 17 10 115 160 ; ACA +15 17 19 10 68 320 ; CAC +15 17 18 2 100 180 ; CAB +14 15 17 2 120 50 ; BCA +17 19 21 10 115 160 ; ACA +19 21 23 10 68 320 ; CAC +19 21 22 2 100 180 ; CAB +18 19 21 2 120 50 ; BCA +21 23 25 10 115 160 ; ACA +23 25 27 10 68 320 ; CAC +23 25 26 2 100 180 ; CAB +22 23 25 2 120 50 ; BCA +25 27 29 10 115 160 ; ACA +27 29 31 10 68 320 ; CAC +27 29 30 2 100 180 ; CAB +26 27 29 2 120 50 ; BCA +29 31 33 10 115 160 ; ACA +31 33 35 10 68 320 ; CAC +31 33 34 2 100 180 ; CAB +30 31 33 2 120 50 ; BCA + +[ dihedral_restraints ] + 1 3 5 7 1 -120 0.0 4.9 ; ACAC + 5 7 9 11 1 -120 0.0 4.9 ; ACAC + 9 11 13 15 1 -120 0.0 4.9 ; ACAC +13 15 17 19 1 -120 0.0 4.9 ; ACAC +17 19 21 23 1 -120 0.0 4.9 ; ACAC +21 23 25 27 1 -120 0.0 4.9 ; ACAC +25 27 29 31 1 -120 0.0 4.9 ; ACAC +29 31 33 35 1 -120 0.0 4.9 ; ACAC + 3 5 7 9 1 -135 0.0 1.500 ; CACA + 7 9 11 13 1 -135 0.0 1.500 ; CACA +11 13 15 17 1 -135 0.0 1.500 ; CACA +15 17 19 21 1 -135 0.0 1.500 ; CACA +19 21 23 25 1 -135 0.0 1.500 ; CACA +23 25 27 29 1 -135 0.0 1.500 ; CACA +27 29 31 33 1 -135 0.0 1.500 ; CACA [ dihedrals ] -; ACAC - a16 - 1 3 4 6 9 0 12 1 - 1 3 4 6 9 0 8 2 - 4 6 7 9 9 0 12 1 - 4 6 7 9 9 0 8 2 - 7 9 10 12 9 0 12 1 - 7 9 10 12 9 0 8 2 - 10 12 13 15 9 0 12 1 - 10 12 13 15 9 0 8 2 - 13 15 16 18 9 0 12 1 - 13 15 16 18 9 0 8 2 - 16 18 19 21 9 0 12 1 - 16 18 19 21 9 0 8 2 - 19 21 22 24 9 0 12 1 - 19 21 22 24 9 0 8 2 - 22 24 25 27 9 0 12 1 - 22 24 25 27 9 0 8 2 - 25 27 28 30 9 0 12 1 - 25 27 28 30 9 0 8 2 - 28 30 31 33 9 0 12 1 - 28 30 31 33 9 0 8 2 - 31 33 34 36 9 0 12 1 - 31 33 34 36 9 0 8 2 - 34 36 37 39 9 0 12 1 - 34 36 37 39 9 0 8 2 - 37 39 40 42 9 0 12 1 - 37 39 40 42 9 0 8 2 - 40 42 43 45 9 0 12 1 - 40 42 43 45 9 0 8 2 - 46 48 49 51 9 0 12 1 - 46 48 49 51 9 0 8 2 - 43 45 52 54 9 0 12 1 - 43 45 52 54 9 0 8 2 - 52 54 55 57 9 0 12 1 - 52 54 55 57 9 0 8 2 - 55 57 58 60 9 0 12 1 - 55 57 58 60 9 0 8 2 - 58 60 61 63 9 0 12 1 - 58 60 61 63 9 0 8 2 - 61 63 64 66 9 0 12 1 - 61 63 64 66 9 0 8 2 - 64 66 67 69 9 0 12 1 - 64 66 67 69 9 0 8 2 - 67 69 70 72 9 0 12 1 - 67 69 70 72 9 0 8 2 - 70 72 73 75 9 0 12 1 - 70 72 73 75 9 0 8 2 - 73 75 76 78 9 0 12 1 - 73 75 76 78 9 0 8 2 - 76 78 79 81 9 0 12 1 - 76 78 79 81 9 0 8 2 - 82 84 85 87 9 0 12 1 - 82 84 85 87 9 0 8 2 - 79 81 88 90 9 0 12 1 - 79 81 88 90 9 0 8 2 - 88 90 91 93 9 0 12 1 - 88 90 91 93 9 0 8 2 - 91 93 94 96 9 0 12 1 - 91 93 94 96 9 0 8 2 - 94 96 97 99 9 0 12 1 - 94 96 97 99 9 0 8 2 - 97 99 100 102 9 0 12 1 - 97 99 100 102 9 0 8 2 -100 102 103 105 9 0 12 1 -100 102 103 105 9 0 8 2 -103 105 106 108 9 0 12 1 -103 105 106 108 9 0 8 2 -106 108 109 111 9 0 12 1 -106 108 109 111 9 0 8 2 -109 111 112 114 9 0 12 1 -109 111 112 114 9 0 8 2 -112 114 115 117 9 0 12 1 -112 114 115 117 9 0 8 2 -115 117 118 120 9 0 12 1 -115 117 118 120 9 0 8 2 -118 120 121 123 9 0 12 1 -118 120 121 123 9 0 8 2 -121 123 124 126 9 0 12 1 -121 123 124 126 9 0 8 2 -124 126 127 129 9 0 12 1 -124 126 127 129 9 0 8 2 -127 129 130 132 9 0 12 1 -127 129 130 132 9 0 8 2 -130 132 133 135 9 0 12 1 -130 132 133 135 9 0 8 2 -133 135 136 138 9 0 12 1 -133 135 136 138 9 0 8 2 -136 138 139 141 9 0 12 1 -136 138 139 141 9 0 8 2 -139 141 142 144 9 0 12 1 -139 141 142 144 9 0 8 2 - -; CACA - a16 - 3 4 6 7 9 0 4 3 - 3 4 6 7 9 0 2 1 - 6 7 9 10 9 0 4 3 - 6 7 9 10 9 0 2 1 - 9 10 12 13 9 0 4 3 - 9 10 12 13 9 0 2 1 - 12 13 15 16 9 0 4 3 - 12 13 15 16 9 0 2 1 - 15 16 18 19 9 0 4 3 - 15 16 18 19 9 0 2 1 - 18 19 21 22 9 0 4 3 - 18 19 21 22 9 0 2 1 - 21 22 24 25 9 0 4 3 - 21 22 24 25 9 0 2 1 - 24 25 27 28 9 0 4 3 - 24 25 27 28 9 0 2 1 - 27 28 30 31 9 0 4 3 - 27 28 30 31 9 0 2 1 - 30 31 33 34 9 0 4 3 - 30 31 33 34 9 0 2 1 - 33 34 36 37 9 0 4 3 - 33 34 36 37 9 0 2 1 - 36 37 39 40 9 0 4 3 - 36 37 39 40 9 0 2 1 - 39 40 42 43 9 0 4 3 - 39 40 42 43 9 0 2 1 - 42 43 45 52 9 0 4 3 - 42 43 45 52 9 0 2 1 - 45 52 54 55 9 0 4 3 - 45 52 54 55 9 0 2 1 - 54 55 57 58 9 0 4 3 - 54 55 57 58 9 0 2 1 - 57 58 60 61 9 0 4 3 - 57 58 60 61 9 0 2 1 - 60 61 63 64 9 0 4 3 - 60 61 63 64 9 0 2 1 - 63 64 66 67 9 0 4 3 - 63 64 66 67 9 0 2 1 - 66 67 69 70 9 0 4 3 - 66 67 69 70 9 0 2 1 - 69 70 72 73 9 0 4 3 - 69 70 72 73 9 0 2 1 - 72 73 75 76 9 0 4 3 - 72 73 75 76 9 0 2 1 - 75 76 78 79 9 0 4 3 - 75 76 78 79 9 0 2 1 - 78 79 81 88 9 0 4 3 - 78 79 81 88 9 0 2 1 - 81 88 90 91 9 0 4 3 - 81 88 90 91 9 0 2 1 - 90 91 93 94 9 0 4 3 - 90 91 93 94 9 0 2 1 - 93 94 96 97 9 0 4 3 - 93 94 96 97 9 0 2 1 - 96 97 99 100 9 0 4 3 - 96 97 99 100 9 0 2 1 - 99 100 102 103 9 0 4 3 - 99 100 102 103 9 0 2 1 -102 103 105 106 9 0 4 3 -102 103 105 106 9 0 2 1 -105 106 108 109 9 0 4 3 -105 106 108 109 9 0 2 1 -108 109 111 112 9 0 4 3 -108 109 111 112 9 0 2 1 -111 112 114 115 9 0 4 3 -111 112 114 115 9 0 2 1 -114 115 117 118 9 0 4 3 -114 115 117 118 9 0 2 1 -117 118 120 121 9 0 4 3 -117 118 120 121 9 0 2 1 -120 121 123 124 9 0 4 3 -120 121 123 124 9 0 2 1 -123 124 126 127 9 0 4 3 -123 124 126 127 9 0 2 1 -126 127 129 130 9 0 4 3 -126 127 129 130 9 0 2 1 -129 130 132 133 9 0 4 3 -129 130 132 133 9 0 2 1 -132 133 135 136 9 0 4 3 -132 133 135 136 9 0 2 1 -135 136 138 139 9 0 4 3 -135 136 138 139 9 0 2 1 -138 139 141 142 9 0 4 3 -138 139 141 142 9 0 2 1 + 1 3 5 7 9 0 12 1 ; ACAC + 1 3 5 7 9 0 8 2 ; ACAC + 5 7 9 11 9 0 12 1 ; ACAC + 5 7 9 11 9 0 8 2 ; ACAC + 9 11 13 15 9 0 12 1 ; ACAC + 9 11 13 15 9 0 8 2 ; ACAC +13 15 17 19 9 0 12 1 ; ACAC +13 15 17 19 9 0 8 2 ; ACAC +17 19 21 23 9 0 12 1 ; ACAC +17 19 21 23 9 0 8 2 ; ACAC +21 23 25 27 9 0 12 1 ; ACAC +21 23 25 27 9 0 8 2 ; ACAC +25 27 29 31 9 0 12 1 ; ACAC +25 27 29 31 9 0 8 2 ; ACAC +29 31 33 35 9 0 12 1 ; ACAC +29 31 33 35 9 0 8 2 ; ACAC + 3 5 7 9 9 0 4 4 ; CACA + 3 5 7 9 9 90 4 6 ; CACA + 7 9 11 13 9 0 4 4 ; CACA + 7 9 11 13 9 90 4 6 ; CACA +11 13 15 17 9 0 4 4 ; CACA +11 13 15 17 9 90 4 6 ; CACA +15 17 19 21 9 0 4 4 ; CACA +15 17 19 21 9 90 4 6 ; CACA +19 21 23 25 9 0 4 4 ; CACA +19 21 23 25 9 90 4 6 ; CACA +23 25 27 29 9 0 4 4 ; CACA +23 25 27 29 9 90 4 6 ; CACA +27 29 31 33 9 0 4 4 ; CACA +27 29 31 33 9 90 4 6 ; CACA + +[ exclusions ] + 4 1 2 3 + 8 5 6 7 +12 9 10 11 +16 13 14 15 +20 17 18 19 +24 21 22 23 +28 25 26 27 +32 29 30 31 +36 33 34 35 + +[ virtual_sitesn ] + 4 1 1 2 3 + 8 1 5 6 7 +12 1 9 10 11 +16 1 13 14 15 +20 1 17 18 19 +24 1 21 22 23 +28 1 25 26 27 +32 1 29 30 31 +36 1 33 34 35 diff --git a/polyply/tests/test_data/library_tests/martini3/DEX/polyply/command b/polyply/tests/test_data/library_tests/martini3/DEX/polyply/command index d02ec562..cc5f8668 100644 --- a/polyply/tests/test_data/library_tests/martini3/DEX/polyply/command +++ b/polyply/tests/test_data/library_tests/martini3/DEX/polyply/command @@ -1 +1 @@ -polyply gen_itp -lib martini3 -seqf ../input.json -o DEX.itp -name DEX +polyply gen_itp -lib martini3 -seq DEX:9 -o DEX.itp -name DEX From 8b1056269110cf39a076480202e0c283bb96244e Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 15 Jul 2022 15:24:11 +0200 Subject: [PATCH 178/275] add test for CEL --- .../martini3/CEL/polyply/CEL.itp | 1204 +++++++++++++++++ .../martini3/CEL/polyply/command | 1 + 2 files changed, 1205 insertions(+) create mode 100644 polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp create mode 100644 polyply/tests/test_data/library_tests/martini3/CEL/polyply/command diff --git a/polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp b/polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp new file mode 100644 index 00000000..90776e3e --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp @@ -0,0 +1,1204 @@ +;Preliminary model for 50( b(1-->4)GLC) +;testing chain length effect of aggregation + + +[ moleculetype ] +; molname nrexcl + CEL 1 + +[ atoms ] +; nr type resnr residue atom cgnr charge mass + 1 SN6 1 DP50 A 1 0.0 54.0 + 2 SP4r 1 DP50 B 2 0.0 54.0 + 3 SP1r 1 DP50 C 3 0.0 54.0 + 4 TC4 1 DP50 VS 4 0.0 0 ;VS 1 + + 5 SN6 1 DP50 A 5 0.0 36.0 + 6 SP1r 1 DP50 B 6 0.0 54.0 + 7 SP1r 1 DP50 C 7 0.0 54.0 + 8 TC4 1 DP50 VS 8 0.0 0 ;VS 2 + + 9 SN6 1 DP50 A 9 0.0 36.0 + 10 SP1r 1 DP50 B 10 0.0 54.0 + 11 SP1r 1 DP50 C 11 0.0 54.0 + 12 TC4 1 DP50 VS 12 0.0 0 ;VS 3 + + 13 SN6 1 DP50 A 13 0.0 36.0 + 14 SP1r 1 DP50 B 14 0.0 54.0 + 15 SP1r 1 DP50 C 15 0.0 54.0 + 16 TC4 1 DP50 VS 16 0.0 0 ;VS 4 + + 17 SN6 1 DP50 A 17 0.0 36.0 + 18 SP1r 1 DP50 B 18 0.0 54.0 + 19 SP1r 1 DP50 C 19 0.0 54.0 + 20 TC4 1 DP50 VS 20 0.0 0 ;VS 5 + + 21 SN6 1 DP50 A 21 0.0 54.0 + 22 SP1r 1 DP50 B 22 0.0 54.0 + 23 SP1r 1 DP50 C 23 0.0 54.0 + 24 TC4 1 DP50 VS 24 0.0 0 ;VS 6 + + 25 SN6 1 DP50 A 25 0.0 36.0 + 26 SP1r 1 DP50 B 26 0.0 54.0 + 27 SP1r 1 DP50 C 27 0.0 54.0 + 28 TC4 1 DP50 VS 28 0.0 0 ;VS 7 + + 29 SN6 1 DP50 A 29 0.0 36.0 + 30 SP1r 1 DP50 B 30 0.0 54.0 + 31 SP1r 1 DP50 C 31 0.0 54.0 + 32 TC4 1 DP50 VS 32 0.0 0 ;VS 8 + + 33 SN6 1 DP50 A 33 0.0 36.0 + 34 SP1r 1 DP50 B 34 0.0 54.0 + 35 SP1r 1 DP50 C 35 0.0 54.0 + 36 TC4 1 DP50 VS 36 0.0 0 ;VS 9 + + 37 SN6 1 DP50 A 37 0.0 36.0 + 38 SP1r 1 DP50 B 38 0.0 54.0 + 39 SP1r 1 DP50 C 39 0.0 54.0 + 40 TC4 1 DP50 VS 40 0.0 0 ;VS 10 + + 41 SN6 1 DP50 A 41 0.0 36.0 + 42 SP1r 1 DP50 B 42 0.0 54.0 + 43 SP1r 1 DP50 C 43 0.0 54.0 + 44 TC4 1 DP50 VS 44 0.0 0 ;VS 11 + + 45 SN6 1 DP50 A 45 0.0 36.0 + 46 SP1r 1 DP50 B 46 0.0 54.0 + 47 SP1r 1 DP50 C 47 0.0 54.0 + 48 TC4 1 DP50 VS 48 0.0 0 ;VS 12 + + 49 SN6 1 DP50 A 49 0.0 36.0 + 50 SP1r 1 DP50 B 50 0.0 54.0 + 51 SP1r 1 DP50 C 51 0.0 54.0 + 52 TC4 1 DP50 VS 52 0.0 0 ;VS 13 + + 53 SN6 1 DP50 A 53 0.0 36.0 + 54 SP1r 1 DP50 B 54 0.0 54.0 + 55 SP1r 1 DP50 C 55 0.0 54.0 + 56 TC4 1 DP50 VS 56 0.0 0 ;VS 14 + + 57 SN6 1 DP50 A 57 0.0 36.0 + 58 SP1r 1 DP50 B 58 0.0 54.0 + 59 SP1r 1 DP50 C 59 0.0 54.0 + 60 TC4 1 DP50 VS 60 0.0 0 ;VS 15 + + 61 SN6 1 DP50 A 61 0.0 36.0 + 62 SP1r 1 DP50 B 62 0.0 54.0 + 63 SP1r 1 DP50 C 63 0.0 54.0 + 64 TC4 1 DP50 VS 64 0.0 0 ;VS 16 + + 65 SN6 1 DP50 A 65 0.0 36.0 + 66 SP1r 1 DP50 B 66 0.0 54.0 + 67 SP1r 1 DP50 C 67 0.0 54.0 + 68 TC4 1 DP50 VS 68 0.0 0 ;VS 17 + + 69 SN6 1 DP50 A 69 0.0 36.0 + 70 SP1r 1 DP50 B 70 0.0 54.0 + 71 SP1r 1 DP50 C 71 0.0 54.0 + 72 TC4 1 DP50 VS 72 0.0 0 ;VS 18 + + 73 SN6 1 DP50 A 73 0.0 36.0 + 74 SP1r 1 DP50 B 74 0.0 54.0 + 75 SP1r 1 DP50 C 75 0.0 54.0 + 76 TC4 1 DP50 VS 76 0.0 0 ;VS 19 + + 77 SN6 1 DP50 A 77 0.0 36.0 + 78 SP1r 1 DP50 B 38 0.0 54.0 + 79 SP1r 1 DP50 C 79 0.0 54.0 + 80 TC4 1 DP50 VS 80 0.0 0 ;VS 20 + + 81 SN6 1 DP50 A 81 0.0 54.0 + 82 SP1r 1 DP50 B 82 0.0 54.0 + 83 SP1r 1 DP50 C 83 0.0 54.0 + 84 TC4 1 DP50 VS 84 0.0 0 ;VS 21 + + 85 SN6 1 DP50 A 85 0.0 36.0 + 86 SP1r 1 DP50 B 86 0.0 54.0 + 87 SP1r 1 DP50 C 87 0.0 54.0 + 88 TC4 1 DP50 VS 88 0.0 0 ;VS 22 + + 89 SN6 1 DP50 A 89 0.0 36.0 + 90 SP1r 1 DP50 B 90 0.0 54.0 + 91 SP1r 1 DP50 C 91 0.0 54.0 + 92 TC4 1 DP50 VS 92 0.0 0 ;VS 23 + + 93 SN6 1 DP50 A 93 0.0 36.0 + 94 SP1r 1 DP50 B 94 0.0 54.0 + 95 SP1r 1 DP50 C 95 0.0 54.0 + 96 TC4 1 DP50 VS 96 0.0 0 ;VS 24 + + 97 SN6 1 DP50 A 97 0.0 36.0 + 98 SP1r 1 DP50 B 98 0.0 54.0 + 99 SP1r 1 DP50 C 99 0.0 54.0 +100 TC4 1 DP50 VS 100 0.0 0 ;VS 25 + +101 SN6 1 DP50 A 101 0.0 54.0 +102 SP1r 1 DP50 B 102 0.0 54.0 +103 SP1r 1 DP50 C 103 0.0 54.0 +104 TC4 1 DP50 VS 104 0.0 0 ;VS 26 + +105 SN6 1 DP50 A 105 0.0 36.0 +106 SP1r 1 DP50 B 106 0.0 54.0 +107 SP1r 1 DP50 C 107 0.0 54.0 +108 TC4 1 DP50 VS 108 0.0 0 ;VS 27 + +109 SN6 1 DP50 A 109 0.0 36.0 +110 SP1r 1 DP50 B 110 0.0 54.0 +111 SP1r 1 DP50 C 111 0.0 54.0 +112 TC4 1 DP50 VS 112 0.0 0 ;VS 28 + +113 SN6 1 DP50 A 113 0.0 36.0 +114 SP1r 1 DP50 B 114 0.0 54.0 +115 SP1r 1 DP50 C 115 0.0 54.0 +116 TC4 1 DP50 VS 116 0.0 0 ;VS 29 + +117 SN6 1 DP50 A 117 0.0 36.0 +118 SP1r 1 DP50 B 118 0.0 54.0 +119 SP1r 1 DP50 C 119 0.0 54.0 +120 TC4 1 DP50 VS 120 0.0 0 ;VS 30 + +121 SN6 1 DP50 A 121 0.0 36.0 +122 SP1r 1 DP50 B 122 0.0 54.0 +123 SP1r 1 DP50 C 123 0.0 54.0 +124 TC4 1 DP50 VS 124 0.0 0 ;VS 31 + +125 SN6 1 DP50 A 125 0.0 36.0 +126 SP1r 1 DP50 B 126 0.0 54.0 +127 SP1r 1 DP50 C 127 0.0 54.0 +128 TC4 1 DP50 VS 128 0.0 0 ;VS 32 + +129 SN6 1 DP50 A 129 0.0 36.0 +130 SP1r 1 DP50 B 130 0.0 54.0 +131 SP1r 1 DP50 C 131 0.0 54.0 +132 TC4 1 DP50 VS 132 0.0 0 ;VS 33 + +133 SN6 1 DP50 A 133 0.0 36.0 +134 SP1r 1 DP50 B 134 0.0 54.0 +135 SP1r 1 DP50 C 135 0.0 54.0 +136 TC4 1 DP50 VS 136 0.0 0 ;VS 34 + +137 SN6 1 DP50 A 137 0.0 36.0 +138 SP1r 1 DP50 B 138 0.0 54.0 +139 SP1r 1 DP50 C 139 0.0 54.0 +140 TC4 1 DP50 VS 140 0.0 0 ;VS 35 + +141 SN6 1 DP50 A 141 0.0 36.0 +142 SP1r 1 DP50 B 142 0.0 54.0 +143 SP1r 1 DP50 C 143 0.0 54.0 +144 TC4 1 DP50 VS 144 0.0 0 ;VS 36 + +145 SN6 1 DP50 A 145 0.0 36.0 +146 SP1r 1 DP50 B 146 0.0 54.0 +147 SP1r 1 DP50 C 147 0.0 54.0 +148 TC4 1 DP50 VS 148 0.0 0 ;VS 37 + +149 SN6 1 DP50 A 149 0.0 36.0 +150 SP1r 1 DP50 B 150 0.0 54.0 +151 SP1r 1 DP50 C 151 0.0 54.0 +152 TC4 1 DP50 VS 152 0.0 0 ;VS 38 + +153 SN6 1 DP50 A 153 0.0 36.0 +154 SP1r 1 DP50 B 154 0.0 54.0 +155 SP1r 1 DP50 C 155 0.0 54.0 +156 TC4 1 DP50 VS 156 0.0 0 ;VS 39 + +157 SN6 1 DP50 A 157 0.0 36.0 +158 SP1r 1 DP50 B 158 0.0 54.0 +159 SP1r 1 DP50 C 159 0.0 54.0 +160 TC4 1 DP50 VS 160 0.0 0 ;VS 40 + +161 SN6 1 DP50 A 161 0.0 36.0 +162 SP1r 1 DP50 B 162 0.0 54.0 +163 SP1r 1 DP50 C 163 0.0 54.0 +164 TC4 1 DP50 VS 164 0.0 0 ;VS 41 + +165 SN6 1 DP50 A 165 0.0 36.0 +166 SP1r 1 DP50 B 166 0.0 54.0 +167 SP1r 1 DP50 C 167 0.0 54.0 +168 TC4 1 DP50 VS 168 0.0 0 ;VS 42 + +169 SN6 1 DP50 A 169 0.0 36.0 +170 SP1r 1 DP50 B 170 0.0 54.0 +171 SP1r 1 DP50 C 171 0.0 54.0 +172 TC4 1 DP50 VS 172 0.0 0 ;VS 43 + +173 SN6 1 DP50 A 173 0.0 36.0 +174 SP1r 1 DP50 B 174 0.0 54.0 +175 SP1r 1 DP50 C 175 0.0 54.0 +176 TC4 1 DP50 VS 176 0.0 0 ;VS 44 + +177 SN6 1 DP50 A 177 0.0 36.0 +178 SP1r 1 DP50 B 178 0.0 54.0 +179 SP1r 1 DP50 C 179 0.0 54.0 +180 TC4 1 DP50 VS 180 0.0 0 ;VS 45 + +181 SN6 1 DP50 A 181 0.0 36.0 +182 SP1r 1 DP50 B 182 0.0 54.0 +183 SP1r 1 DP50 C 183 0.0 54.0 +184 TC4 1 DP50 VS 184 0.0 0 ;VS 46 + +185 SN6 1 DP50 A 185 0.0 36.0 +186 SP1r 1 DP50 B 186 0.0 54.0 +187 SP1r 1 DP50 C 187 0.0 54.0 +188 TC4 1 DP50 VS 188 0.0 0 ;VS 47 + +189 SN6 1 DP50 A 189 0.0 36.0 +190 SP1r 1 DP50 B 190 0.0 54.0 +191 SP1r 1 DP50 C 191 0.0 54.0 +192 TC4 1 DP50 VS 192 0.0 0 ;VS 48 + +193 SN6 1 DP50 A 193 0.0 36.0 +194 SP1r 1 DP50 B 194 0.0 54.0 +195 SP1r 1 DP50 C 195 0.0 54.0 +196 TC4 1 DP50 VS 196 0.0 0 ;VS 49 + +197 SP4r 1 DP50 A 197 0.0 36.0 +198 SP1r 1 DP50 B 198 0.0 54.0 +199 SP1r 1 DP50 C 199 0.0 54.0 +200 TC4 1 DP50 VS 200 0.0 0 ;VS 50 + + +[ bonds ] +; Not scaled. +; i j funct length fc + 2 5 1 0.355 8500 + 6 9 1 0.355 8500 + 10 13 1 0.355 8500 + 14 17 1 0.355 8500 + 18 21 1 0.355 8500 + 22 25 1 0.355 8500 + 26 29 1 0.355 8500 + 30 33 1 0.355 8500 + 34 37 1 0.355 8500 + 38 41 1 0.355 8500 + 42 45 1 0.355 8500 + 46 49 1 0.355 8500 + 50 53 1 0.355 8500 + 54 57 1 0.355 8500 + 58 61 1 0.355 8500 + 62 65 1 0.355 8500 + 66 69 1 0.355 8500 + 70 73 1 0.355 8500 + 74 77 1 0.355 8500 + 78 81 1 0.355 8500 + 82 85 1 0.355 8500 + 86 89 1 0.355 8500 + 90 93 1 0.355 8500 + 94 97 1 0.355 8500 + 98 101 1 0.355 8500 + 102 105 1 0.355 8500 + 106 109 1 0.355 8500 + 110 113 1 0.355 8500 + 114 117 1 0.355 8500 + 118 121 1 0.355 8500 + 122 125 1 0.355 8500 + 126 129 1 0.355 8500 + 130 133 1 0.355 8500 + 134 137 1 0.355 8500 + 138 141 1 0.355 8500 + 142 145 1 0.355 8500 + 146 149 1 0.355 8500 + 150 153 1 0.355 8500 + 154 157 1 0.355 8500 + 158 161 1 0.355 8500 + 162 165 1 0.355 8500 + 166 169 1 0.355 8500 + 170 173 1 0.355 8500 + 174 177 1 0.355 8500 + 178 181 1 0.355 8500 + 182 185 1 0.355 8500 + 186 189 1 0.355 8500 + 190 193 1 0.355 8500 + 194 197 1 0.355 8500 +#ifdef FLEXIBLE + 1 2 1 0.320 10000 + 1 3 1 0.470 10000 + 2 3 1 0.390 10000 + 5 6 1 0.320 10000 + 5 7 1 0.470 10000 + 6 7 1 0.390 10000 + 9 10 1 0.320 10000 + 9 11 1 0.470 10000 + 10 11 1 0.390 10000 + 13 14 1 0.320 10000 + 13 15 1 0.470 10000 + 14 15 1 0.390 10000 + 17 18 1 0.320 10000 + 17 19 1 0.470 10000 + 18 19 1 0.390 10000 + 21 22 1 0.320 10000 + 21 23 1 0.470 10000 + 22 23 1 0.390 10000 + 25 26 1 0.320 10000 + 25 27 1 0.470 10000 + 26 27 1 0.390 10000 + 29 30 1 0.320 10000 + 29 31 1 0.470 10000 + 30 31 1 0.390 10000 + 33 34 1 0.320 10000 + 33 35 1 0.470 10000 + 34 35 1 0.390 10000 + 37 38 1 0.320 10000 + 37 39 1 0.470 10000 + 38 39 1 0.390 10000 + 41 42 1 0.320 10000 + 41 43 1 0.470 10000 + 42 43 1 0.390 10000 + 45 46 1 0.320 10000 + 45 47 1 0.470 10000 + 46 47 1 0.390 10000 + 49 50 1 0.320 10000 + 49 51 1 0.470 10000 + 50 51 1 0.390 10000 + 53 54 1 0.320 10000 + 53 55 1 0.470 10000 + 54 55 1 0.390 10000 + 57 58 1 0.320 10000 + 57 59 1 0.470 10000 + 58 59 1 0.390 10000 + 61 62 1 0.320 10000 + 61 63 1 0.470 10000 + 62 63 1 0.390 10000 + 65 66 1 0.320 10000 + 65 67 1 0.470 10000 + 66 67 1 0.390 10000 + 69 70 1 0.320 10000 + 69 71 1 0.470 10000 + 70 71 1 0.390 10000 + 73 74 1 0.320 10000 + 73 75 1 0.470 10000 + 74 75 1 0.390 10000 + 77 78 1 0.320 10000 + 77 79 1 0.470 10000 + 78 79 1 0.390 10000 + 81 82 1 0.320 10000 + 81 83 1 0.470 10000 + 82 83 1 0.390 10000 + 85 86 1 0.320 10000 + 85 87 1 0.470 10000 + 86 87 1 0.390 10000 + 89 90 1 0.320 10000 + 89 91 1 0.470 10000 + 90 91 1 0.390 10000 + 93 94 1 0.320 10000 + 93 95 1 0.470 10000 + 94 95 1 0.390 10000 + 97 98 1 0.320 10000 + 97 99 1 0.470 10000 + 98 99 1 0.390 10000 + 101 102 1 0.320 10000 + 101 103 1 0.470 10000 + 102 103 1 0.390 10000 + 105 106 1 0.320 10000 + 105 107 1 0.470 10000 + 106 107 1 0.390 10000 + 109 110 1 0.320 10000 + 109 111 1 0.470 10000 + 110 111 1 0.390 10000 + 113 114 1 0.320 10000 + 113 115 1 0.470 10000 + 114 115 1 0.390 10000 + 117 118 1 0.320 10000 + 117 119 1 0.470 10000 + 118 119 1 0.390 10000 + 121 122 1 0.320 10000 + 121 123 1 0.470 10000 + 122 123 1 0.390 10000 + 125 126 1 0.320 10000 + 125 127 1 0.470 10000 + 126 127 1 0.390 10000 + 129 130 1 0.320 10000 + 129 131 1 0.470 10000 + 130 131 1 0.390 10000 + 133 134 1 0.320 10000 + 133 135 1 0.470 10000 + 134 135 1 0.390 10000 + 137 138 1 0.320 10000 + 137 139 1 0.470 10000 + 138 139 1 0.390 10000 + 141 142 1 0.320 10000 + 141 143 1 0.470 10000 + 142 143 1 0.390 10000 + 145 146 1 0.320 10000 + 145 147 1 0.470 10000 + 146 147 1 0.390 10000 + 149 150 1 0.320 10000 + 149 151 1 0.470 10000 + 150 151 1 0.390 10000 + 153 154 1 0.320 10000 + 153 155 1 0.470 10000 + 154 155 1 0.390 10000 + 157 158 1 0.320 10000 + 157 159 1 0.470 10000 + 158 159 1 0.390 10000 + 161 162 1 0.320 10000 + 161 163 1 0.470 10000 + 162 163 1 0.390 10000 + 165 166 1 0.320 10000 + 165 167 1 0.470 10000 + 166 167 1 0.390 10000 + 169 170 1 0.320 10000 + 169 171 1 0.470 10000 + 170 171 1 0.390 10000 + 173 174 1 0.320 10000 + 173 175 1 0.470 10000 + 174 175 1 0.390 10000 + 177 178 1 0.320 10000 + 177 179 1 0.470 10000 + 178 179 1 0.390 10000 + 181 182 1 0.320 10000 + 181 183 1 0.470 10000 + 182 183 1 0.390 10000 + 185 186 1 0.320 10000 + 185 187 1 0.470 10000 + 186 187 1 0.390 10000 + 189 190 1 0.320 10000 + 189 191 1 0.470 10000 + 190 191 1 0.390 10000 + 193 194 1 0.320 10000 + 193 195 1 0.470 10000 + 194 195 1 0.390 10000 + 197 198 1 0.320 10000 + 197 199 1 0.470 10000 + 198 199 1 0.390 10000 +#endif + +#ifndef FLEXIBLE +[ constraints ] +; Scaled by 15 % +; i j funct length + 1 2 1 0.320 + 1 3 1 0.470 + 2 3 1 0.390 + 5 6 1 0.320 + 5 7 1 0.470 + 6 7 1 0.390 + 9 10 1 0.320 + 9 11 1 0.470 + 10 11 1 0.390 + 13 14 1 0.320 + 13 15 1 0.470 + 14 15 1 0.390 + 17 18 1 0.320 + 17 19 1 0.470 + 18 19 1 0.390 + 21 22 1 0.320 + 21 23 1 0.470 + 22 23 1 0.390 + 25 26 1 0.320 + 25 27 1 0.470 + 26 27 1 0.390 + 29 30 1 0.320 + 29 31 1 0.470 + 30 31 1 0.390 + 33 34 1 0.320 + 33 35 1 0.470 + 34 35 1 0.390 + 37 38 1 0.320 + 37 39 1 0.470 + 38 39 1 0.390 + 41 42 1 0.320 + 41 43 1 0.470 + 42 43 1 0.390 + 45 46 1 0.320 + 45 47 1 0.470 + 46 47 1 0.390 + 49 50 1 0.320 + 49 51 1 0.470 + 50 51 1 0.390 + 53 54 1 0.320 + 53 55 1 0.470 + 54 55 1 0.390 + 57 58 1 0.320 + 57 59 1 0.470 + 58 59 1 0.390 + 61 62 1 0.320 + 61 63 1 0.470 + 62 63 1 0.390 + 65 66 1 0.320 + 65 67 1 0.470 + 66 67 1 0.390 + 69 70 1 0.320 + 69 71 1 0.470 + 70 71 1 0.390 + 73 74 1 0.320 + 73 75 1 0.470 + 74 75 1 0.390 + 77 78 1 0.320 + 77 79 1 0.470 + 78 79 1 0.390 + 81 82 1 0.320 + 81 83 1 0.470 + 82 83 1 0.390 + 85 86 1 0.320 + 85 87 1 0.470 + 86 87 1 0.390 + 89 90 1 0.320 + 89 91 1 0.470 + 90 91 1 0.390 + 93 94 1 0.320 + 93 95 1 0.470 + 94 95 1 0.390 + 97 98 1 0.320 + 97 99 1 0.470 + 98 99 1 0.390 + 101 102 1 0.320 + 101 103 1 0.470 + 102 103 1 0.390 + 105 106 1 0.320 + 105 107 1 0.470 + 106 107 1 0.390 + 109 110 1 0.320 + 109 111 1 0.470 + 110 111 1 0.390 + 113 114 1 0.320 + 113 115 1 0.470 + 114 115 1 0.390 + 117 118 1 0.320 + 117 119 1 0.470 + 118 119 1 0.390 + 121 122 1 0.320 + 121 123 1 0.470 + 122 123 1 0.390 + 125 126 1 0.320 + 125 127 1 0.470 + 126 127 1 0.390 + 129 130 1 0.320 + 129 131 1 0.470 + 130 131 1 0.390 + 133 134 1 0.320 + 133 135 1 0.470 + 134 135 1 0.390 + 137 138 1 0.320 + 137 139 1 0.470 + 138 139 1 0.390 + 141 142 1 0.320 + 141 143 1 0.470 + 142 143 1 0.390 + 145 146 1 0.320 + 145 147 1 0.470 + 146 147 1 0.390 + 149 150 1 0.320 + 149 151 1 0.470 + 150 151 1 0.390 + 153 154 1 0.320 + 153 155 1 0.470 + 154 155 1 0.390 + 157 158 1 0.320 + 157 159 1 0.470 + 158 159 1 0.390 + 161 162 1 0.320 + 161 163 1 0.470 + 162 163 1 0.390 + 165 166 1 0.320 + 165 167 1 0.470 + 166 167 1 0.390 + 169 170 1 0.320 + 169 171 1 0.470 + 170 171 1 0.390 + 173 174 1 0.320 + 173 175 1 0.470 + 174 175 1 0.390 + 177 178 1 0.320 + 177 179 1 0.470 + 178 179 1 0.390 + 181 182 1 0.320 + 181 183 1 0.470 + 182 183 1 0.390 + 185 186 1 0.320 + 185 187 1 0.470 + 186 187 1 0.390 + 189 190 1 0.320 + 189 191 1 0.470 + 190 191 1 0.390 + 193 194 1 0.320 + 193 195 1 0.470 + 194 195 1 0.390 + 197 198 1 0.320 + 197 199 1 0.470 + 198 199 1 0.390 +#endif + +[angles] +; i j k funct angle fc + ;; 1 --> 2 + 1 2 5 1 155 320 ; A - B - A' + 2 5 6 1 120 220 ; B - A' - B' + 2 5 7 1 70 230 ; B - A' - C' + 3 2 5 1 75 260 ; C - B - A' + ;; 2 --> 3 + 5 6 9 1 155 320 ; A - B - A' + 6 9 10 1 120 220 ; B - A' - B' + 6 9 11 1 70 230 ; B - A' - C' + 7 6 9 1 75 260 ; C - B - A' + ;; 3 --> 4 + 9 10 13 1 155 320 ; A - B - A' + 10 13 14 1 120 220 ; B - A' - B' + 10 13 15 1 70 230 ; B - A' - C' + 11 10 13 1 75 260 ; C - B - A' + ;; 4 --> 5 + 13 14 17 1 155 320 ; A - B - A' + 14 17 18 1 120 220 ; B - A' - B' + 14 17 19 1 70 230 ; B - A' - C' + 15 14 17 1 75 260 ; C - B - A' + ;; 5 --> 6 + 17 18 21 1 155 320 ; A - B - A' + 18 21 22 1 120 220 ; B - A' - B' + 18 21 23 1 70 230 ; B - A' - C' + 19 18 21 1 75 260 ; C - B - A' + ;; 6 --> 7 + 21 22 25 1 155 320 ; A - B - A' + 22 25 26 1 120 220 ; B - A' - B' + 22 25 27 1 70 230 ; B - A' - C' + 23 22 25 1 75 260 ; C - B - A' + ;; 7 --> 8 + 25 26 29 1 155 320 ; A - B - A' + 26 29 30 1 120 220 ; B - A' - B' + 26 29 31 1 70 230 ; B - A' - C' + 27 26 29 1 75 260 ; C - B - A' + ;; 8 --> 9 + 29 30 33 1 155 320 ; A - B - A' + 30 33 34 1 120 220 ; B - A' - B' + 30 33 35 1 70 230 ; B - A' - C' + 31 30 33 1 75 260 ; C - B - A' + ;; 9 --> 10 + 33 34 37 1 155 320 ; A - B - A' + 34 37 38 1 120 220 ; B - A' - B' + 34 37 39 1 70 230 ; B - A' - C' + 35 34 37 1 75 260 ; C - B - A' + ;; 10 --> 11 + 37 38 41 1 155 320 ; A - B - A' + 38 41 42 1 120 220 ; B - A' - B' + 38 41 43 1 70 230 ; B - A' - C' + 39 38 41 1 75 260 ; C - B - A' + ;; 11 --> 12 + 41 42 45 1 155 320 ; A - B - A' + 42 45 46 1 120 220 ; B - A' - B' + 42 45 47 1 70 230 ; B - A' - C' + 43 42 45 1 75 260 ; C - B - A' + ;; 12 --> 13 + 45 46 49 1 155 320 ; A - B - A' + 46 49 50 1 120 220 ; B - A' - B' + 46 49 51 1 70 230 ; B - A' - C' + 47 46 49 1 75 260 ; C - B - A' + ;; 13 --> 14 + 49 50 53 1 155 320 ; A - B - A' + 50 53 54 1 120 220 ; B - A' - B' + 50 53 55 1 70 230 ; B - A' - C' + 51 50 53 1 75 260 ; C - B - A' + ;;14 --> 15 + 53 54 57 1 155 320 ; A - B - A' + 54 57 58 1 120 220 ; B - A' - B' + 54 57 59 1 70 230 ; B - A' - C' + 55 54 57 1 75 260 ; C - B - A' + + ;;15 --> 16 + 57 58 61 1 155 320 ; A - B - A' + 58 61 62 1 120 220 ; B - A' - B' + 58 61 63 1 70 230 ; B - A' - C' + 59 58 61 1 75 260 ; C - B - A' + ;; 16 --> 17 + 61 62 65 1 155 320 ; A - B - A' + 62 65 66 1 120 220 ; B - A' - B' + 62 65 67 1 70 230 ; B - A' - C' + 63 62 65 1 75 260 ; C - B - A' + ;; 17 --> 18 + 65 66 69 1 155 320 ; A - B - A' + 66 69 70 1 120 220 ; B - A' - B' + 66 69 71 1 70 230 ; B - A' - C' + 67 66 69 1 75 260 ; C - B - A' + ;; 18 --> 19 + 69 70 73 1 155 320 ; A - B - A' + 70 73 74 1 120 220 ; B - A' - B' + 70 73 75 1 70 230 ; B - A' - C' + 71 70 73 1 75 260 ; C - B - A' + ;; 19 --> 20 + 73 74 77 1 155 320 ; A - B - A' + 74 77 78 1 120 220 ; B - A' - B' + 74 77 79 1 70 230 ; B - A' - C' + 75 74 77 1 75 260 ; C - B - A' + + ;; 20 --> 21 + 77 78 81 1 155 320 ; A - B - A' + 78 81 82 1 120 220 ; B - A' - B' + 78 81 83 1 70 230 ; B - A' - C' + 79 78 81 1 75 260 ; C - B - A' + + ;; 21 --> 22 + 81 82 85 1 155 320 ; A - B - A' + 82 85 86 1 120 220 ; B - A' - B' + 82 85 87 1 70 230 ; B - A' - C' + 83 82 85 1 75 260 ; C - B - A' + + ;; 22 --> 23 + 85 86 89 1 155 320 ; A - B - A' + 86 89 90 1 120 220 ; B - A' - B' + 86 89 91 1 70 230 ; B - A' - C' + 87 86 89 1 75 260 ; C - B - A' + + ;; 23 --> 24 + 89 90 93 1 155 320 ; A - B - A' + 90 93 94 1 120 220 ; B - A' - B' + 90 93 95 1 70 230 ; B - A' - C' + 91 90 93 1 75 260 ; C - B - A' + + ;; 24 --> 25 + 93 94 97 1 155 320 ; A - B - A' + 94 97 98 1 120 220 ; B - A' - B' + 94 97 99 1 70 230 ; B - A' - C' + 95 94 97 1 75 260 ; C - B - A' + + ;; 25 --> 26 + 97 98 101 1 155 320 ; A - B - A' + 98 101 102 1 120 220 ; B - A' - B' + 98 101 103 1 70 230 ; B - A' - C' + 99 98 101 1 75 260 ; C - B - A' + + ;; 26 --> 27 + 101 102 105 1 155 320 ; A - B - A' + 102 105 106 1 120 220 ; B - A' - B' + 102 105 107 1 70 230 ; B - A' - C' + 103 102 105 1 75 260 ; C - B - A' + + ;; 27 --> 28 + 105 106 109 1 155 320 ; A - B - A' + 106 109 110 1 120 220 ; B - A' - B' + 106 109 111 1 70 230 ; B - A' - C' + 107 106 109 1 75 260 ; C - B - A' + + ;; 28 --> 29 + 109 110 113 1 155 320 ; A - B - A' + 110 113 114 1 120 220 ; B - A' - B' + 110 113 115 1 70 230 ; B - A' - C' + 111 110 113 1 75 260 ; C - B - A' + + ;; 29 --> 30 + 113 114 117 1 155 320 ; A - B - A' + 114 117 118 1 120 220 ; B - A' - B' + 114 117 119 1 70 230 ; B - A' - C' + 115 114 117 1 75 260 ; C - B - A' + + ;; 30 --> 31 + 117 118 121 1 155 320 ; A - B - A' + 118 121 122 1 120 220 ; B - A' - B' + 118 121 123 1 70 230 ; B - A' - C' + 119 118 121 1 75 260 ; C - B - A' + + ;; 31 --> 32 + 121 122 125 1 155 320 ; A - B - A' + 122 125 126 1 120 220 ; B - A' - B' + 122 125 127 1 70 230 ; B - A' - C' + 123 122 125 1 75 260 ; C - B - A' + + ;; 32 --> 33 + 125 126 129 1 155 320 ; A - B - A' + 126 129 130 1 120 220 ; B - A' - B' + 126 129 131 1 70 230 ; B - A' - C' + 127 126 129 1 75 260 ; C - B - A' + + ;; 33 --> 34 + 129 130 133 1 155 320 ; A - B - A' + 130 133 134 1 120 220 ; B - A' - B' + 130 133 135 1 70 230 ; B - A' - C' + 131 130 133 1 75 260 ; C - B - A' + + ;; 34 --> 35 + 133 134 137 1 155 320 ; A - B - A' + 134 137 138 1 120 220 ; B - A' - B' + 134 137 139 1 70 230 ; B - A' - C' + 135 134 137 1 75 260 ; C - B - A' + + ;; 35 --> 36 + 137 138 141 1 155 320 ; A - B - A' + 138 141 142 1 120 220 ; B - A' - B' + 138 141 143 1 70 230 ; B - A' - C' + 139 138 141 1 75 260 ; C - B - A' + + ;; 36 --> 37 + 141 142 145 1 155 320 ; A - B - A' + 142 145 146 1 120 220 ; B - A' - B' + 142 145 147 1 70 230 ; B - A' - C' + 143 142 145 1 75 260 ; C - B - A' + + ;; 37 --> 38 + 145 146 149 1 155 320 ; A - B - A' + 146 149 150 1 120 220 ; B - A' - B' + 146 149 151 1 70 230 ; B - A' - C' + 147 146 149 1 75 260 ; C - B - A' + + ;; 38 --> 39 + 149 150 153 1 155 320 ; A - B - A' + 150 153 154 1 120 220 ; B - A' - B' + 150 153 155 1 70 230 ; B - A' - C' + 151 150 153 1 75 260 ; C - B - A' + + ;; 39 --> 40 + 153 154 157 1 155 320 ; A - B - A' + 154 157 158 1 120 220 ; B - A' - B' + 154 157 159 1 70 230 ; B - A' - C' + 155 154 157 1 75 260 ; C - B - A' + + ;; 40 --> 41 + 157 158 161 1 155 320 ; A - B - A' + 158 161 162 1 120 220 ; B - A' - B' + 158 161 163 1 70 230 ; B - A' - C' + 159 158 161 1 75 260 ; C - B - A' + + ;; 41 --> 42 + 161 162 165 1 155 320 ; A - B - A' + 162 165 166 1 120 220 ; B - A' - B' + 162 165 167 1 70 230 ; B - A' - C' + 163 162 165 1 75 260 ; C - B - A' + + ;; 42 --> 43 + 165 166 169 1 155 320 ; A - B - A' + 166 169 170 1 120 220 ; B - A' - B' + 166 169 171 1 70 230 ; B - A' - C' + 167 166 169 1 75 260 ; C - B - A' + + ;; 43 --> 44 + 169 170 173 1 155 320 ; A - B - A' + 170 173 174 1 120 220 ; B - A' - B' + 170 173 175 1 70 230 ; B - A' - C' + 171 170 173 1 75 260 ; C - B - A' + + ;; 44 --> 45 + 173 174 177 1 155 320 ; A - B - A' + 174 177 178 1 120 220 ; B - A' - B' + 174 177 179 1 70 230 ; B - A' - C' + 175 174 177 1 75 260 ; C - B - A' + + ;; 45 --> 46 + 177 178 181 1 155 320 ; A - B - A' + 178 181 182 1 120 220 ; B - A' - B' + 178 181 183 1 70 230 ; B - A' - C' + 179 178 181 1 75 260 ; C - B - A' + + ;; 46 --> 47 + 181 182 185 1 155 320 ; A - B - A' + 182 185 186 1 120 220 ; B - A' - B' + 182 185 187 1 70 230 ; B - A' - C' + 183 182 185 1 75 260 ; C - B - A' + + ;; 47 --> 48 + 185 186 189 1 155 320 ; A - B - A' + 186 189 190 1 120 220 ; B - A' - B' + 186 189 191 1 70 230 ; B - A' - C' + 187 186 189 1 75 260 ; C - B - A' + + ;; 48 --> 49 + 189 190 193 1 155 320 ; A - B - A' + 190 193 194 1 120 220 ; B - A' - B' + 190 193 195 1 70 230 ; B - A' - C' + 191 190 193 1 75 260 ; C - B - A' + + ;; 49 --> 50 + 193 194 197 1 155 320 ; A - B - A' + 194 197 198 1 120 220 ; B - A' - B' + 194 197 199 1 70 230 ; B - A' - C' + 195 194 197 1 75 260 ; C - B - A' + +[ dihedrals ] +; i j k l funct angle fc multiplicity + ;; 1 --> 2 --> 3 + 1 2 5 6 2 -125 30 ; 1 ; A - B - A' - B' + 2 5 6 9 2 5 15 ; 1 ; B - A' - B' - A" + + ;; 2 --> 3 --> 4 + 5 6 9 10 2 -125 30 ; 1 ; A - B - A' - B' + 6 9 10 13 2 5 15 ; 1 ; B - A' - B' - A" + + ;; 3 --> 4 --> 5 + 9 10 13 14 2 -125 30 ; 1 ; A - B - A' - B' + 10 13 14 17 2 5 15 ; 1 ; B - A' - B' - A" + + ;; 4 --> 5 --> 6 + 13 14 17 18 2 -125 30 ; 1 ; A - B - A' - B' + 14 17 18 21 2 5 15 ; 1 ; B - A' - B' - A" + + ;; 5 --> 6 --> 7 + 17 18 21 22 2 -125 30 ; 1 ; A - B - A' - B' + 18 21 22 25 2 5 15 ; 1 ; B - A' - B' - A" + + ;; 6 --> 7 --> 8 + 21 22 25 26 2 -125 30 ; 1 ; A - B - A' - B' + 22 25 26 29 2 5 15 ; 1 ; B - A' - B' - A" + + ;; 7 --> 8 --> 9 + 25 26 29 30 2 -125 30 ;1 ; A - B - A' - B' + 26 29 30 33 2 5 15 ;1 ; B - A' - B' - A" + + ;; 8 --> 9 --> 10 + 29 30 33 34 2 -125 30 ;1 ; A - B - A' - B' + 30 33 34 37 2 5 15 ;1 ; B - A' - B' - A" + + ;; 9 --> 10 --> 11 + 33 34 37 38 2 -125 30 ;1 ; A - B - A' - B' + 34 37 38 41 2 5 15 ;1 ; B - A' - B' - A" + + ;;10 --> 11 --> 12 + 37 38 41 42 2 -125 30 ;1 ; A - B - A' - B' + 38 41 42 45 2 5 15 ;1 ; B - A' - B' - A" + + ;;10 --> 11 --> 12 + 41 42 45 46 2 -125 30 ;1 ; A - B - A' - B' + 42 45 46 49 2 5 15 ;1 ; B - A' - B' - A" + + ;;11 --> 12 --> 13 + 45 46 49 50 2 -125 30 ;1 ; A - B - A' - B' + 46 49 50 53 2 5 15 ;1 ; B - A' - B' - A" + + ;;12 --> 13 --> 14 + 49 50 53 54 2 -125 30 ;1 ; A - B - A' - B' + 50 53 54 57 2 5 15 ;1 ; B - A' - B' - A" + + ;;13 -->14 --> 15 + 53 54 57 58 2 -125 30 ;1 ; A - B - A' - B' + 54 57 58 61 2 5 15 ;1 ; B - A' - B' - A" + + ;;14 --> 15 --> 16 + 57 58 61 62 2 -125 30 ;1 ; A - B - A' - B' + 58 61 62 65 2 5 15 ;1 ; B - A' - B' - A" + + ;;15 --> 16 --> 17 + 61 62 65 66 2 -125 30 ;1 ; A - B - A' - B' + 62 65 66 69 2 5 15 ;1 ; B - A' - B' - A" + + ;;16 --> 17 --> 18 + 65 66 69 70 2 -125 30 ;1 ; A - B - A' - B' + 66 69 70 73 2 5 15 ;1 ; B - A' - B' - A" + + ;;17 --> 18 --> 19 + 69 70 73 74 2 -125 30 ;1 ; A - B - A' - B' + 70 73 74 77 2 5 15 ;1 ; B - A' - B' - A" + + ;;18 --> 19 --> 20 + 73 74 77 78 2 -125 30 ;1 ; A - B - A' - B' + 74 77 78 81 2 5 15 ;1 ; B - A' - B' - A" + + ;;18 --> 20 --> 21 + 77 78 81 82 2 -125 30 ;1 ; A - B - A' - B' + 78 81 82 85 2 5 15 ;1 ; B - A' - B' - A" + + ;;20 --> 21 --> 22 + 81 82 85 86 2 -125 30 ;1 ; A - B - A' - B' + 82 85 86 89 2 5 15 ;1 ; B - A' - B' - A" + + ;;21 --> 22 --> 23 + 85 86 89 90 2 -125 30 ;1 ; A - B - A' - B' + 86 89 90 93 2 5 15 ;1 ; B - A' - B' - A" + + ;;22 --> 23 --> 24 + 89 90 93 94 2 -125 30 ;1 ; A - B - A' - B' + 90 93 94 97 2 5 15 ;1 ; B - A' - B' - A" + + ;;23 --> 24 --> 25 + 93 94 97 98 2 -125 30 ;1 ; A - B - A' - B' + 94 97 98 101 2 5 15 ;1 ; B - A' - B' - A" + + ;;24 --> 25 --> 26 + 97 98 101 102 2 -125 30 ;1 ; A - B - A' - B' + 98 101 102 105 2 5 15 ;1 ; B - A' - B' - A" + + ;;25 --> 26 --> 27 +101 102 105 106 2 -125 30 ;1 ; A - B - A' - B' +102 105 106 109 2 5 15 ;1 ; B - A' - B' - A" + + ;;26 --> 27 --> 28 +105 106 109 110 2 -125 30 ;1 ; A - B - A' - B' +106 109 110 113 2 5 15 ;1 ; B - A' - B' - A" + + ;;27 --> 28 --> 29 +109 110 113 114 2 -125 30 ;1 ; A - B - A' - B' +110 113 114 117 2 5 15 ;1 ; B - A' - B' - A" + + ;;28 --> 29 --> 30 +113 114 117 118 2 -125 30 ;1 ; A - B - A' - B' +114 117 118 121 2 5 15 ;1 ; B - A' - B' - A" + + ;;29 --> 30 --> 31 +117 118 121 122 2 -125 30 ;1 ; A - B - A' - B' +118 121 122 125 2 5 15 ;1 ; B - A' - B' - A" + + ;;30 --> 31 --> 32 +121 122 125 126 2 -125 30 ;1 ; A - B - A' - B' +122 125 126 129 2 5 15 ;1 ; B - A' - B' - A" + + ;;31 --> 32 --> 33 +125 126 129 130 2 -125 30 ;1 ; A - B - A' - B' +126 129 130 133 2 5 15 ;1 ; B - A' - B' - A" + + ;;32 --> 33 --> 34 +129 130 133 134 2 -125 30 ;1 ; A - B - A' - B' +130 133 134 137 2 5 15 ;1 ; B - A' - B' - A" + + ;;33 --> 34 --> 35 +133 134 137 138 2 -125 30 ;1 ; A - B - A' - B' +134 137 138 141 2 5 15 ;1 ; B - A' - B' - A" + + ;;34 --> 35 --> 36 +137 138 141 142 2 -125 30 ;1 ; A - B - A' - B' +138 141 142 145 2 5 15 ;1 ; B - A' - B' - A" + + ;;35 --> 36 --> 37 +141 142 145 146 2 -125 30 ;1 ; A - B - A' - B' +142 145 146 149 2 5 15 ;1 ; B - A' - B' - A" + + ;;36 --> 37 --> 38 +145 146 149 150 2 -125 30 ;1 ; A - B - A' - B' +146 149 150 153 2 5 15 ;1 ; B - A' - B' - A" + + ;;37 --> 38 --> 39 +149 150 153 154 2 -125 30 ;1 ; A - B - A' - B' +150 153 154 157 2 5 15 ;1 ; B - A' - B' - A" + + ;;38 --> 39 --> 40 +153 154 157 158 2 -125 30 ;1 ; A - B - A' - B' +154 157 158 161 2 5 15 ;1 ; B - A' - B' - A" + + ;;39 --> 40 --> 41 +157 158 161 162 2 -125 30 ;1 ; A - B - A' - B' +158 161 162 165 2 5 15 ;1 ; B - A' - B' - A" + + ;;40 --> 41 --> 42 +161 162 165 166 2 -125 30 ;1 ; A - B - A' - B' +162 165 166 169 2 5 15 ;1 ; B - A' - B' - A" + + ;;41 --> 42 --> 43 +165 166 169 170 2 -125 30 ;1 ; A - B - A' - B' +166 169 170 173 2 5 15 ;1 ; B - A' - B' - A" + + ;;42 --> 43 --> 44 +169 170 173 174 2 -125 30 ;1 ; A - B - A' - B' +170 173 174 177 2 5 15 ;1 ; B - A' - B' - A" + + ;;43 --> 44 --> 45 +173 174 177 178 2 -125 30 ;1 ; A - B - A' - B' +174 177 178 181 2 5 15 ;1 ; B - A' - B' - A" + + ;;44 --> 45 --> 46 +177 178 181 182 2 -125 30 ;1 ; A - B - A' - B' +178 181 182 185 2 5 15 ;1 ; B - A' - B' - A" + + ;;45 --> 46 --> 47 +181 182 185 186 2 -125 30 ;1 ; A - B - A' - B' +182 185 186 189 2 5 15 ;1 ; B - A' - B' - A" + + ;;46 --> 47 --> 48 +185 186 189 190 2 -125 30 ;1 ; A - B - A' - B' +186 189 190 193 2 5 15 ;1 ; B - A' - B' - A" + + ;;48 --> 49 --> 50 +189 190 193 194 2 -125 30 ;1 ; A - B - A' - B' +190 193 194 197 2 5 15 ;1 ; B - A' - B' - A" + + ;;49 --> 50 --> END +193 194 197 198 2 -125 30 ;1 ; A - B - A' - B' + +[ virtual_sitesn ] +; site funct constructing atom indices + 4 1 1 2 3 + 8 1 5 6 7 + 12 1 9 10 11 + 16 1 13 14 15 + 20 1 17 18 19 + 24 1 21 22 23 + 28 1 25 26 27 + 32 1 29 30 31 + 36 1 33 34 35 + 40 1 37 38 39 + 44 1 41 42 43 + 48 1 45 46 47 + 52 1 49 50 51 + 56 1 53 54 55 + 60 1 57 58 59 + 64 1 61 62 63 + 68 1 65 66 67 + 72 1 69 70 71 + 76 1 73 74 75 + 80 1 77 78 79 + 84 1 81 82 83 + 84 1 81 82 83 + 88 1 85 86 87 + 92 1 89 90 91 + 96 1 93 94 95 + 100 1 97 98 99 + 104 1 101 102 103 + 108 1 105 106 107 + 112 1 109 110 111 + 116 1 113 114 115 + 120 1 117 118 119 + 124 1 121 122 123 + 128 1 125 126 127 + 132 1 129 130 131 + 136 1 133 134 135 + 140 1 137 138 139 + 144 1 141 142 143 + 148 1 145 146 147 + 152 1 149 150 151 + 156 1 153 154 155 + 160 1 157 158 159 + 164 1 161 162 163 + 168 1 165 166 167 + 172 1 169 170 171 + 176 1 173 174 175 + 180 1 177 178 179 + 184 1 181 182 183 + 188 1 185 186 187 + 192 1 189 190 191 + 196 1 193 194 195 + 200 1 197 198 199 +[exclusions] +; site excluding atom indices + 4 1 2 3 + 8 5 6 7 + 12 9 10 11 + 16 13 14 15 + 20 17 18 19 + 24 21 22 23 + 28 25 26 27 + 32 29 30 31 + 36 33 34 35 + 40 37 38 39 + 44 41 42 43 + 48 45 46 47 + 52 49 50 51 + 56 53 54 55 + 60 57 58 59 + 64 61 62 63 + 68 65 66 67 + 72 69 70 71 + 76 73 74 75 + 80 77 78 79 + 84 81 82 83 + 88 85 86 87 + 92 89 90 91 + 96 93 94 95 + 100 97 98 99 + 104 101 102 103 + 108 105 106 107 + 112 109 110 111 + 116 113 114 115 + 120 117 118 119 + 124 121 122 123 + 128 125 126 127 + 132 129 130 131 + 136 133 134 135 + 140 137 138 139 + 144 141 142 143 + 148 145 146 147 + 152 149 150 151 + 156 153 154 155 + 160 157 158 159 + 164 161 162 163 + 168 165 166 167 + 172 169 170 171 + 176 173 174 175 + 180 177 178 179 + 184 181 182 183 + 188 185 186 187 + 192 189 190 191 + 196 193 194 195 + 200 197 198 199 + diff --git a/polyply/tests/test_data/library_tests/martini3/CEL/polyply/command b/polyply/tests/test_data/library_tests/martini3/CEL/polyply/command new file mode 100644 index 00000000..dcd77b5a --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/CEL/polyply/command @@ -0,0 +1 @@ +polyply gen_itp -lib martini3 -seq CEL:50 -o CEL.itp -name CEL From 1b632ddaae60906ae274e702257062895032982f Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 15 Jul 2022 15:24:19 +0200 Subject: [PATCH 179/275] add test for CEL --- polyply/tests/test_lib_files.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polyply/tests/test_lib_files.py b/polyply/tests/test_lib_files.py index 0a387b92..79afccc5 100644 --- a/polyply/tests/test_lib_files.py +++ b/polyply/tests/test_lib_files.py @@ -83,7 +83,7 @@ def assert_equal_blocks(block1, block2): for atoms, ref_interactions in ref_terms.items(): new_interactions = new_terms[atoms] for ref_inter in ref_interactions: - #print(ref_inter) + print(ref_inter) for new_inter in new_interactions: if _interaction_equal(ref_inter, new_inter, inter_type): break @@ -183,6 +183,7 @@ def _interaction_equal(interaction1, interaction2, inter_type): ['martini3', 'PS'], ['martini3', 'PE'], ['martini3', 'DEX'], + ['martini3', 'CEL'], ['martini3', 'P3HT'], ['martini3', 'PPE'], ['martini3', 'PTMA'], From 3d627db0c8ab4c2e02436836ca4a20484477b652 Mon Sep 17 00:00:00 2001 From: fgrunewald Date: Fri, 2 Sep 2022 10:39:08 +0200 Subject: [PATCH 180/275] fix issue in cellulose bond; bond was made between A +B instead of B +A --- polyply/data/martini3/cellulose.martini3.ff | 8 ++++---- .../test_data/library_tests/martini3/CEL/polyply/CEL.itp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/polyply/data/martini3/cellulose.martini3.ff b/polyply/data/martini3/cellulose.martini3.ff index d4600d30..616d1132 100644 --- a/polyply/data/martini3/cellulose.martini3.ff +++ b/polyply/data/martini3/cellulose.martini3.ff @@ -37,11 +37,11 @@ A VS ; beta 1->4 resname "CEL" [ atoms ] -A {"replace": {"atype": "SN6", "mass": "36"} } -B { } +A { } +B {"replace": {"atype": "SP1r"} } C { } -+A { } -+B {"replace": {"atype": "SP1r"}} ++A {"replace": {"atype": "SN6", "mass": "36"} } ++B { } +C { } [ bonds ] diff --git a/polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp b/polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp index 90776e3e..ba90cd7c 100644 --- a/polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp +++ b/polyply/tests/test_data/library_tests/martini3/CEL/polyply/CEL.itp @@ -8,8 +8,8 @@ [ atoms ] ; nr type resnr residue atom cgnr charge mass - 1 SN6 1 DP50 A 1 0.0 54.0 - 2 SP4r 1 DP50 B 2 0.0 54.0 + 1 SP4r 1 DP50 A 1 0.0 54.0 + 2 SP1r 1 DP50 B 2 0.0 54.0 3 SP1r 1 DP50 C 3 0.0 54.0 4 TC4 1 DP50 VS 4 0.0 0 ;VS 1 @@ -253,8 +253,8 @@ 195 SP1r 1 DP50 C 195 0.0 54.0 196 TC4 1 DP50 VS 196 0.0 0 ;VS 49 -197 SP4r 1 DP50 A 197 0.0 36.0 -198 SP1r 1 DP50 B 198 0.0 54.0 +197 SN6 1 DP50 A 197 0.0 36.0 +198 SP4r 1 DP50 B 198 0.0 54.0 199 SP1r 1 DP50 C 199 0.0 54.0 200 TC4 1 DP50 VS 200 0.0 0 ;VS 50 From 7a9d9ce2109857bf0df94e8d3e0aca92a8e9af18 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Fri, 4 Nov 2022 16:43:27 +0100 Subject: [PATCH 181/275] removed superfluous loop --- polyply/tests/test_topology.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/polyply/tests/test_topology.py b/polyply/tests/test_topology.py index 6c0b0945..a4d7fd21 100644 --- a/polyply/tests/test_topology.py +++ b/polyply/tests/test_topology.py @@ -670,8 +670,7 @@ def test_replace_types(lines, outcome): polyply.src.top_parser.read_topology(new_lines, top) top.gen_bonded_interactions() for inter_type in outcome: - for inter in top.molecules[0].molecule.interactions[inter_type]: - assert top.molecules[0].molecule.interactions[inter_type] == outcome[inter_type] + assert top.molecules[0].molecule.interactions[inter_type] == outcome[inter_type] @staticmethod def test_replace_types_fail(): From 0b042ce032aa2c3ee80621d985d134bb29cbaf2c Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Fri, 4 Nov 2022 16:49:02 +0100 Subject: [PATCH 182/275] add comment and change if/else order when expanding multiple interactions --- polyply/src/topology.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/polyply/src/topology.py b/polyply/src/topology.py index 7ba72628..86cca836 100644 --- a/polyply/src/topology.py +++ b/polyply/src/topology.py @@ -358,14 +358,21 @@ def gen_bonded_interactions(self): for idx, (new_param, meta) in enumerate(new_params): if not meta: meta = {} - if idx > 0: + # there is always at least one interaction in molecule, which + # needs to get the typed parameters + if idx == 0: + interaction.parameters[:] = new_param[:] + interaction.meta.update(meta) + # however, sometimes a single interaction term needs to be + # expanded (i.e. a single statment spwans multiple interactions) + # In that case we update the parameters of the first term and + # need to add the other interactions additionally + else: new_interaction = Interaction(atoms=tuple(interaction.atoms), parameters=new_param, meta=meta) additional_interactions[inter_type].append(new_interaction) - else: - interaction.parameters[:] = new_param[:] - interaction.meta.update(meta) + # here we add the expanded interactions into the molecules for mol_idx in self.mol_idx_by_name[mol_name]: From bd06f5170a662624479b5481203c93064dcc112e Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Wed, 30 Nov 2022 14:44:25 +0100 Subject: [PATCH 183/275] add logging messages to link --- polyply/src/apply_links.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/polyply/src/apply_links.py b/polyply/src/apply_links.py index ac89e6d5..e27aea56 100644 --- a/polyply/src/apply_links.py +++ b/polyply/src/apply_links.py @@ -426,6 +426,12 @@ def apply_link_between_residues(self, meta_molecule, link, link_to_resid): for edge in link.edges: molecule.add_edge(link_to_mol[edge[0]], link_to_mol[edge[1]]) + # put the log messages + for loglevel, entries in link.log_entries.items(): + for entry, fmt_args in entries.items(): + fmt_args = fmt_args + [link_to_mol] + molecule.log_entries[loglevel][entry] += fmt_args + def run_molecule(self, meta_molecule): """ Given a meta_molecule the function iterates over all edges From f917a6c9b06ec0f0190474532f7d64cca0ef46cb Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Wed, 30 Nov 2022 14:46:30 +0100 Subject: [PATCH 184/275] add logging messages to gen_itp --- polyply/src/gen_itp.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index fcd4edcf..f60250fe 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -110,6 +110,13 @@ def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=None, lib=Non for missing in find_missing_edges(meta_molecule, meta_molecule.molecule): LOGGER.warning(msg, **missing) + # Print molecule Log messages + for loglevel, entries in meta_molecule.molecule.log_entries.items(): + for entry, fmt_args in entries.items(): + for fmt_arg in fmt_args: + fmt_arg = {str(k): meta_molecule.molecule.nodes[v] for k, v in fmt_arg.items()} + LOGGER.log(loglevel, entry, **fmt_arg, type='model') + with deferred_open(outpath, 'w') as outfile: header = [ ' '.join(sys.argv) + "\n" ] header.append("Please cite the following papers:") From 1cb236458fdf95aca62514c25d2674634cf4cb5d Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Wed, 30 Nov 2022 14:47:27 +0100 Subject: [PATCH 185/275] adjust logleves --- polyply/src/logging.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polyply/src/logging.py b/polyply/src/logging.py index 3c904486..aa0b1fd3 100644 --- a/polyply/src/logging.py +++ b/polyply/src/logging.py @@ -25,4 +25,6 @@ LOGGER = StyleAdapter(LOGGER) -LOGLEVELS = {0: logging.INFO, 1: logging.DEBUG, 2: 5} +LOGLEVELS = {0: logging.INFO, + 1: logging.DEBUG, + 2: 5} From b452b64c1654449679b2260b5e8e9fbea5c78027 Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Wed, 30 Nov 2022 15:11:52 +0100 Subject: [PATCH 186/275] clean up PPE.ff --- polyply/data/martini3/PPE.martini3.ff | 33 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index 1c7bc437..b3862556 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -49,19 +49,20 @@ PPEinit 3 [ link ] resname "PPEinit|PPE" - [ bonds ] BB8 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - [ angles ] BB8 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} BB8 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} BB4 BB8 +BB4 1 180 50 {"comment": "bending stiffness backbone" } -BB8 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } - +BB8 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] BB8 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} +[ link ] +resname "PPEinit|PPE" +[ angles ] +BB8 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ moleculetype ] PPE 3 @@ -99,11 +100,14 @@ BB4 +BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} [ angles ] BB4 +BB1 +BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} BB4 +BB1 +BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] BB4 +BB2 +BB3 +BB1 2 0 50 {"comment": "improper dihedral right turn"} +[ link ] +resname "PPE" +[ angles ] +BB4 +BB4 ++BB4 1 180 50 {"comment": "bending stiffness backbone" } [ moleculetype ] PPEter 3 @@ -144,20 +148,23 @@ PPEter 3 [ link ] resname "PPE|PPEter" - [ bonds ] -BB4 BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} ---BB4 -BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} - [ angles ] ---BB4 -BB1 -BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} ---BB4 -BB1 -BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} ---BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } -BB4 BB1 BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} -BB4 BB1 BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} -BB4 BB4 BB7 1 165 50 {"comment": "prevent end from bending over" } ---BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } - [ dihedrals ] -BB4 BB2 BB3 BB1 2 0 50 {"comment": "improper dihedral right turn"} + +[ link ] +resname "PPE|PPEter" +[ bonds ] +--BB4 -BB1 1 0.234 9000 {"comment": "bond aromatic ring-triple bond"} +[ angles ] +--BB4 -BB1 -BB2 1 83 650 {"comment": "angle aromatic ring-triple bond"} +--BB4 -BB1 -BB3 1 143 550 {"comment": "angle aromatic ring-triple bond"} +--BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } +--BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } +[ dihedrals ] --BB4 -BB2 -BB3 -BB1 2 0 50 {"comment": "improper dihedral right turn"} From 055289b63480aa0b3b7db8835d99bc628f72428f Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sat, 3 Dec 2022 18:12:33 +0100 Subject: [PATCH 187/275] add PDMS to library --- polyply/data/martini3/PDMS.martini3.ff | 68 ++++++++++++++++++++++++++ polyply/data/martini3/citations.bib | 11 ++++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 polyply/data/martini3/PDMS.martini3.ff diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff new file mode 100644 index 00000000..2b36e83e --- /dev/null +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -0,0 +1,68 @@ +[ citations ] +Martini3 +polyply +M3_PDMS +; +[ moleculetype ] +; molname nrexcl +PDMS 1 +; +[ atoms ] +; id type resnr residue atom cgnr charge mass + 1 DMS 1 PDMS PDMS 1 0.00000 72.00 +; +; +[ link ] +resname "PDMS" +[ bonds ] +; i j funct length force.c. + PDMS +PDMS 1 0.448 11500 ; 2 +; +[ link ] +resname "PDMS" +[ angles ] +; i j k funct angle force.c. + PDMS +PDMS ++PDMS 1 86 45.89 ; 2 +; +[ link ] +resname "PDMS" +[ dihedrals ] +; i j k l funct dihedral force.c. mult. + PDMS +PDMS ++PDMS +++PDMS 1 1.18 1.4 1 ; 2 +; +[ moleculetype ] +END 1 +[ atoms ] + 1 DMS 1 END END 1 0.00000 72.00 + +[ link ] +resname "END|PDMS" +[ bonds ] + END +PDMS 1 0.446 11000 {"group": "END-PDMS"} + +[ link ] +resname "PDMS|END" +[ bonds ] + PDMS +END 1 0.446 11000 {"group": "PDMS-END"} + + +[ link ] +resname "END|PDMS" +[ angles ] +END +PDMS ++PDMS 1 87 78 {"group": "END-PDMS"} + +[ link ] +resname "PDMS|END" +[ angles ] +PDMS +PDMS ++END 1 87 78 {"group": "PDMS-END"} + + +[ link ] +resname "END|PDMS" +[ dihedrals ] +END +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "END-PDMS"} + +[ link ] +resname "PDMS|END" +[ dihedrals ] +PDMS +PDMS ++PDMS +++END 1 1.85 1.2 1 {"group": "PDMS-END"} diff --git a/polyply/data/martini3/citations.bib b/polyply/data/martini3/citations.bib index 669e9911..1b0c8061 100644 --- a/polyply/data/martini3/citations.bib +++ b/polyply/data/martini3/citations.bib @@ -46,4 +46,13 @@ @article{M3_sugars journal={JCTC}, doi={10.1021/acs.jctc.2c00757}, url={https://doi.org/10.1021/acs.jctc.2c00757}} - +@article{M3_PDMS, + title={Development of a transferable coarse-grained model of polydimethylsiloxane}, + author={Cambiaso, Sonia and Rasera, Fabio and Rossi, Giulia and Bochicchio, Davide}, + journal={Soft Matter}, + volume={18}, + number={40}, + pages={7887--7896}, + year={2022}, + publisher={Royal Society of Chemistry} +} From b260c95a92b001e22f2f2869151d92ee3545a6df Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sat, 3 Dec 2022 18:18:59 +0100 Subject: [PATCH 188/275] add PDMS to library.md --- LIBRARY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LIBRARY.md b/LIBRARY.md index 925a0748..e36d89fd 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -25,4 +25,4 @@ |Dextran |DEX | |[martini3](polyply/data/martini3/dextran.martini3.ff) | |DNA nucleobases |Dx, Tx5, Dx3 w/ x=T,G,A,C|[parmbsc1](polyply/data/parmbsc1/dna_final.ff) |[martini2](polyply/data/martini2/DNA_M2.ff) | |Aminoacids |3 letter code | |[martini3](polyply/data/martini3/aminoacids.ff) | - +|PDMS |DMS | |[martini3](polyply/data/martini3/PDMS.martini3.ff) From 29bcb40f47ba80b2afde0f76ce63172c39d48e1b Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sat, 3 Dec 2022 18:21:43 +0100 Subject: [PATCH 189/275] change name END to PDMSTer in PDMS M3 definition --- polyply/data/martini3/PDMS.martini3.ff | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff index 2b36e83e..5d1020db 100644 --- a/polyply/data/martini3/PDMS.martini3.ff +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -31,38 +31,38 @@ resname "PDMS" PDMS +PDMS ++PDMS +++PDMS 1 1.18 1.4 1 ; 2 ; [ moleculetype ] -END 1 +PDMSTer 1 [ atoms ] - 1 DMS 1 END END 1 0.00000 72.00 + 1 DMS 1 PDMSTer DPMSTer 1 0.00000 72.00 [ link ] -resname "END|PDMS" +resname "PDMSter|PDMS" [ bonds ] - END +PDMS 1 0.446 11000 {"group": "END-PDMS"} + PDMSter +PDMS 1 0.446 11000 {"group": "PDMSter-PDMS"} [ link ] -resname "PDMS|END" +resname "PDMS|PDMSter" [ bonds ] - PDMS +END 1 0.446 11000 {"group": "PDMS-END"} + PDMS +PDMSter 1 0.446 11000 {"group": "PDMS-PDMSter"} [ link ] -resname "END|PDMS" +resname "PDMSter|PDMS" [ angles ] -END +PDMS ++PDMS 1 87 78 {"group": "END-PDMS"} +PDMSter +PDMS ++PDMS 1 87 78 {"group": "PDMSter-PDMS"} [ link ] -resname "PDMS|END" +resname "PDMS|PDMSter" [ angles ] -PDMS +PDMS ++END 1 87 78 {"group": "PDMS-END"} +PDMS +PDMS ++PDMSter 1 87 78 {"group": "PDMS-PDMSter"} [ link ] -resname "END|PDMS" +resname "PDMSter|PDMS" [ dihedrals ] -END +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "END-PDMS"} +PDMSter +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "PDMSter-PDMS"} [ link ] -resname "PDMS|END" +resname "PDMS|PDMSter" [ dihedrals ] -PDMS +PDMS ++PDMS +++END 1 1.85 1.2 1 {"group": "PDMS-END"} +PDMS +PDMS ++PDMS +++PDMSter 1 1.85 1.2 1 {"group": "PDMS-PDMSter"} From b162228bace5e2a8ad1f6fcd45570a14d7a8cec4 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 15:20:17 +0100 Subject: [PATCH 190/275] add PDMS parameters --- polyply/data/martini3/PDMS.martini3.ff | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff index 5d1020db..436f8aaa 100644 --- a/polyply/data/martini3/PDMS.martini3.ff +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -31,38 +31,38 @@ resname "PDMS" PDMS +PDMS ++PDMS +++PDMS 1 1.18 1.4 1 ; 2 ; [ moleculetype ] -PDMSTer 1 +PDMSter 1 [ atoms ] - 1 DMS 1 PDMSTer DPMSTer 1 0.00000 72.00 + 1 DMS 1 END END 1 0.00000 72.00 [ link ] -resname "PDMSter|PDMS" +resname "END|PDMS" [ bonds ] - PDMSter +PDMS 1 0.446 11000 {"group": "PDMSter-PDMS"} + END +PDMS 1 0.446 11000 {"group": "END-PDMS"} [ link ] -resname "PDMS|PDMSter" +resname "PDMS|END" [ bonds ] - PDMS +PDMSter 1 0.446 11000 {"group": "PDMS-PDMSter"} + PDMS +END 1 0.446 11000 {"group": "PDMS-END"} [ link ] resname "PDMSter|PDMS" [ angles ] -PDMSter +PDMS ++PDMS 1 87 78 {"group": "PDMSter-PDMS"} +END +PDMS ++PDMS 1 87 78 {"group": "END-PDMS"} [ link ] resname "PDMS|PDMSter" [ angles ] -PDMS +PDMS ++PDMSter 1 87 78 {"group": "PDMS-PDMSter"} +PDMS +PDMS ++END 1 87 78 {"group": "PDMS-END"} [ link ] resname "PDMSter|PDMS" [ dihedrals ] -PDMSter +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "PDMSter-PDMS"} +END +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "END-PDMS"} [ link ] -resname "PDMS|PDMSter" +resname "PDMS|DPMSter" [ dihedrals ] -PDMS +PDMS ++PDMS +++PDMSter 1 1.85 1.2 1 {"group": "PDMS-PDMSter"} +PDMS +PDMS ++PDMS +++END 1 1.85 1.2 1 {"group": "PDMS-END"} From f55b5b345ad3f0eebbb259d56a122ba6de345e51 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 15:34:15 +0100 Subject: [PATCH 191/275] add lib test and fix bug in naming of M3 PDMS --- polyply/data/martini3/PDMS.martini3.ff | 8 +- .../martini3/PDMS/polyply/PDMS.itp | 224 ++++++++++++++++++ .../martini3/PDMS/polyply/command | 1 + polyply/tests/test_lib_files.py | 1 + 4 files changed, 230 insertions(+), 4 deletions(-) create mode 100644 polyply/tests/test_data/library_tests/martini3/PDMS/polyply/PDMS.itp create mode 100644 polyply/tests/test_data/library_tests/martini3/PDMS/polyply/command diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff index 436f8aaa..6b47b0c2 100644 --- a/polyply/data/martini3/PDMS.martini3.ff +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -33,15 +33,15 @@ resname "PDMS" [ moleculetype ] PDMSter 1 [ atoms ] - 1 DMS 1 END END 1 0.00000 72.00 + 1 DMS 1 PDMSter END 1 0.00000 72.00 [ link ] -resname "END|PDMS" +resname "PDMSter|PDMS" [ bonds ] END +PDMS 1 0.446 11000 {"group": "END-PDMS"} [ link ] -resname "PDMS|END" +resname "PDMS|PDMSter" [ bonds ] PDMS +END 1 0.446 11000 {"group": "PDMS-END"} @@ -63,6 +63,6 @@ resname "PDMSter|PDMS" END +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "END-PDMS"} [ link ] -resname "PDMS|DPMSter" +resname "PDMS|PDMSter" [ dihedrals ] PDMS +PDMS ++PDMS +++END 1 1.85 1.2 1 {"group": "PDMS-END"} diff --git a/polyply/tests/test_data/library_tests/martini3/PDMS/polyply/PDMS.itp b/polyply/tests/test_data/library_tests/martini3/PDMS/polyply/PDMS.itp new file mode 100644 index 00000000..35145fe7 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PDMS/polyply/PDMS.itp @@ -0,0 +1,224 @@ +; polyply-itp + +; Please cite the following papers: +; Souza, P C T; Alessandri, R; Barnoud, J; Thallmair, S; Faustino, I; Grünewald, F; Patmanidis, I; Abdizadeh, H; Bruininks, B M H; Wassenaar, T A; Kroon, P C; Melcr, J; Nieto, V; Corradi, V; Khan, H M; Domański, J; Javanainen, M; Martinez-Seara, H; Reuter, N; Best, R B; Vattulainen, I; Monticelli, L; Periole, X; Tieleman, D P; de Vries, A H; Marrink, S J; Nature Methods 2021; 10.1038/s41592-021-01098-3 +; Grunewald, F; Alessandri, R; Kroon, P C; Monticelli, L; Souza, P C; Marrink, S J; Nature Communications 2022; 10.1038/s41467-021-27627-4 +; Cambiaso, S; Rasera, F; Rossi, G; Bochicchio, D; Soft Matter 2022 + +[ moleculetype ] +PDMS 1 + +[ atoms ] + 1 DMS 1 PDMSter END 1 0.0 72.0 + 2 DMS 2 PDMS PDMS 2 0.0 72.0 + 3 DMS 3 PDMS PDMS 3 0.0 72.0 + 4 DMS 4 PDMS PDMS 4 0.0 72.0 + 5 DMS 5 PDMS PDMS 5 0.0 72.0 + 6 DMS 6 PDMS PDMS 6 0.0 72.0 + 7 DMS 7 PDMS PDMS 7 0.0 72.0 + 8 DMS 8 PDMS PDMS 8 0.0 72.0 + 9 DMS 9 PDMS PDMS 9 0.0 72.0 +10 DMS 10 PDMS PDMS 10 0.0 72.0 +11 DMS 11 PDMS PDMS 11 0.0 72.0 +12 DMS 12 PDMS PDMS 12 0.0 72.0 +13 DMS 13 PDMS PDMS 13 0.0 72.0 +14 DMS 14 PDMS PDMS 14 0.0 72.0 +15 DMS 15 PDMS PDMS 15 0.0 72.0 +16 DMS 16 PDMS PDMS 16 0.0 72.0 +17 DMS 17 PDMS PDMS 17 0.0 72.0 +18 DMS 18 PDMS PDMS 18 0.0 72.0 +19 DMS 19 PDMS PDMS 19 0.0 72.0 +20 DMS 20 PDMS PDMS 20 0.0 72.0 +21 DMS 21 PDMS PDMS 21 0.0 72.0 +22 DMS 22 PDMS PDMS 22 0.0 72.0 +23 DMS 23 PDMS PDMS 23 0.0 72.0 +24 DMS 24 PDMS PDMS 24 0.0 72.0 +25 DMS 25 PDMS PDMS 25 0.0 72.0 +26 DMS 26 PDMS PDMS 26 0.0 72.0 +27 DMS 27 PDMS PDMS 27 0.0 72.0 +28 DMS 28 PDMS PDMS 28 0.0 72.0 +29 DMS 29 PDMS PDMS 29 0.0 72.0 +30 DMS 30 PDMS PDMS 30 0.0 72.0 +31 DMS 31 PDMS PDMS 31 0.0 72.0 +32 DMS 32 PDMS PDMS 32 0.0 72.0 +33 DMS 33 PDMS PDMS 33 0.0 72.0 +34 DMS 34 PDMS PDMS 34 0.0 72.0 +35 DMS 35 PDMS PDMS 35 0.0 72.0 +36 DMS 36 PDMS PDMS 36 0.0 72.0 +37 DMS 37 PDMS PDMS 37 0.0 72.0 +38 DMS 38 PDMS PDMS 38 0.0 72.0 +39 DMS 39 PDMS PDMS 39 0.0 72.0 +40 DMS 40 PDMS PDMS 40 0.0 72.0 +41 DMS 41 PDMS PDMS 41 0.0 72.0 +42 DMS 42 PDMS PDMS 42 0.0 72.0 +43 DMS 43 PDMS PDMS 43 0.0 72.0 +44 DMS 44 PDMS PDMS 44 0.0 72.0 +45 DMS 45 PDMS PDMS 45 0.0 72.0 +46 DMS 46 PDMS PDMS 46 0.0 72.0 +47 DMS 47 PDMS PDMS 47 0.0 72.0 +48 DMS 48 PDMS PDMS 48 0.0 72.0 +49 DMS 49 PDMS PDMS 49 0.0 72.0 +50 DMS 50 PDMSter END 50 0.0 72.0 + +[ bonds ] + 2 3 1 0.448 11500 + 3 4 1 0.448 11500 + 4 5 1 0.448 11500 + 5 6 1 0.448 11500 + 6 7 1 0.448 11500 + 7 8 1 0.448 11500 + 8 9 1 0.448 11500 + 9 10 1 0.448 11500 +10 11 1 0.448 11500 +11 12 1 0.448 11500 +12 13 1 0.448 11500 +13 14 1 0.448 11500 +14 15 1 0.448 11500 +15 16 1 0.448 11500 +16 17 1 0.448 11500 +17 18 1 0.448 11500 +18 19 1 0.448 11500 +19 20 1 0.448 11500 +20 21 1 0.448 11500 +21 22 1 0.448 11500 +22 23 1 0.448 11500 +23 24 1 0.448 11500 +24 25 1 0.448 11500 +25 26 1 0.448 11500 +26 27 1 0.448 11500 +27 28 1 0.448 11500 +28 29 1 0.448 11500 +29 30 1 0.448 11500 +30 31 1 0.448 11500 +31 32 1 0.448 11500 +32 33 1 0.448 11500 +33 34 1 0.448 11500 +34 35 1 0.448 11500 +35 36 1 0.448 11500 +36 37 1 0.448 11500 +37 38 1 0.448 11500 +38 39 1 0.448 11500 +39 40 1 0.448 11500 +40 41 1 0.448 11500 +41 42 1 0.448 11500 +42 43 1 0.448 11500 +43 44 1 0.448 11500 +44 45 1 0.448 11500 +45 46 1 0.448 11500 +46 47 1 0.448 11500 +47 48 1 0.448 11500 +48 49 1 0.448 11500 + +; END-PDMS + 1 2 1 0.446 11000 + +; PDMS-END +49 50 1 0.446 11000 + +[ angles ] + 2 3 4 1 86 45.89 + 3 4 5 1 86 45.89 + 4 5 6 1 86 45.89 + 5 6 7 1 86 45.89 + 6 7 8 1 86 45.89 + 7 8 9 1 86 45.89 + 8 9 10 1 86 45.89 + 9 10 11 1 86 45.89 +10 11 12 1 86 45.89 +11 12 13 1 86 45.89 +12 13 14 1 86 45.89 +13 14 15 1 86 45.89 +14 15 16 1 86 45.89 +15 16 17 1 86 45.89 +16 17 18 1 86 45.89 +17 18 19 1 86 45.89 +18 19 20 1 86 45.89 +19 20 21 1 86 45.89 +20 21 22 1 86 45.89 +21 22 23 1 86 45.89 +22 23 24 1 86 45.89 +23 24 25 1 86 45.89 +24 25 26 1 86 45.89 +25 26 27 1 86 45.89 +26 27 28 1 86 45.89 +27 28 29 1 86 45.89 +28 29 30 1 86 45.89 +29 30 31 1 86 45.89 +30 31 32 1 86 45.89 +31 32 33 1 86 45.89 +32 33 34 1 86 45.89 +33 34 35 1 86 45.89 +34 35 36 1 86 45.89 +35 36 37 1 86 45.89 +36 37 38 1 86 45.89 +37 38 39 1 86 45.89 +38 39 40 1 86 45.89 +39 40 41 1 86 45.89 +40 41 42 1 86 45.89 +41 42 43 1 86 45.89 +42 43 44 1 86 45.89 +43 44 45 1 86 45.89 +44 45 46 1 86 45.89 +45 46 47 1 86 45.89 +46 47 48 1 86 45.89 +47 48 49 1 86 45.89 + +; END-PDMS + 1 2 3 1 87 78 + +; PDMS-END +48 49 50 1 87 78 + +[ dihedrals ] + 2 3 4 5 1 1.18 1.4 1 + 3 4 5 6 1 1.18 1.4 1 + 4 5 6 7 1 1.18 1.4 1 + 5 6 7 8 1 1.18 1.4 1 + 6 7 8 9 1 1.18 1.4 1 + 7 8 9 10 1 1.18 1.4 1 + 8 9 10 11 1 1.18 1.4 1 + 9 10 11 12 1 1.18 1.4 1 +10 11 12 13 1 1.18 1.4 1 +11 12 13 14 1 1.18 1.4 1 +12 13 14 15 1 1.18 1.4 1 +13 14 15 16 1 1.18 1.4 1 +14 15 16 17 1 1.18 1.4 1 +15 16 17 18 1 1.18 1.4 1 +16 17 18 19 1 1.18 1.4 1 +17 18 19 20 1 1.18 1.4 1 +18 19 20 21 1 1.18 1.4 1 +19 20 21 22 1 1.18 1.4 1 +20 21 22 23 1 1.18 1.4 1 +21 22 23 24 1 1.18 1.4 1 +22 23 24 25 1 1.18 1.4 1 +23 24 25 26 1 1.18 1.4 1 +24 25 26 27 1 1.18 1.4 1 +25 26 27 28 1 1.18 1.4 1 +26 27 28 29 1 1.18 1.4 1 +27 28 29 30 1 1.18 1.4 1 +28 29 30 31 1 1.18 1.4 1 +29 30 31 32 1 1.18 1.4 1 +30 31 32 33 1 1.18 1.4 1 +31 32 33 34 1 1.18 1.4 1 +32 33 34 35 1 1.18 1.4 1 +33 34 35 36 1 1.18 1.4 1 +34 35 36 37 1 1.18 1.4 1 +35 36 37 38 1 1.18 1.4 1 +36 37 38 39 1 1.18 1.4 1 +37 38 39 40 1 1.18 1.4 1 +38 39 40 41 1 1.18 1.4 1 +39 40 41 42 1 1.18 1.4 1 +40 41 42 43 1 1.18 1.4 1 +41 42 43 44 1 1.18 1.4 1 +42 43 44 45 1 1.18 1.4 1 +43 44 45 46 1 1.18 1.4 1 +44 45 46 47 1 1.18 1.4 1 +45 46 47 48 1 1.18 1.4 1 +46 47 48 49 1 1.18 1.4 1 + +; END-PDMS + 1 2 3 4 1 1.85 1.2 1 + +; PDMS-END +47 48 49 50 1 1.85 1.2 1 + diff --git a/polyply/tests/test_data/library_tests/martini3/PDMS/polyply/command b/polyply/tests/test_data/library_tests/martini3/PDMS/polyply/command new file mode 100644 index 00000000..14c15347 --- /dev/null +++ b/polyply/tests/test_data/library_tests/martini3/PDMS/polyply/command @@ -0,0 +1 @@ +polyply gen_params -lib martini3 -seq PDMSter:1 PDMS:48 PDMSter:1 -o PDMS.itp -name PDMS diff --git a/polyply/tests/test_lib_files.py b/polyply/tests/test_lib_files.py index 79afccc5..98d748eb 100644 --- a/polyply/tests/test_lib_files.py +++ b/polyply/tests/test_lib_files.py @@ -178,6 +178,7 @@ def _interaction_equal(interaction1, interaction2, inter_type): ['2016H66', 'PS'], ['gromos53A6', 'P3HT'], ['oplsaaLigParGen', 'PEO'], + ['martini3', 'PDMS'], ['martini3', 'PROT'], ['martini3', 'PEO'], ['martini3', 'PS'], From cd2aa047a3312e1294d9489804d1a51263693035 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 15:35:55 +0100 Subject: [PATCH 192/275] adjust python versions --- .github/workflows/pypi_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi_deploy.yml b/.github/workflows/pypi_deploy.yml index 0eeb65f2..952cfb55 100644 --- a/.github/workflows/pypi_deploy.yml +++ b/.github/workflows/pypi_deploy.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - py_version: ["3.6", "3.7", "3.8", "3.9"] + py_version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 From dcbf00a1e0ccd4b1db7f29e4b03fd54629967528 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 15:37:53 +0100 Subject: [PATCH 193/275] adjust python versions --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 599a8cec..bf8cf2f9 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - py_version: ["3.6", "3.7", "3.8", "3.9"] + py_version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 From 9359017c3b73bde1d4efe258b6cb82656bbfa5e7 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 17:31:43 +0100 Subject: [PATCH 194/275] add log message to PPE --- polyply/data/martini3/PPE.martini3.ff | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index b3862556..b3a8e872 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -168,3 +168,11 @@ resname "PPE|PPEter" --BB4 -BB4 BB4 1 180 50 {"comment": "bending stiffness backbone" } [ dihedrals ] --BB4 -BB2 -BB3 -BB1 2 0 50 {"comment": "improper dihedral right turn"} + +[ link ] +[ atoms ] +BB4 {"resname": "PPE"} +[ warning ] +"You should patch PPE with a terminal residue. Use -seq PPEter:1 PPE:4 PPEter:1" +[ non-edges ] +BB4 +BB1 From dac79ef6eb87eea39d18d8767fbfa5979423c91a Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 17:46:19 +0100 Subject: [PATCH 195/275] move warnings to bottom; add empty line to seperate in screen print --- polyply/src/gen_itp.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index f60250fe..604e35af 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -110,13 +110,6 @@ def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=None, lib=Non for missing in find_missing_edges(meta_molecule, meta_molecule.molecule): LOGGER.warning(msg, **missing) - # Print molecule Log messages - for loglevel, entries in meta_molecule.molecule.log_entries.items(): - for entry, fmt_args in entries.items(): - for fmt_arg in fmt_args: - fmt_arg = {str(k): meta_molecule.molecule.nodes[v] for k, v in fmt_arg.items()} - LOGGER.log(loglevel, entry, **fmt_arg, type='model') - with deferred_open(outpath, 'w') as outfile: header = [ ' '.join(sys.argv) + "\n" ] header.append("Please cite the following papers:") @@ -129,5 +122,14 @@ def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=None, lib=Non moltype=name, header=header) DeferredFileWriter().write() + # Print molecule Log messages + if meta_molecule.molecule.log_entries: + print("") + for loglevel, entries in meta_molecule.molecule.log_entries.items(): + for entry, fmt_args in entries.items(): + for fmt_arg in fmt_args: + fmt_arg = {str(k): meta_molecule.molecule.nodes[v] for k, v in fmt_arg.items()} + LOGGER.log(loglevel, entry, **fmt_arg, type='model') + # ducktape for renaming the itp tool gen_itp = gen_params From 048d8b16bdece556b3188bcb25b45140bfb0c55a Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 17:46:46 +0100 Subject: [PATCH 196/275] add warnings to molecules --- polyply/data/gromos53A6/links.ff | 10 ++++++++++ polyply/data/martini3/PPE.martini3.ff | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/polyply/data/gromos53A6/links.ff b/polyply/data/gromos53A6/links.ff index f9f37dc4..16d0cd1c 100644 --- a/polyply/data/gromos53A6/links.ff +++ b/polyply/data/gromos53A6/links.ff @@ -58,3 +58,13 @@ CT2 {"replace": {"charge": -0.394}} CT3 CT2 +H1 2 126.0 575.0 {"comment":"H-CT2-link", "group": "termini"} [ dihedrals ] +H1 ST1 CT3 CT2 2 0.0 167.42309 {"comment":"H-CT2-link", "group": "termini"} + + +[ link ] +[ atoms ] +CT2 {"resname": "P3HT"} +[ warning ] +You should patch P3HT with a H-terminal residues. Use -seq Hter:1 P3HT:4 Hter:1 +[ non-edges ] +CT2 +H1 +CT2 +CT5 diff --git a/polyply/data/martini3/PPE.martini3.ff b/polyply/data/martini3/PPE.martini3.ff index b3a8e872..446ac16a 100644 --- a/polyply/data/martini3/PPE.martini3.ff +++ b/polyply/data/martini3/PPE.martini3.ff @@ -173,6 +173,6 @@ resname "PPE|PPEter" [ atoms ] BB4 {"resname": "PPE"} [ warning ] -"You should patch PPE with a terminal residue. Use -seq PPEter:1 PPE:4 PPEter:1" +You should patch PPE with a terminal residue. Use -seq PPEter:1 PPE:4 PPEter:1 [ non-edges ] BB4 +BB1 From 0cff194b1e8aa529b6e73c66ebe184026d5576ce Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Wed, 14 Dec 2022 18:15:23 +0100 Subject: [PATCH 197/275] change dependency to latest vermouth version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 6ecded44..252f7411 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ install-requires = # ?? requires-dist? numpy decorator == 4.4.2 networkx ~= 2.0 - vermouth >= 0.7.3 + vermouth >= 0.9.0 scipy tqdm zip-safe = False From 7ce4d2ec64585b970ea6631992f155807e189bdb Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Thu, 22 Dec 2022 12:47:53 +0100 Subject: [PATCH 198/275] Update README.md Fix badge for build status --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92dd96d4..4fa2a47d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Build Status](https://github.com/marrink-lab/polyply_1.0/actions/workflows/python-app.yml/badge.svg)](https://github.com/marrink-lab/polyply_1.0/actions) [![PyPI version](https://badge.fury.io/py/polyply.svg)](https://badge.fury.io/py/polyply) ![license](https://img.shields.io/github/license/marrink-lab/polyply_1.0) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/marrink-lab/polyply_1.0/Upload%20Python%20Package) +![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/marrink-lab/polyply_1.0/pypi_deploy.yml) [![arXiv](https://img.shields.io/badge/arXiv-2105.05890-b31b1b.svg)](https://arxiv.org/abs/2105.05890) [![DOI:10.1038/s41467-021-27627-4](https://zenodo.org/badge/DOI/10.1038/s41467-021-27627-4.svg)](https://doi.org/10.1038/s41467-021-27627-4) From f3b8cf145aca4c33f1b905a6dbb3717350040241 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 22 Dec 2022 13:57:35 +0100 Subject: [PATCH 199/275] update config file --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 252f7411..6e9602aa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ install-requires = # ?? requires-dist? numpy decorator == 4.4.2 networkx ~= 2.0 - vermouth >= 0.9.0 + vermouth >= 0.9.1 scipy tqdm zip-safe = False From 1dc44924ad63796c423099981d4002d4ec1f9786 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 22 Dec 2022 20:50:41 +0100 Subject: [PATCH 200/275] add logging test --- .../test_data/gen_params/logging/ERROR.ff | 31 ++++++++++++++++ .../test_data/gen_params/logging/INFO.ff | 31 ++++++++++++++++ .../test_data/gen_params/logging/WARNING.ff | 31 ++++++++++++++++ polyply/tests/test_gen_params.py | 35 +++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 polyply/tests/test_data/gen_params/logging/ERROR.ff create mode 100644 polyply/tests/test_data/gen_params/logging/INFO.ff create mode 100644 polyply/tests/test_data/gen_params/logging/WARNING.ff diff --git a/polyply/tests/test_data/gen_params/logging/ERROR.ff b/polyply/tests/test_data/gen_params/logging/ERROR.ff new file mode 100644 index 00000000..19e5f514 --- /dev/null +++ b/polyply/tests/test_data/gen_params/logging/ERROR.ff @@ -0,0 +1,31 @@ +; Copyright 2020 University of Groningen +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +;;; test + +[ moleculetype ] +; molname nrexcl +test 1 + +[ atoms ] +;id type resnr residu atom cgnr charge + 1 test 1 test BB 1 0 + + +[ link ] +resname "test" +[ bonds ] +BB +BB 1 0.350 1250 {"group": "inner"} +[ error ] +This is a ERROR. diff --git a/polyply/tests/test_data/gen_params/logging/INFO.ff b/polyply/tests/test_data/gen_params/logging/INFO.ff new file mode 100644 index 00000000..6101d0bb --- /dev/null +++ b/polyply/tests/test_data/gen_params/logging/INFO.ff @@ -0,0 +1,31 @@ +; Copyright 2020 University of Groningen +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +;;; test + +[ moleculetype ] +; molname nrexcl +test 1 + +[ atoms ] +;id type resnr residu atom cgnr charge + 1 test 1 test BB 1 0 + + +[ link ] +resname "test" +[ bonds ] +BB +BB 1 0.350 1250 {"group": "inner"} +[ info ] +This is a INFO. diff --git a/polyply/tests/test_data/gen_params/logging/WARNING.ff b/polyply/tests/test_data/gen_params/logging/WARNING.ff new file mode 100644 index 00000000..37783143 --- /dev/null +++ b/polyply/tests/test_data/gen_params/logging/WARNING.ff @@ -0,0 +1,31 @@ +; Copyright 2020 University of Groningen +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +;;; test + +[ moleculetype ] +; molname nrexcl +test 1 + +[ atoms ] +;id type resnr residu atom cgnr charge + 1 test 1 test BB 1 0 + + +[ link ] +resname "test" +[ bonds ] +BB +BB 1 0.350 1250 {"group": "inner"} +[ warning ] +This is a WARNING. diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index f85635ca..b5235d46 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -15,6 +15,7 @@ from pathlib import Path import textwrap import argparse +import logging import pytest import networkx as nx import vermouth.forcefield @@ -22,6 +23,7 @@ import vermouth.gmx.itp_read from polyply import gen_params, TEST_DATA, MetaMolecule from polyply.src.graph_utils import find_missing_edges +from polyply.src.logging import LOGGER class TestGenParams(): @staticmethod @@ -124,3 +126,36 @@ def test_find_missing_links(): assert edge["resB"] == "P3HTref" assert edge["idxA"] == ref[0] assert edge["idxB"] == ref[1] + +@pytest.mark.parametrize('warn_type', ['INFO', 'WARNING', 'ERROR']) +def test_print_log_warnings(tmp_path, monkeypatch, caplog, warn_type): + """ + Quick test to make sure that the logging warnings propagate to the + gen_params output. + """ + # change to temporary direcotry + monkeypatch.chdir(tmp_path) + + # get input file from test data + infile = TEST_DATA / Path(f"gen_params/logging/{warn_type}.ff") + + # set loglevel + loglevel = getattr(logging, warn_type) + LOGGER.setLevel(loglevel) + + # capture logging messages + with caplog.at_level(loglevel): + gen_params(name="polymer", + outpath=Path("polymer.itp"), + inpath=[infile], + lib=None, + seq=["test:5"], + seq_file=None) + + for record in caplog.records: + if record.levelname == warn_type: + if record.getMessage() == f"This is a {warn_type}.": + assert True + break + else: + assert False From 9c236931a52f46e2eacdee7ec56277a6f6a7336f Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 22 Dec 2022 21:10:17 +0100 Subject: [PATCH 201/275] move setting of loglevel inside test function --- polyply/tests/test_logging.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/polyply/tests/test_logging.py b/polyply/tests/test_logging.py index ed657f96..32cd3ebc 100644 --- a/polyply/tests/test_logging.py +++ b/polyply/tests/test_logging.py @@ -7,9 +7,6 @@ from polyply.tests.test_build_file_parser import test_molecule, test_system from polyply.src.logging import LOGGER, LOGLEVELS -LOGGER.setLevel(LOGLEVELS[1]) - - @pytest.mark.parametrize('_type, option, expected, warning, idxs', ( # tag all nodes 1-4 that have name ALA, GLU, THR should not get tagged and raise warning ("cylinder", @@ -26,6 +23,7 @@ range(9, 12)), )) def test_tag_nodes_logging(caplog, test_molecule, _type, option, expected, warning, idxs): + LOGGER.setLevel(LOGLEVELS[1]) polyply.src.build_file_parser.BuildDirector._tag_nodes(test_molecule, _type, option, "AA") for record, idx in zip(caplog.records, idxs): assert record.getMessage() == warning.format(idx) @@ -34,6 +32,7 @@ def test_tag_nodes_logging(caplog, test_molecule, _type, option, expected, warni assert node in expected def test_mol_directive_logging(caplog, test_system): + LOGGER.setLevel(LOGLEVELS[1]) processor = polyply.src.build_file_parser.BuildDirector([], test_system) line = "AA 0 3" processor._molecule(line) From 934e0faa65236164d4ac9b179d9e788464eef513 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 23 Dec 2022 12:01:23 +0100 Subject: [PATCH 202/275] Update polyply/tests/test_gen_params.py Co-authored-by: Peter C Kroon --- polyply/tests/test_gen_params.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index b5235d46..47d80d2a 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -152,10 +152,4 @@ def test_print_log_warnings(tmp_path, monkeypatch, caplog, warn_type): seq=["test:5"], seq_file=None) - for record in caplog.records: - if record.levelname == warn_type: - if record.getMessage() == f"This is a {warn_type}.": - assert True - break - else: - assert False + assert f"This is a {warn_type}." in [record.getMessage() for record in caplog.records if record.levelname == warn_type] From 2ae869161903bc37e3cb3d523743184a42643b59 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Fri, 23 Dec 2022 12:18:20 +0100 Subject: [PATCH 203/275] add test for logging blocks --- .../gen_params/logging/ERROR_block.ff | 30 +++++++++++++++++++ .../logging/{ERROR.ff => ERROR_link.ff} | 0 .../gen_params/logging/INFO_block.ff | 30 +++++++++++++++++++ .../logging/{INFO.ff => INFO_link.ff} | 0 .../gen_params/logging/WARNING_block.ff | 30 +++++++++++++++++++ .../logging/{WARNING.ff => WARNING_link.ff} | 0 polyply/tests/test_gen_params.py | 12 ++++++-- 7 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 polyply/tests/test_data/gen_params/logging/ERROR_block.ff rename polyply/tests/test_data/gen_params/logging/{ERROR.ff => ERROR_link.ff} (100%) create mode 100644 polyply/tests/test_data/gen_params/logging/INFO_block.ff rename polyply/tests/test_data/gen_params/logging/{INFO.ff => INFO_link.ff} (100%) create mode 100644 polyply/tests/test_data/gen_params/logging/WARNING_block.ff rename polyply/tests/test_data/gen_params/logging/{WARNING.ff => WARNING_link.ff} (100%) diff --git a/polyply/tests/test_data/gen_params/logging/ERROR_block.ff b/polyply/tests/test_data/gen_params/logging/ERROR_block.ff new file mode 100644 index 00000000..bee6b712 --- /dev/null +++ b/polyply/tests/test_data/gen_params/logging/ERROR_block.ff @@ -0,0 +1,30 @@ +; Copyright 2020 University of Groningen +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +;;; test + +[ moleculetype ] +; molname nrexcl +test 1 + +[ atoms ] +;id type resnr residu atom cgnr charge + 1 test 1 test BB 1 0 +[ error ] +This is a ERROR. + +[ link ] +resname "test" +[ bonds ] +BB +BB 1 0.350 1250 {"group": "inner"} diff --git a/polyply/tests/test_data/gen_params/logging/ERROR.ff b/polyply/tests/test_data/gen_params/logging/ERROR_link.ff similarity index 100% rename from polyply/tests/test_data/gen_params/logging/ERROR.ff rename to polyply/tests/test_data/gen_params/logging/ERROR_link.ff diff --git a/polyply/tests/test_data/gen_params/logging/INFO_block.ff b/polyply/tests/test_data/gen_params/logging/INFO_block.ff new file mode 100644 index 00000000..0ca18cad --- /dev/null +++ b/polyply/tests/test_data/gen_params/logging/INFO_block.ff @@ -0,0 +1,30 @@ +; Copyright 2020 University of Groningen +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +;;; test + +[ moleculetype ] +; molname nrexcl +test 1 + +[ atoms ] +;id type resnr residu atom cgnr charge + 1 test 1 test BB 1 0 +[ info ] +This is a INFO. + +[ link ] +resname "test" +[ bonds ] +BB +BB 1 0.350 1250 {"group": "inner"} diff --git a/polyply/tests/test_data/gen_params/logging/INFO.ff b/polyply/tests/test_data/gen_params/logging/INFO_link.ff similarity index 100% rename from polyply/tests/test_data/gen_params/logging/INFO.ff rename to polyply/tests/test_data/gen_params/logging/INFO_link.ff diff --git a/polyply/tests/test_data/gen_params/logging/WARNING_block.ff b/polyply/tests/test_data/gen_params/logging/WARNING_block.ff new file mode 100644 index 00000000..0b3d60c2 --- /dev/null +++ b/polyply/tests/test_data/gen_params/logging/WARNING_block.ff @@ -0,0 +1,30 @@ +; Copyright 2020 University of Groningen +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +;;; test + +[ moleculetype ] +; molname nrexcl +test 1 + +[ atoms ] +;id type resnr residu atom cgnr charge + 1 test 1 test BB 1 0 +[ warning ] +This is a WARNING. + +[ link ] +resname "test" +[ bonds ] +BB +BB 1 0.350 1250 {"group": "inner"} diff --git a/polyply/tests/test_data/gen_params/logging/WARNING.ff b/polyply/tests/test_data/gen_params/logging/WARNING_link.ff similarity index 100% rename from polyply/tests/test_data/gen_params/logging/WARNING.ff rename to polyply/tests/test_data/gen_params/logging/WARNING_link.ff diff --git a/polyply/tests/test_gen_params.py b/polyply/tests/test_gen_params.py index 47d80d2a..3740702e 100644 --- a/polyply/tests/test_gen_params.py +++ b/polyply/tests/test_gen_params.py @@ -127,8 +127,14 @@ def test_find_missing_links(): assert edge["idxA"] == ref[0] assert edge["idxB"] == ref[1] -@pytest.mark.parametrize('warn_type', ['INFO', 'WARNING', 'ERROR']) -def test_print_log_warnings(tmp_path, monkeypatch, caplog, warn_type): +@pytest.mark.parametrize('warn_type, ffobject', + (('INFO', 'link'), + ('INFO', 'block'), + ('WARNING', 'link'), + ('WARNING', 'block'), + ('ERROR', 'link'), + ('ERROR', 'block'))) +def test_print_log_warnings(tmp_path, monkeypatch, caplog, warn_type, ffobject): """ Quick test to make sure that the logging warnings propagate to the gen_params output. @@ -137,7 +143,7 @@ def test_print_log_warnings(tmp_path, monkeypatch, caplog, warn_type): monkeypatch.chdir(tmp_path) # get input file from test data - infile = TEST_DATA / Path(f"gen_params/logging/{warn_type}.ff") + infile = TEST_DATA / Path(f"gen_params/logging/{warn_type}_{ffobject}.ff") # set loglevel loglevel = getattr(logging, warn_type) From 43269abdf84d1865cccf42d4d114e4fc9b6dda6f Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 27 Jan 2023 11:06:20 +0100 Subject: [PATCH 204/275] Add Whole Cell to polyply --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4fa2a47d..9a0ae56c 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,9 @@ force-field, molecule parameters and this program. [Tutorial: PEGylated lipid bilayers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-PEGylated-lipid-bilayers) ## News -- (Feb 8) **Featured Research Article in Nature Communcations.** Our article on the polyply software suite is now featured on the [Editors' Highlights](https://www.nature.com/collections/hhfigaahch) for Structural biology, biochemistry and biophysics in Nature Communications. The Editors’ Highlights pages aims to showcase the 50 best papers recently published in an area. The development team is beyond happy to receive this honor. -- (May 23) **Fighting Cancer with polyply.** Dane et al. used polyply to setup simulations of vesicles and lipid nanodiscs (LNDs) containing PEGylated lipids, which are used as nanocarriers for cancer therapeutics. They find that LNDs are more effective in delivery likely due to their higher flexibility. Check it out in [Nature Materials](https://www.nature.com/articles/s41563-022-01251-z). +- (Feb 8, 22') **Featured Research Article in Nature Communcations.** Our article on the polyply software suite is now featured on the [Editors' Highlights](https://www.nature.com/collections/hhfigaahch) for Structural biology, biochemistry and biophysics in Nature Communications. The Editors’ Highlights pages aims to showcase the 50 best papers recently published in an area. The development team is beyond happy to receive this honor. +- (May 23, 22') **Fighting Cancer with polyply.** Dane et al. used polyply to setup simulations of vesicles and lipid nanodiscs (LNDs) containing PEGylated lipids, which are used as nanocarriers for cancer therapeutics. They find that LNDs are more effective in delivery likely due to their higher flexibility. Check it out in [Nature Materials](https://www.nature.com/articles/s41563-022-01251-z). +- (Jan 18, 23') **Towards whole cell simulations with polyply.** In [a perspective on simulating complete cells](https://www.frontiersin.org/articles/10.3389/fchem.2023.1106495/full) using the Martini force field Stevens *et al.* utilize polyply to reconstruct the full 0.5 Mio bp genome of the Syn3A minimal cell. This impressive task is a good example of the power of the upcoming DNA implementaion into polyply and the role of polyply in the Martini Ecosystem. ## Contributions & Support We are happy to accept submissions of polymer parameters to the polyply library. To submit parameters simply From d71b87c8822001b38b1fca21cf58a412ad3ce9d7 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 27 Jan 2023 11:08:16 +0100 Subject: [PATCH 205/275] Update README.md add link to ssDNA tutorial --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a0ae56c..46ee5501 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ force-field, molecule parameters and this program. [Submissions to Martini Polymer Library](https://github.com/marrink-lab/polyply_1.0/wiki/Submit-polymer-parameters)\ [Tutorial: Martini Polymers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-martini-polymer-melts)\ [Tutorial: GROMOS Polymers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-GROMOS-polymer-melts)\ -[Tutorial: PEGylated lipid bilayers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-PEGylated-lipid-bilayers) - +[Tutorial: PEGylated lipid bilayers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-PEGylated-lipid-bilayers)\ +[Tutorial: Single-stranded DNA](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-Single-stranded-circular-DNA) ## News - (Feb 8, 22') **Featured Research Article in Nature Communcations.** Our article on the polyply software suite is now featured on the [Editors' Highlights](https://www.nature.com/collections/hhfigaahch) for Structural biology, biochemistry and biophysics in Nature Communications. The Editors’ Highlights pages aims to showcase the 50 best papers recently published in an area. The development team is beyond happy to receive this honor. - (May 23, 22') **Fighting Cancer with polyply.** Dane et al. used polyply to setup simulations of vesicles and lipid nanodiscs (LNDs) containing PEGylated lipids, which are used as nanocarriers for cancer therapeutics. They find that LNDs are more effective in delivery likely due to their higher flexibility. Check it out in [Nature Materials](https://www.nature.com/articles/s41563-022-01251-z). From f5f5b935cc5e36ce02cefaf60eaa4270bf9b6057 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:39:14 +0100 Subject: [PATCH 206/275] Update README.md Co-authored-by: Jan Stevens <49684318+jan-stevens@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46ee5501..d7533250 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ force-field, molecule parameters and this program. ## News - (Feb 8, 22') **Featured Research Article in Nature Communcations.** Our article on the polyply software suite is now featured on the [Editors' Highlights](https://www.nature.com/collections/hhfigaahch) for Structural biology, biochemistry and biophysics in Nature Communications. The Editors’ Highlights pages aims to showcase the 50 best papers recently published in an area. The development team is beyond happy to receive this honor. - (May 23, 22') **Fighting Cancer with polyply.** Dane et al. used polyply to setup simulations of vesicles and lipid nanodiscs (LNDs) containing PEGylated lipids, which are used as nanocarriers for cancer therapeutics. They find that LNDs are more effective in delivery likely due to their higher flexibility. Check it out in [Nature Materials](https://www.nature.com/articles/s41563-022-01251-z). -- (Jan 18, 23') **Towards whole cell simulations with polyply.** In [a perspective on simulating complete cells](https://www.frontiersin.org/articles/10.3389/fchem.2023.1106495/full) using the Martini force field Stevens *et al.* utilize polyply to reconstruct the full 0.5 Mio bp genome of the Syn3A minimal cell. This impressive task is a good example of the power of the upcoming DNA implementaion into polyply and the role of polyply in the Martini Ecosystem. +- (Jan 18, 23') **Towards whole cell simulations with polyply.** In [a perspective on whole-cell simulations](https://www.frontiersin.org/articles/10.3389/fchem.2023.1106495/full) using the Martini force field, Stevens *et al.* utilize polyply to construct the full 0.5 Mio bp chromosome of the Syn3A minimal cell. This impressive task is a good example of the power of the upcoming DNA implementation into polyply and the role of polyply in the Martini Ecosystem. ## Contributions & Support We are happy to accept submissions of polymer parameters to the polyply library. To submit parameters simply From 11da428c8e4071cd37477c153790052f706e525e Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Sun, 5 Feb 2023 13:14:32 +0100 Subject: [PATCH 207/275] reduce complexity parsing wrappers --- bin/polyply | 8 +- polyply/src/build_file_parser.py | 5 +- polyply/src/gen_coords.py | 6 +- polyply/src/gen_itp.py | 6 +- polyply/src/gen_seq.py | 2 +- polyply/src/load_library.py | 180 +++++++++++-------------------- 6 files changed, 73 insertions(+), 134 deletions(-) diff --git a/bin/polyply b/bin/polyply index 991b5a6a..2f0986eb 100755 --- a/bin/polyply +++ b/bin/polyply @@ -63,10 +63,10 @@ def main(): # pylint: disable=too-many-locals,too-many-statements 'multiple times.', default=0) file_group = parser_gen_itp.add_argument_group('Input and output options') - file_group.add_argument('-lib', dest='lib', required=False, type=str, + file_group.add_argument('-lib', dest='lib', required=False, type=Path, default=[], help='force-fields to include from library', nargs='*') - file_group.add_argument('-f', dest='inpath', required=False, type=Path, - help='Input file (ITP|FF)', nargs="*") + file_group.add_argument('-f', dest='inpath', type=Path, required=False, default=[], + help='Input file (ITP|FF)', nargs='*') file_group.add_argument('-o', dest='outpath', type=Path, help='Output ITP (ITP)', default=Path('polymer.itp')) seq_group = file_group.add_mutually_exclusive_group(required=True) @@ -97,7 +97,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements help='input file molecules (.gro)', default=None) file_group.add_argument('-mc', dest='coordpath_meta', type=Path, help='input file meta-molecule (.gro)', default=None) - file_group.add_argument('-b', dest='build', type=Path, default=None, + file_group.add_argument('-b', dest='build', type=Path, required=False, default=[], nargs='*', help=('input file; specify molecule specific building options')) topology_group = parser_gen_coords.add_argument_group('Change or modify topology') diff --git a/polyply/src/build_file_parser.py b/polyply/src/build_file_parser.py index 1e961c00..53c04abd 100644 --- a/polyply/src/build_file_parser.py +++ b/polyply/src/build_file_parser.py @@ -260,7 +260,7 @@ def _base_parser_geometry(tokens, _type): geometry_def["parameters"] = parameters return geometry_def -def read_build_file(lines, molecules, topology): +def read_build_file(lines, topology, molecules=None): """ Parses `lines` of itp format and adds the molecule as a block to `force_field`. @@ -271,5 +271,8 @@ def read_build_file(lines, molecules, topology): list of lines of an itp file force_field: :class:`vermouth.forcefield.ForceField` """ + if not molecules: + molecules = topology.molecules + director = BuildDirector(molecules, topology) return list(director.parse(iter(lines))) diff --git a/polyply/src/gen_coords.py b/polyply/src/gen_coords.py index efd8da12..54516cf3 100644 --- a/polyply/src/gen_coords.py +++ b/polyply/src/gen_coords.py @@ -26,7 +26,7 @@ from .topology import Topology from .build_system import BuildSystem from .annotate_ligands import AnnotateLigands, parse_residue_spec, _find_nodes -from .load_library import load_build_options, check_extensions_bld +from .load_library import load_build_files from .check_residue_equivalence import check_residue_equivalence LOGGER = StyleAdapter(get_logger(__name__)) @@ -226,9 +226,7 @@ def gen_coords(toppath, # load in build file LOGGER.info("reading build options", type="step") - if build: - check_extensions_bld(build) - load_build_options(topology, lib, build) + load_build_files(topology, lib, build) # collect all starting points for the molecules start_dict = find_starting_node_from_spec(topology, start) diff --git a/polyply/src/gen_itp.py b/polyply/src/gen_itp.py index 70dfd0e8..2bfc3173 100644 --- a/polyply/src/gen_itp.py +++ b/polyply/src/gen_itp.py @@ -32,7 +32,7 @@ from vermouth.graph_utils import make_residue_graph from polyply import (MetaMolecule, ApplyLinks, Monomer, MapToMolecule) from polyply.src.graph_utils import find_missing_edges -from .load_library import load_ff_library, check_extensions_ff, check_extensions_ff +from .load_library import load_ff_library LOGGER = StyleAdapter(get_logger(__name__)) @@ -59,7 +59,7 @@ def split_seq_string(sequence): monomers.append(Monomer(resname=resname, n_blocks=n_blocks)) return monomers -def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=None, lib=None, seq=None, seq_file=None): +def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=[], lib=None, seq=None, seq_file=None): """ Top level function for running the polyply parameter generation. Parameters seq and seq_file are mutually exclusive. Set the other @@ -83,8 +83,6 @@ def gen_params(name="polymer", outpath=Path("polymer.itp"), inpath=None, lib=Non """ # Import of Itp and FF files LOGGER.info("reading input and library files", type="step") - if inpath: - check_extensions_ff(inpath) force_field = load_ff_library(name, lib, inpath) # Generate the MetaMolecule diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index ef040f3f..903746f5 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -306,7 +306,7 @@ def _tag_nodes(graph, tags, seed=None): def gen_seq(name, outpath, seq, - inpath=None, + inpath=[], macro_strings=[], from_file=None, connects=[], diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 1c718b01..f910a325 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -13,7 +13,7 @@ # limitations under the License. import os -import pathlib +from pathlib import Path import vermouth from vermouth.gmx.rtp import read_rtp from vermouth.citation_parser import read_bib @@ -22,179 +22,119 @@ from .ff_parser_sub import read_ff from .build_file_parser import read_build_file from .polyply_parser import read_polyply -from .topology import Topology LOGGER = StyleAdapter(get_logger(__name__)) +BUILD_FILE_PARSERS = {'bld': read_build_file} FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib} - -def check_extensions_bld(bld_files): +def determine_parser(file_, file_parsers): """ - check the extensions of the - user provided build files + check if file can be parsed and + if possible return the respective parser Parameters ---------- - bld_files: list[`pathlib.PosixPath`] - list of build files - """ - for _file in bld_files: - file_extension = _file.suffix[1:] - if file_extension != 'bld': - msg = "Cannot parse build file with extension {}".format(file_extension) - raise IOError(msg) - -def check_extensions_ff(ff_files): + file_: class:`pathlib.PosixPath` + path to file + file_parsers: dict + dictionary of available file parsers """ - check the extensions of the - user provided forcefield files + file_extension = file_.suffix[1:] + if file_extension not in file_parsers: + msg = "Cannot parse file file with extension {}".format(file_extension) + raise IOError(msg) + else: + return file_parsers[file_extension] - Parameters - ---------- - ff_files: list[`pathlib.PosixPath`] - list of forcefield files - """ - for _file in ff_files: - file_extension = _file.suffix[1:] - if file_extension not in FORCE_FIELD_PARSERS: - msg = "Cannot parse forcefield file with extension {}".format(file_extension) - raise IOError(msg) -def _resolve_lib_paths(lib_names, data_path, allowed_extensions): +def _resolve_lib_paths(lib_names, data_path): """ - select the appropiate files from data_path + select the appropiate files from a file path according to library names given. Parameters ---------- - lib_names: list[`os.path`] + lib_names: list[`pathlib.Path`] list of library names data_path: location of library files - allowed_extensions: list[str] - list of allowed file extensions """ files = [] - for name in lib_names: - directory = os.path.join(data_path, name) - for _file in os.listdir(directory): - _, file_extension = os.path.splitext(_file) - if file_extension[1:] in allowed_extensions: - _file = os.path.join(directory, _file) - files.append(_file) + data_path = Path(data_path) + for name in lib_names or []: + directory = data_path.joinpath(name) + for file_ in os.listdir(directory): + file_path = directory.joinpath(file_) + files.append(file_path) return files -def read_ff_from_files(paths, force_field): +def read_options_from_files(paths, storage_object, file_parsers): """ - read the input files for the defintion of blocks and links. + read the input files for the definition of blocks and links. Parameters ---------- - paths: list[`os.path`] - List of valid file paths - force_field: class:`vermouth.force_field.ForceField` - - Returns - ------- - force_field: class:`vermouth.force_field.ForceField` - updated forcefield + paths: list[`pathlib.Path`] + List of provided file paths + storage_object: topology or forcefield + file_parsers: dict + dictionary of available file parsers """ - def wrapper(parser, path, force_field): + def parse_file(parser, path, storage_object): with open(path, 'r') as file_: lines = file_.readlines() - parser(lines, force_field=force_field) - - for path in paths: - path = pathlib.Path(path) - file_extension = path.suffix.casefold()[1:] - - parser = FORCE_FIELD_PARSERS[file_extension] - wrapper(parser, path, force_field) - - return force_field + parser(lines, storage_object) + for path in paths or []: + parser = determine_parser(path, file_parsers) -def load_ff_library(name, lib_names, extra_files): - """ - Load libraries and extra-files into vermouth - force-field. - - Parameters - ---------- - name: str - Force-field name - lib_names: list[`os.path`] - List of lirbary names - extra_files: list[`os.path`] - List of extra files to include - - Returns - ------- - :class:`vermouth.forcefield.Forcefield` - """ - force_field = vermouth.forcefield.ForceField(name) - if lib_names and extra_files: - lib_files = _resolve_lib_paths(lib_names, DATA_PATH, - FORCE_FIELD_PARSERS.keys()) - all_files = lib_files + extra_files - elif lib_names: - all_files = _resolve_lib_paths(lib_names, DATA_PATH, - FORCE_FIELD_PARSERS.keys()) - elif extra_files: - all_files = extra_files - - read_ff_from_files(all_files, force_field) - return force_field + parse_file(parser, path, storage_object) -def read_build_options_from_files(paths, topology): +def load_build_files(topology, lib_names, build_file): """ - read the input files for the build options and - molecule templates. + Load build file options and molecule templates into topology. Parameters ---------- - paths: list[`os.path`] - List of valid file paths topology: :class:`polyply.src.topology` + build_file: str + List of build files to parse + lib_names: list[str] + List of library names for which to load templates Returns ------- """ - for path in paths: - with open(path, 'r') as file_: - lines = file_.readlines() - read_build_file(lines, topology.molecules, topology) + all_files = _resolve_lib_paths(lib_names, DATA_PATH) + all_files.extend(build_file) + read_options_from_files(all_files, topology, BUILD_FILE_PARSERS) -def load_build_options(topology, lib_names, build_file): +def load_ff_library(name, lib_names, extra_ff_file): """ - Load build file options and molecule templates into topology. + Load libraries and extra-files into vermouth + force-field. Parameters ---------- - topology: :class:`polyply.src.topology` - build_file: str - List of build files to parse - lib_names: list[str] - List of library names for which to load templates + name: str + Force-field name + lib_names: list[`pathlib.Path`] + List of library names + extra_files: list[`pathlib.Path`] + List of extra files to include Returns ------- - + :class:`vermouth.forcefield.Forcefield` """ - if lib_names and build_file: - lib_files = _resolve_lib_paths(lib_names, DATA_PATH, ['bld']) - all_files = lib_files + [build_file] - elif lib_names: - all_files = _resolve_lib_paths(lib_names, DATA_PATH, ['bld']) - elif build_file: - all_files = [build_file] - else: - return - - read_build_options_from_files(all_files, topology) + force_field = vermouth.forcefield.ForceField(name) + all_files = _resolve_lib_paths(lib_names, DATA_PATH) + all_files.extend(extra_ff_file) + read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) + return force_field From 619719ed1d953949b08fded7ace9858f1b88228f Mon Sep 17 00:00:00 2001 From: "f.grunewald" Date: Tue, 7 Feb 2023 15:59:15 +0100 Subject: [PATCH 208/275] add info and force-field parameter link to PDMS --- polyply/data/martini3/PDMS.martini3.ff | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff index 6b47b0c2..781f56b4 100644 --- a/polyply/data/martini3/PDMS.martini3.ff +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -11,7 +11,6 @@ PDMS 1 ; id type resnr residue atom cgnr charge mass 1 DMS 1 PDMS PDMS 1 0.00000 72.00 ; -; [ link ] resname "PDMS" [ bonds ] @@ -34,6 +33,8 @@ resname "PDMS" PDMSter 1 [ atoms ] 1 DMS 1 PDMSter END 1 0.00000 72.00 +[ info ] +Parameters for this model are custom and available for download here: https://github.com/marrink-lab/martini-forcefields/blob/main/martini_forcefields/regular/v3.0.0/gmx_files_contributed/DMS_martini3_v1.itp [ link ] resname "PDMSter|PDMS" @@ -66,3 +67,21 @@ END +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "END-PDMS"} resname "PDMS|PDMSter" [ dihedrals ] PDMS +PDMS ++PDMS +++END 1 1.85 1.2 1 {"group": "PDMS-END"} + +[ link ] +[ atoms ] +PDMS {"resname": "PDMS"} +[ warning ] +You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PPE:4 PDMSter:1 +[ non-edges ] +PDMS +PDMS +PDMS +END + +[ link ] +[ atoms ] +PDMS {"resname": "PDMS"} +[ warning ] +You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PPE:4 PDMSter:1 +[ non-edges ] +PDMS -PDMS +PDMS -END From e7644f9c7073b481a62d06e18a755797a1e0aedd Mon Sep 17 00:00:00 2001 From: Riccardo Alessandri Date: Tue, 7 Feb 2023 22:50:08 -0600 Subject: [PATCH 209/275] Add full Polydimethylsiloxane name to LIBRARY.md --- LIBRARY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LIBRARY.md b/LIBRARY.md index e36d89fd..9501df49 100644 --- a/LIBRARY.md +++ b/LIBRARY.md @@ -25,4 +25,4 @@ |Dextran |DEX | |[martini3](polyply/data/martini3/dextran.martini3.ff) | |DNA nucleobases |Dx, Tx5, Dx3 w/ x=T,G,A,C|[parmbsc1](polyply/data/parmbsc1/dna_final.ff) |[martini2](polyply/data/martini2/DNA_M2.ff) | |Aminoacids |3 letter code | |[martini3](polyply/data/martini3/aminoacids.ff) | -|PDMS |DMS | |[martini3](polyply/data/martini3/PDMS.martini3.ff) +|Polydimethylsiloxane |PDMS | |[martini3](polyply/data/martini3/PDMS.martini3.ff) From 4eca40f6c0bf2422d8e19679b206d6e5216e8259 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:08:17 +0100 Subject: [PATCH 210/275] Update polyply/data/martini3/PDMS.martini3.ff Co-authored-by: Riccardo Alessandri --- polyply/data/martini3/PDMS.martini3.ff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff index 781f56b4..3226fb90 100644 --- a/polyply/data/martini3/PDMS.martini3.ff +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -34,7 +34,7 @@ PDMSter 1 [ atoms ] 1 DMS 1 PDMSter END 1 0.00000 72.00 [ info ] -Parameters for this model are custom and available for download here: https://github.com/marrink-lab/martini-forcefields/blob/main/martini_forcefields/regular/v3.0.0/gmx_files_contributed/DMS_martini3_v1.itp +Parameters for this model are custom and available for download at: https://github.com/marrink-lab/martini-forcefields/blob/main/martini_forcefields/regular/v3.0.0/gmx_files_contributed/DMS_martini3_v1.itp [ link ] resname "PDMSter|PDMS" From 6a54a67e664d05fb9fe9389ad6dd23cde83f7b67 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:08:23 +0100 Subject: [PATCH 211/275] Update polyply/data/martini3/PDMS.martini3.ff Co-authored-by: Riccardo Alessandri --- polyply/data/martini3/PDMS.martini3.ff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff index 3226fb90..126d1bca 100644 --- a/polyply/data/martini3/PDMS.martini3.ff +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -72,7 +72,7 @@ PDMS +PDMS ++PDMS +++END 1 1.85 1.2 1 {"group": "PDMS-END"} [ atoms ] PDMS {"resname": "PDMS"} [ warning ] -You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PPE:4 PDMSter:1 +You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PDMS:4 PDMSter:1 [ non-edges ] PDMS +PDMS PDMS +END From 4b3c1d386620da487070322b0086a76c6d2639aa Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:08:32 +0100 Subject: [PATCH 212/275] Update polyply/data/martini3/PDMS.martini3.ff Co-authored-by: Riccardo Alessandri --- polyply/data/martini3/PDMS.martini3.ff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/data/martini3/PDMS.martini3.ff b/polyply/data/martini3/PDMS.martini3.ff index 126d1bca..06bc0408 100644 --- a/polyply/data/martini3/PDMS.martini3.ff +++ b/polyply/data/martini3/PDMS.martini3.ff @@ -81,7 +81,7 @@ PDMS +END [ atoms ] PDMS {"resname": "PDMS"} [ warning ] -You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PPE:4 PDMSter:1 +You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PDMS:4 PDMSter:1 [ non-edges ] PDMS -PDMS PDMS -END From 972f4bacce5c8334f8cb1aa326942c06d1283341 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Wed, 8 Feb 2023 18:05:45 +0100 Subject: [PATCH 213/275] bug fix + incorporate comments --- polyply/src/load_library.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index f910a325..d2d613d4 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -24,10 +24,10 @@ from .polyply_parser import read_polyply LOGGER = StyleAdapter(get_logger(__name__)) -BUILD_FILE_PARSERS = {'bld': read_build_file} -FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib} +BUILD_FILE_PARSERS = {'bld': read_build_file, 'rtp': None, 'ff': None, 'itp': None, 'bib': None} +FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib, 'bld': None} -def determine_parser(file_, file_parsers): +def get_parser(file_, file_parsers): """ check if file can be parsed and if possible return the respective parser @@ -43,8 +43,7 @@ def determine_parser(file_, file_parsers): if file_extension not in file_parsers: msg = "Cannot parse file file with extension {}".format(file_extension) raise IOError(msg) - else: - return file_parsers[file_extension] + return file_parsers[file_extension] def _resolve_lib_paths(lib_names, data_path): @@ -77,7 +76,7 @@ def read_options_from_files(paths, storage_object, file_parsers): ---------- paths: list[`pathlib.Path`] List of provided file paths - storage_object: topology or forcefield + storage_object: polyply.src.topology.Topology or vermouth.ForceField file_parsers: dict dictionary of available file parsers @@ -89,9 +88,9 @@ def parse_file(parser, path, storage_object): parser(lines, storage_object) for path in paths or []: - parser = determine_parser(path, file_parsers) - - parse_file(parser, path, storage_object) + parser = get_parser(path, file_parsers) + if parser: + parse_file(parser, path, storage_object) def load_build_files(topology, lib_names, build_file): @@ -101,10 +100,10 @@ def load_build_files(topology, lib_names, build_file): Parameters ---------- topology: :class:`polyply.src.topology` - build_file: str - List of build files to parse lib_names: list[str] List of library names for which to load templates + build_file: str + List of build files to parse Returns ------- From 96d91513b1eef5e1f0514635797a885ac68f9917 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Mon, 27 Feb 2023 15:43:53 +0100 Subject: [PATCH 214/275] added AA parsing to fasta file reading --- polyply/src/simple_seq_parsers.py | 44 ++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/polyply/src/simple_seq_parsers.py b/polyply/src/simple_seq_parsers.py index f5ec9c13..25b67265 100644 --- a/polyply/src/simple_seq_parsers.py +++ b/polyply/src/simple_seq_parsers.py @@ -31,6 +31,28 @@ "G": "G", "T": "U"} +ONE_LETTER_AA = {"G": "GLY", + "A": "ALA", + "V": "VAL", + "C": "CYS", + "P": "PRO", + "L": "LEU", + "I": "ILE", + "M": "MET", + "W": "TRP", + "F": "PHE", + "S": "SER", + "T": "THR", + "Y": "TYR", + "N": "ASN", + "Q": "GLN", + "K": "LYS", + "R": "ARG", + "H": "HIS", + "D": "ASP", + "E": "GLU", + } + class FileFormatError(Exception): """Raised when a parser fails due to invalid file format.""" @@ -79,7 +101,7 @@ def _parse_plain_delimited(filepath, delimiter=" "): parse_txt = _parse_plain_delimited -def _parse_plain(lines, DNA=False, RNA=False): +def _parse_plain(lines, DNA=False, RNA=False, AA=False): """ Parse a plain one letter sequence block either for DNA, RNA, or amino-acids. Lines can be a list of strings or a string. @@ -118,6 +140,8 @@ def _parse_plain(lines, DNA=False, RNA=False): resname = ONE_LETTER_DNA[token] elif token in ONE_LETTER_RNA and RNA: resname = ONE_LETTER_RNA[token] + elif token in ONE_LETTER_AA and AA: + resname = ONE_LETTER_AA[token] else: msg = f"Cannot find one letter residue match for {token}" raise IOError(msg) @@ -125,8 +149,9 @@ def _parse_plain(lines, DNA=False, RNA=False): monomers.append(resname) # make sure to set the defaults for the DNA and RNA terminals - monomers[0] = monomers[0] + "5" - monomers[-1] = monomers[-1] + "3" + if RNA or DNA: + monomers[0] = monomers[0] + "5" + monomers[-1] = monomers[-1] + "3" seq_graph = _monomers_to_linear_nx_graph(monomers) return seq_graph @@ -156,20 +181,25 @@ def _identify_nucleotypes(comments): """ RNA = False DNA = False + AA = False + print(comments) for comment in comments: if "DNA" in comment: DNA = True if "RNA" in comment: RNA = True + + if "PROTEIN" in comment: + AA = True if RNA and DNA: raise FileFormatError("Found both RNA and DNA keyword in comment. Choose one.") - if not RNA and not DNA: + if not RNA and not DNA and not AA: raise FileFormatError("Cannot identify if sequence is RNA or DNA from comment.") - return DNA, RNA + return DNA, RNA, AA def parse_ig(filepath): """ @@ -265,7 +295,7 @@ def parse_fasta(filepath): clean_lines = [] # first line must be a comment line - DNA, RNA =_identify_nucleotypes([lines[0]]) + DNA, RNA, AA =_identify_nucleotypes([lines[0]]) for line in lines[1:]: if '>' in line: @@ -274,7 +304,7 @@ def parse_fasta(filepath): clean_lines.append(line) - seq_graph = _parse_plain(clean_lines, RNA=RNA, DNA=DNA) + seq_graph = _parse_plain(clean_lines, RNA=RNA, DNA=DNA, AA=AA) return seq_graph def parse_json(filepath): From eee8d9655cc527ec4623c6d83dead501ad2cd08e Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Mon, 27 Feb 2023 16:37:14 +0100 Subject: [PATCH 215/275] missed the change in behaviour of parse_ig --- polyply/src/simple_seq_parsers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polyply/src/simple_seq_parsers.py b/polyply/src/simple_seq_parsers.py index 25b67265..d765ddc7 100644 --- a/polyply/src/simple_seq_parsers.py +++ b/polyply/src/simple_seq_parsers.py @@ -250,8 +250,8 @@ def parse_ig(filepath): msg = "The sequence is not complete, it does not end with 1 or 2." raise FileFormatError(msg) - DNA, RNA = _identify_nucleotypes(comments) - seq_graph = _parse_plain(clean_lines[1:], DNA=DNA, RNA=RNA) + DNA, RNA, AA = _identify_nucleotypes(comments) + seq_graph = _parse_plain(clean_lines[1:], DNA=DNA, RNA=RNA, AA=AA) if ter_char == '2': nnodes = len(seq_graph.nodes) From fbe403962b92d1f6feb4bbd3e34e16f4656647e9 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 11:54:04 +0100 Subject: [PATCH 216/275] made changes to parser and tests as requested --- polyply/src/simple_seq_parsers.py | 14 +++++------ polyply/tests/test_simple_seq_parsers.py | 31 ++++++++++++++++++------ 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/polyply/src/simple_seq_parsers.py b/polyply/src/simple_seq_parsers.py index d765ddc7..70ad3182 100644 --- a/polyply/src/simple_seq_parsers.py +++ b/polyply/src/simple_seq_parsers.py @@ -156,10 +156,10 @@ def _parse_plain(lines, DNA=False, RNA=False, AA=False): seq_graph = _monomers_to_linear_nx_graph(monomers) return seq_graph -def _identify_nucleotypes(comments): +def _identify_residues(comments): """ From a comment found in the ig or fasta file, identify if - the sequence is RNA or DNA sequence by checking if these + the sequence is RNA, DNA, or AA sequence by checking if these keywords are in the comment lines. Raise an error if none or conflicting information are found. @@ -171,18 +171,18 @@ def _identify_nucleotypes(comments): Returns ------- bool, bool - is it DNA, RNA + is it DNA, RNA, AA Raises ------ FileFormatError - neither RNA nor DNA keywords are found + neither RNA nor DNA nor AA keywords are found both RNA and DNA are found """ RNA = False DNA = False AA = False - print(comments) + for comment in comments: if "DNA" in comment: DNA = True @@ -250,7 +250,7 @@ def parse_ig(filepath): msg = "The sequence is not complete, it does not end with 1 or 2." raise FileFormatError(msg) - DNA, RNA, AA = _identify_nucleotypes(comments) + DNA, RNA, AA = _identify_residues(comments) seq_graph = _parse_plain(clean_lines[1:], DNA=DNA, RNA=RNA, AA=AA) if ter_char == '2': @@ -295,7 +295,7 @@ def parse_fasta(filepath): clean_lines = [] # first line must be a comment line - DNA, RNA, AA =_identify_nucleotypes([lines[0]]) + DNA, RNA, AA =_identify_residues([lines[0]]) for line in lines[1:]: if '>' in line: diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index 13d9cae9..0fd111d0 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -20,37 +20,54 @@ from polyply import TEST_DATA from polyply.src.meta_molecule import MetaMolecule from .example_fixtures import example_meta_molecule -from polyply.src.simple_seq_parsers import (_identify_nucleotypes, +from polyply.src.simple_seq_parsers import (_identify_residues, _monomers_to_linear_nx_graph, _parse_plain, FileFormatError) -@pytest.mark.parametrize('comments, DNA, RNA', ( +@pytest.mark.parametrize('comments, DNA, RNA, PROTEIN', ( # single DNA comment (["DNA lorem ipsum"], True, + False, False ), # single RNA comment (["RNA lorem ipsum"], False, - True + True, + False ), # single DNA comment multiple lines (["lorem ipsum", "random line DNA", "DNA another line"], True, + False, False ), # single RNA comment multiple lines (["lorem ipsum", "random line RNA", "RNA another line"], + False, + True, + False + ), + # single AA comment + (['lorem ipsum PROTEIN'], + False, False, True ), - )) -def test_identify_nucleotypes(comments, DNA, RNA): - out_DNA, out_RNA = _identify_nucleotypes(comments) + # singe AA comment multiple lines + (["lorem ipsum", "random line PROTEIN", "PROTEIN another line"], + False, + False, + True + ), + )) +def test_identify_nucleotypes(comments, DNA, RNA, AA): + out_DNA, out_RNA, out_AA = _identify_residues(comments) assert out_DNA == DNA assert out_RNA == RNA + assert out_AA == AA @pytest.mark.parametrize('comments', ( # both DNA and RNA are defined @@ -60,7 +77,7 @@ def test_identify_nucleotypes(comments, DNA, RNA): )) def test_identify_nucleotypes_fail(comments): with pytest.raises(FileFormatError): - _identify_nucleotypes(comments) + _identify_residues(comments) def _node_match(nodeA, nodeB): resname = nodeA["resname"] == nodeB["resname"] From 74479fd2c40990494c22d6e1bf714ded51a0a77c Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 12:45:43 +0100 Subject: [PATCH 217/275] corrected typo --- polyply/tests/test_simple_seq_parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index 0fd111d0..b2d3aec1 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -25,7 +25,7 @@ _parse_plain, FileFormatError) -@pytest.mark.parametrize('comments, DNA, RNA, PROTEIN', ( +@pytest.mark.parametrize('comments, DNA, RNA, AA', ( # single DNA comment (["DNA lorem ipsum"], True, From 2cf63f1e0c3fd99ed21b8ba3c5e26d9bc2212f2d Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 13:23:21 +0100 Subject: [PATCH 218/275] added test for sequence parsing and required files --- polyply/src/simple_seq_parsers.py | 6 ++++-- .../tests/test_data/simple_seq_files/test_protein.fasta | 2 ++ polyply/tests/test_data/simple_seq_files/test_protein.ig | 4 ++++ polyply/tests/test_simple_seq_parsers.py | 8 ++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 polyply/tests/test_data/simple_seq_files/test_protein.fasta create mode 100644 polyply/tests/test_data/simple_seq_files/test_protein.ig diff --git a/polyply/src/simple_seq_parsers.py b/polyply/src/simple_seq_parsers.py index 70ad3182..3ebd29e8 100644 --- a/polyply/src/simple_seq_parsers.py +++ b/polyply/src/simple_seq_parsers.py @@ -120,6 +120,8 @@ def _parse_plain(lines, DNA=False, RNA=False, AA=False): if the sequence matches DNA RNA: bool if the sequence matches RNA + AA: bool + if the sequence matches AA Returns ------- @@ -197,7 +199,7 @@ def _identify_residues(comments): raise FileFormatError("Found both RNA and DNA keyword in comment. Choose one.") if not RNA and not DNA and not AA: - raise FileFormatError("Cannot identify if sequence is RNA or DNA from comment.") + raise FileFormatError("Cannot identify if sequence is RNA, DNA, or PROTEIN, from comment.") return DNA, RNA, AA @@ -267,7 +269,7 @@ def parse_ig(filepath): def parse_fasta(filepath): """ - Read fasta sequence of DNA/RNA. + Read fasta sequence of DNA/RNA/PROTEIN. The parser automatically translates the one letter code to the double letter nucleobase resnames, sets special residue names diff --git a/polyply/tests/test_data/simple_seq_files/test_protein.fasta b/polyply/tests/test_data/simple_seq_files/test_protein.fasta new file mode 100644 index 00000000..bdb17ca9 --- /dev/null +++ b/polyply/tests/test_data/simple_seq_files/test_protein.fasta @@ -0,0 +1,2 @@ +> PROTEIN +GAKWNVFPS diff --git a/polyply/tests/test_data/simple_seq_files/test_protein.ig b/polyply/tests/test_data/simple_seq_files/test_protein.ig new file mode 100644 index 00000000..8361f915 --- /dev/null +++ b/polyply/tests/test_data/simple_seq_files/test_protein.ig @@ -0,0 +1,4 @@ +; some random comment +; here we say PROTEIN +title +GAKWNVFPS diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index b2d3aec1..eeb91fee 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -128,6 +128,14 @@ def test_sequence_parses_RNA(extension): ref_graph = _monomers_to_linear_nx_graph(monomers) assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) +def test_sequence_parses_PROTEIN(extension): + filepath = Path(TEST_DATA + "/simple_seq_files/test_protein."+ extension) + seq_graph = MetaMolecule.parsers[extension](filepath) + # replace below with your small protein sequence; ignore termini + monomers = ["G", "A", "K", "W", "N", "V", "F", "P", "S"] + ref_graph = _monomers_to_linear_nx_graph(monomers) + assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) + def test_unkown_nucleotype_error(): with pytest.raises(IOError): lines = ["AABBBCCTG"] From ee9839a2d34eb0b3c82cfb668c035c1a37a4d6e4 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 13:51:26 +0100 Subject: [PATCH 219/275] added test parametric and removed protein.ig test .ig files are not a protein file format, so these don't need to be tested --- polyply/tests/test_data/simple_seq_files/test_protein.ig | 4 ---- polyply/tests/test_simple_seq_parsers.py | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 polyply/tests/test_data/simple_seq_files/test_protein.ig diff --git a/polyply/tests/test_data/simple_seq_files/test_protein.ig b/polyply/tests/test_data/simple_seq_files/test_protein.ig deleted file mode 100644 index 8361f915..00000000 --- a/polyply/tests/test_data/simple_seq_files/test_protein.ig +++ /dev/null @@ -1,4 +0,0 @@ -; some random comment -; here we say PROTEIN -title -GAKWNVFPS diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index eeb91fee..5df388a8 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -128,6 +128,9 @@ def test_sequence_parses_RNA(extension): ref_graph = _monomers_to_linear_nx_graph(monomers) assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) +@pytest.mark.parametrize('extension, ', ( + "fasta" + )) def test_sequence_parses_PROTEIN(extension): filepath = Path(TEST_DATA + "/simple_seq_files/test_protein."+ extension) seq_graph = MetaMolecule.parsers[extension](filepath) From 15735d95a0338fb47e1773a3b1a7ae5bebd43599 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 14:11:13 +0100 Subject: [PATCH 220/275] made requested changes to test --- polyply/tests/test_simple_seq_parsers.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index 5df388a8..3ea67c1d 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -128,12 +128,10 @@ def test_sequence_parses_RNA(extension): ref_graph = _monomers_to_linear_nx_graph(monomers) assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) -@pytest.mark.parametrize('extension, ', ( - "fasta" - )) -def test_sequence_parses_PROTEIN(extension): - filepath = Path(TEST_DATA + "/simple_seq_files/test_protein."+ extension) - seq_graph = MetaMolecule.parsers[extension](filepath) +@pytest.mark.parametrize() +def test_sequence_parses_PROTEIN(): + filepath = Path(TEST_DATA + "/simple_seq_files/test_protein.fasta") + seq_graph = MetaMolecule.parsers["fasta"](filepath) # replace below with your small protein sequence; ignore termini monomers = ["G", "A", "K", "W", "N", "V", "F", "P", "S"] ref_graph = _monomers_to_linear_nx_graph(monomers) From 8147f97c5df2550dce09d79ef459dc0dabd78997 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 14:16:33 +0100 Subject: [PATCH 221/275] removed unnecessary test header --- polyply/tests/test_simple_seq_parsers.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index 3ea67c1d..1f91ad24 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -128,11 +128,9 @@ def test_sequence_parses_RNA(extension): ref_graph = _monomers_to_linear_nx_graph(monomers) assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) -@pytest.mark.parametrize() def test_sequence_parses_PROTEIN(): filepath = Path(TEST_DATA + "/simple_seq_files/test_protein.fasta") seq_graph = MetaMolecule.parsers["fasta"](filepath) - # replace below with your small protein sequence; ignore termini monomers = ["G", "A", "K", "W", "N", "V", "F", "P", "S"] ref_graph = _monomers_to_linear_nx_graph(monomers) assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) From 762270ffe72d03e4013037fdf841ff15d04a311f Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 14:25:49 +0100 Subject: [PATCH 222/275] corrected test result for protein fasta --- polyply/tests/test_simple_seq_parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index 1f91ad24..e0d6e17b 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -131,7 +131,7 @@ def test_sequence_parses_RNA(extension): def test_sequence_parses_PROTEIN(): filepath = Path(TEST_DATA + "/simple_seq_files/test_protein.fasta") seq_graph = MetaMolecule.parsers["fasta"](filepath) - monomers = ["G", "A", "K", "W", "N", "V", "F", "P", "S"] + monomers = ["GLY", "ALA" "LYS", "TRP", "ASN", "VAL", "PHE", "PRO", "SER"] ref_graph = _monomers_to_linear_nx_graph(monomers) assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) From b33cdbf578c590bd6fb97f52d80f9fc8e9ecddc4 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Fri, 3 Mar 2023 14:57:05 +0100 Subject: [PATCH 223/275] missed a comma in the list --- polyply/tests/test_simple_seq_parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/tests/test_simple_seq_parsers.py b/polyply/tests/test_simple_seq_parsers.py index e0d6e17b..3cf9e174 100644 --- a/polyply/tests/test_simple_seq_parsers.py +++ b/polyply/tests/test_simple_seq_parsers.py @@ -131,7 +131,7 @@ def test_sequence_parses_RNA(extension): def test_sequence_parses_PROTEIN(): filepath = Path(TEST_DATA + "/simple_seq_files/test_protein.fasta") seq_graph = MetaMolecule.parsers["fasta"](filepath) - monomers = ["GLY", "ALA" "LYS", "TRP", "ASN", "VAL", "PHE", "PRO", "SER"] + monomers = ["GLY", "ALA", "LYS", "TRP", "ASN", "VAL", "PHE", "PRO", "SER"] ref_graph = _monomers_to_linear_nx_graph(monomers) assert nx.is_isomorphic(seq_graph, ref_graph, node_match=_node_match) From 0a2e04fb851ed4a316207cca52ef8e3cfac62cb0 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 9 Mar 2023 14:06:44 +0100 Subject: [PATCH 224/275] assign proper resid to first residue --- polyply/src/map_to_molecule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 63721ff7..e879e344 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -209,6 +209,8 @@ def add_blocks(self, meta_molecule): # get the first node and convert it to molecule start_node = node_keys[0] new_mol = self.force_field.blocks[self.node_to_block[start_node]].to_molecule() + # set the resid of the new-molecule in case we don't start with 1 + nx.set_node_attributes(new_mol, resid_dict[start_node], "resid") # in this case the node belongs to a fragment for which there is a # multiresidue block @@ -244,7 +246,7 @@ def add_blocks(self, meta_molecule): if node in self.added_fragment_nodes: fragment_id = self.node_to_fragment[node] correspondence = self.multiblock_correspondence[fragment_id] - # in this case we have to add the node from the block definitions + # in this case we have to add the node from the block definitions else: block = self.force_field.blocks[self.node_to_block[node]] # if the block represents more than one residue all residues From d6f3bdb24a600dd26609cc1201d273600647e2e6 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 9 Mar 2023 15:03:28 +0100 Subject: [PATCH 225/275] test resid starting with higher number than 1 --- polyply/tests/test_map_to_molecule.py | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/polyply/tests/test_map_to_molecule.py b/polyply/tests/test_map_to_molecule.py index aa62a500..fa32fa3a 100644 --- a/polyply/tests/test_map_to_molecule.py +++ b/polyply/tests/test_map_to_molecule.py @@ -442,3 +442,45 @@ def test_error_missing_residues_multi(lines, monomers, from_itp): # map to molecule with pytest.raises(IOError): polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) + + +@pytest.mark.parametrize('nmon, resids', ( + (4, (1, 2, 3, 4)), + (4, (100, 101, 102, 103)), +# gaps are not supported at the moment +# (4, (1, 2, 5, 6)), + (4, (1, 3, 2, 4)), + )) +def test_resid_assigment(nmon, resids): + """ + Test if the resids are assigned correctly + to the high-res molecule and graph fragment. + """ + lines =""" + [ moleculetype ] + ; name nexcl. + PEO 1 + ; + [ atoms ] + 1 SN1a 1 R2 C1 1 0.000 45 + """ + lines = textwrap.dedent(lines).splitlines() + ff = vermouth.forcefield.ForceField(name='test_ff') + polyply.src.polyply_parser.read_polyply(lines, ff) + # build the meta-molecule + meta_mol = MetaMolecule(name="test", force_field=ff) + nodes = list(range(0, nmon)) + node_to_resid = dict(zip(nodes, resids)) + for node, resid in node_to_resid.items(): + meta_mol.add_monomer(node, "PEO", []) + meta_mol.nodes[node]['resid'] = resid + meta_mol.add_edges_from(zip(nodes[:-1], nodes[1:])) + + # map to molecule + new_meta_mol = polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) + # check that the resids are set correctly + for node in new_meta_mol.nodes: + ref_resid = node_to_resid[node] + assert new_meta_mol.nodes[node]['resid'] == ref_resid + attr_node = list(new_meta_mol.nodes[node]['graph'].nodes)[0] + assert new_meta_mol.nodes[node]['graph'].nodes[attr_node]['resid'] == ref_resid From ae86adac6b866ce627692aa2907ddc9779ea90b0 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 9 Mar 2023 15:03:54 +0100 Subject: [PATCH 226/275] assign proper resid to first residue --- polyply/src/map_to_molecule.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index e879e344..090170c9 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -209,8 +209,6 @@ def add_blocks(self, meta_molecule): # get the first node and convert it to molecule start_node = node_keys[0] new_mol = self.force_field.blocks[self.node_to_block[start_node]].to_molecule() - # set the resid of the new-molecule in case we don't start with 1 - nx.set_node_attributes(new_mol, resid_dict[start_node], "resid") # in this case the node belongs to a fragment for which there is a # multiresidue block @@ -236,6 +234,9 @@ def add_blocks(self, meta_molecule): if len(set(nx.get_node_attributes(new_mol, "resid").values())) > 1: raise IOError(MultiblockError.format(meta_molecule.nodes[start_node]["resname"])) + # set the resid of the new-molecule in case we don't start with 1 + nx.set_node_attributes(new_mol, resid_dict[start_node], "resid") + # we store the block together with the residue node meta_molecule.nodes[start_node]["graph"] = new_mol.copy() @@ -258,7 +259,6 @@ def add_blocks(self, meta_molecule): raise IOError(MultiblockError.format(self.node_to_block[node])) correspondence = new_mol.merge_molecule(block) - # make the residue from the correspondence residue = _correspondence_to_residue(meta_molecule, new_mol, From 73dc93e60bf43e6f69e7cb46cfd4fc901cc186eb Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 17 Mar 2023 15:47:27 +0100 Subject: [PATCH 227/275] fix parsing behaviour: selectively ignore files in data library --- bin/polyply | 2 ++ polyply/src/build_file_parser.py | 4 +++- polyply/src/gen_seq.py | 2 +- polyply/src/load_library.py | 29 ++++++++++++++++------------- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/bin/polyply b/bin/polyply index 2f0986eb..dea62a43 100755 --- a/bin/polyply +++ b/bin/polyply @@ -99,6 +99,8 @@ def main(): # pylint: disable=too-many-locals,too-many-statements help='input file meta-molecule (.gro)', default=None) file_group.add_argument('-b', dest='build', type=Path, required=False, default=[], nargs='*', help=('input file; specify molecule specific building options')) + file_group.add_argument('-lib', dest='lib', required=False, type=Path, default=[], + help='force-fields to include from library', nargs='*') topology_group = parser_gen_coords.add_argument_group('Change or modify topology') topology_group.add_argument('-res', dest='build_res', type=str, diff --git a/polyply/src/build_file_parser.py b/polyply/src/build_file_parser.py index 53c04abd..f3df6738 100644 --- a/polyply/src/build_file_parser.py +++ b/polyply/src/build_file_parser.py @@ -269,7 +269,9 @@ def read_build_file(lines, topology, molecules=None): ---------- lines: list list of lines of an itp file - force_field: :class:`vermouth.forcefield.ForceField` + topology: :class:`polypyl.src.topology.Topology` + molecules: list[:class:`~vermouth.molecule.Molecule`] + The molecules in the system. """ if not molecules: molecules = topology.molecules diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index 903746f5..649b21e2 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -365,7 +365,7 @@ def gen_seq(name, macros = {} if from_file: - force_field = load_ff_library("seq", None, inpath) + force_field = load_ff_library("seq", [], inpath) for tag_name in from_file: tag, name = tag_name.split(":") macros[tag] = MacroFile(name, force_field) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index d2d613d4..df029377 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -24,10 +24,10 @@ from .polyply_parser import read_polyply LOGGER = StyleAdapter(get_logger(__name__)) -BUILD_FILE_PARSERS = {'bld': read_build_file, 'rtp': None, 'ff': None, 'itp': None, 'bib': None} -FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib, 'bld': None} +BUILD_FILE_PARSERS = {'bld': read_build_file} +FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib} -def get_parser(file_, file_parsers): +def get_parser(file_, file_parsers, is_lib_file): """ check if file can be parsed and if possible return the respective parser @@ -38,15 +38,18 @@ def get_parser(file_, file_parsers): path to file file_parsers: dict dictionary of available file parsers + is_lib_file: bool + indicates whether the provided path is from a data library """ file_extension = file_.suffix[1:] - if file_extension not in file_parsers: - msg = "Cannot parse file file with extension {}".format(file_extension) + if file_extension in file_parsers: + return file_parsers[file_extension] + elif not is_lib_file: + msg = "Cannot parse user provided file with extension {file_extension}." raise IOError(msg) - return file_parsers[file_extension] -def _resolve_lib_paths(lib_names, data_path): +def _resolve_lib_files(lib_names, data_path): """ select the appropiate files from a file path according to library names given. @@ -87,8 +90,10 @@ def parse_file(parser, path, storage_object): lines = file_.readlines() parser(lines, storage_object) - for path in paths or []: - parser = get_parser(path, file_parsers) + lib_files, user_files = paths + for path in user_files + lib_files or []: + is_lib_file = path in lib_files + parser = get_parser(path, file_parsers, is_lib_file) if parser: parse_file(parser, path, storage_object) @@ -109,8 +114,7 @@ def load_build_files(topology, lib_names, build_file): ------- """ - all_files = _resolve_lib_paths(lib_names, DATA_PATH) - all_files.extend(build_file) + all_files = [_resolve_lib_files(lib_names, DATA_PATH), build_file] read_options_from_files(all_files, topology, BUILD_FILE_PARSERS) @@ -133,7 +137,6 @@ def load_ff_library(name, lib_names, extra_ff_file): :class:`vermouth.forcefield.Forcefield` """ force_field = vermouth.forcefield.ForceField(name) - all_files = _resolve_lib_paths(lib_names, DATA_PATH) - all_files.extend(extra_ff_file) + all_files = [_resolve_lib_files(lib_names, DATA_PATH), extra_ff_file] read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) return force_field From 1ffb82e03084d7feb5768dd29168443b1e7ac7c0 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 17 Mar 2023 15:48:19 +0100 Subject: [PATCH 228/275] tests for library loading behaviour --- polyply/tests/test_build_file_parser.py | 16 ++++----- polyply/tests/test_gen_seq.py | 3 +- polyply/tests/test_load_library.py | 47 ++++++++++++------------- 3 files changed, 32 insertions(+), 34 deletions(-) diff --git a/polyply/tests/test_build_file_parser.py b/polyply/tests/test_build_file_parser.py index fb4447d5..a56ecf53 100644 --- a/polyply/tests/test_build_file_parser.py +++ b/polyply/tests/test_build_file_parser.py @@ -217,8 +217,8 @@ def test_parser(test_system, lines, tagged_mols, tagged_nodes): ff = vermouth.forcefield.ForceField(name='test_ff') top = Topology(ff) polyply.src.build_file_parser.read_build_file(lines, - test_system.molecules, - top) + top, + test_system.molecules) for idx, mol in enumerate(test_system.molecules): for node in mol.nodes: if "restraints" in mol.nodes[node]: @@ -261,8 +261,8 @@ def test_persistence_parsers(test_system, lines, expected): ff = vermouth.forcefield.ForceField(name='test_ff') top = Topology(ff) polyply.src.build_file_parser.read_build_file(lines, - test_system.molecules, - top) + top, + test_system.molecules) for ref, new in zip(expected, top.persistences): print(ref, new) for info_ref, info_new in zip(ref[:-1], new[:-1]): @@ -286,8 +286,8 @@ def test_volume_parsing(test_system, line, expected): lines = textwrap.dedent(line) lines = lines.splitlines() polyply.src.build_file_parser.read_build_file(lines, - test_system.molecules, - test_system) + test_system, + test_system.molecules) assert test_system.volumes == expected @pytest.mark.parametrize('line, names, edges, positions, out_vol', ( @@ -401,8 +401,8 @@ def test_template_volume_parsing(test_system, line, names, edges, positions, out lines = textwrap.dedent(line) lines = lines.splitlines() polyply.src.build_file_parser.read_build_file(lines, - test_system.molecules, - test_system) + test_system, + test_system.molecules) for mol in test_system.molecules: assert len(mol.templates) == len(names) for idx, name in enumerate(names): diff --git a/polyply/tests/test_gen_seq.py b/polyply/tests/test_gen_seq.py index 033f586a..d573e371 100644 --- a/polyply/tests/test_gen_seq.py +++ b/polyply/tests/test_gen_seq.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import json +from pathlib import Path import networkx as nx from networkx.readwrite import json_graph import pytest @@ -181,7 +182,7 @@ def test_tag_nodes(tags, expected, seed): seq=["A", "B"]), TEST_DATA + "/gen_seq/ref/PEO_PS_ref.json"), (dict(outpath=TEST_DATA + "/gen_seq/output/lysoPEG.json", - inpath=[TEST_DATA + "/gen_seq/input/molecule_0.itp"], + inpath=[Path(TEST_DATA + "/gen_seq/input/molecule_0.itp")], macro_strings=["A:5:1:PEG-1.0"], from_file=["PROT:molecule_0"], name="test", diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index 37d528df..09a98ad2 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -26,40 +26,36 @@ import vermouth import polyply from polyply import TEST_DATA +from polyply import DATA_PATH from polyply.src.topology import Topology -from polyply.src.load_library import FORCE_FIELD_PARSERS -from polyply.src.load_library import _resolve_lib_paths -from polyply.src.load_library import read_ff_from_files -from polyply.src.load_library import load_build_options -from polyply.src.load_library import check_extensions_ff -from polyply.src.load_library import check_extensions_bld +from polyply.src.load_library import FORCE_FIELD_PARSERS, BUILD_FILE_PARSERS +from polyply.src.load_library import _resolve_lib_files, get_parser +from polyply.src.load_library import load_build_files, read_options_from_files +from polyply.src.build_file_parser import read_build_file @contextmanager def nullcontext(enter_result=None): yield enter_result -@pytest.mark.parametrize("ff_file, expectation", [ - [[Path('forcefield.ff')], nullcontext()], - [[Path('forcefield.bld')], pytest.raises(IOError)], +@pytest.mark.parametrize("file_, file_parser, ignore_bld_files, expectation", [ + [Path('forcefield.ff'), FORCE_FIELD_PARSERS, True, nullcontext()], + [Path('forcefield.bld'), FORCE_FIELD_PARSERS, True, nullcontext()], + [Path('forcefield.ff'), BUILD_FILE_PARSERS, False, pytest.raises(IOError)], + [Path('forcefield.bld'), BUILD_FILE_PARSERS, False, nullcontext()], ]) -def test_check_extensions_ff(ff_file, expectation): +def test_get_parser(file_, file_parser, ignore_bld_files, expectation): with expectation as e: - check_extensions_ff(ff_file) + parser = get_parser(file_, file_parser, ignore_bld_files) -@pytest.mark.parametrize("bld_file, expectation", [ - [[Path('forcefield.ff')], pytest.raises(IOError)], - [[Path('forcefield.bld')], nullcontext()], -]) -def test_check_extensions_bld(bld_file, expectation): - with expectation as e: - check_extensions_bld(bld_file) def test_read_ff_from_files(): name = "ff" force_field = vermouth.forcefield.ForceField(name) - lib_files = _resolve_lib_paths([name], TEST_DATA, FORCE_FIELD_PARSERS.keys()) - read_ff_from_files(lib_files, force_field) + lib_files = _resolve_lib_files([name], TEST_DATA) + user_files = [] + all_files = [lib_files, user_files] + read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) # Check if .ff files were parsed assert force_field.blocks @@ -67,14 +63,15 @@ def test_read_ff_from_files(): def test_read_build_options_from_files(): - topfile = 'topology_test/system.top' - bldfile = 'topology_test/test.bld' + topfile = Path('topology_test/system.top') + bldfile = Path('topology_test/test.bld') lib_names = ['2016H66'] - toppath = os.path.join(TEST_DATA, topfile) + toppath = Path(TEST_DATA).joinpath(topfile) topology = Topology.from_gmx_topfile(name='test', path=toppath) topology.preprocess() - bldpath = os.path.join(TEST_DATA, bldfile) - load_build_options(topology, lib_names, bldpath) + + user_files = [Path(TEST_DATA).joinpath(bldfile)] + load_build_files(topology, lib_names, user_files) # check if build files are parsed assert topology.volumes == {'PMMA': 1.0} From 577aa06bec76db2997a466df975208e3e47b4cbd Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Wed, 22 Mar 2023 15:03:02 +0100 Subject: [PATCH 229/275] only accept one ff to load templates from --- bin/polyply | 4 ++-- polyply/src/load_library.py | 9 +++++---- polyply/tests/test_load_library.py | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/polyply b/bin/polyply index dea62a43..ad4de054 100755 --- a/bin/polyply +++ b/bin/polyply @@ -99,8 +99,8 @@ def main(): # pylint: disable=too-many-locals,too-many-statements help='input file meta-molecule (.gro)', default=None) file_group.add_argument('-b', dest='build', type=Path, required=False, default=[], nargs='*', help=('input file; specify molecule specific building options')) - file_group.add_argument('-lib', dest='lib', required=False, type=Path, default=[], - help='force-fields to include from library', nargs='*') + file_group.add_argument('-lib', dest='lib', required=False, type=Path, default=None, + help='molecule templates can be loaded from force field library') topology_group = parser_gen_coords.add_argument_group('Change or modify topology') topology_group.add_argument('-res', dest='build_res', type=str, diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index df029377..c07a173c 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -98,15 +98,15 @@ def parse_file(parser, path, storage_object): parse_file(parser, path, storage_object) -def load_build_files(topology, lib_names, build_file): +def load_build_files(topology, lib_name, build_file): """ Load build file options and molecule templates into topology. Parameters ---------- topology: :class:`polyply.src.topology` - lib_names: list[str] - List of library names for which to load templates + lib_name: str + Library from where to load templates build_file: str List of build files to parse @@ -114,7 +114,8 @@ def load_build_files(topology, lib_names, build_file): ------- """ - all_files = [_resolve_lib_files(lib_names, DATA_PATH), build_file] + lib_name = [lib_name] if lib_name else [] + all_files = [_resolve_lib_files(lib_name, DATA_PATH), build_file] read_options_from_files(all_files, topology, BUILD_FILE_PARSERS) diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index 09a98ad2..b9a2cfab 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -65,13 +65,13 @@ def test_read_build_options_from_files(): topfile = Path('topology_test/system.top') bldfile = Path('topology_test/test.bld') - lib_names = ['2016H66'] + lib_name = '2016H66' toppath = Path(TEST_DATA).joinpath(topfile) topology = Topology.from_gmx_topfile(name='test', path=toppath) topology.preprocess() user_files = [Path(TEST_DATA).joinpath(bldfile)] - load_build_files(topology, lib_names, user_files) + load_build_files(topology, lib_name, user_files) # check if build files are parsed assert topology.volumes == {'PMMA': 1.0} From a0ef337c51b36c326332a42db7a8af28870b2c23 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 23 Mar 2023 18:16:01 +0100 Subject: [PATCH 230/275] add optional forcefield argument to load_ff_library --- polyply/src/load_library.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index c07a173c..512158c6 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -119,7 +119,7 @@ def load_build_files(topology, lib_name, build_file): read_options_from_files(all_files, topology, BUILD_FILE_PARSERS) -def load_ff_library(name, lib_names, extra_ff_file): +def load_ff_library(name, lib_names, extra_ff_files, force_field=None): """ Load libraries and extra-files into vermouth force-field. @@ -135,9 +135,9 @@ def load_ff_library(name, lib_names, extra_ff_file): Returns ------- - :class:`vermouth.forcefield.Forcefield` + `vermouth.forcefield.Forcefield` """ - force_field = vermouth.forcefield.ForceField(name) - all_files = [_resolve_lib_files(lib_names, DATA_PATH), extra_ff_file] - read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) - return force_field + if not force_field: + force_field = vermouth.forcefield.ForceField(name) + all_files = [_resolve_lib_files(lib_names, DATA_PATH), extra_ff_files] + return read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) From 530811f3a7ff14b8eb3f21e93003369a2c4259f4 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 23 Mar 2023 18:18:25 +0100 Subject: [PATCH 231/275] rename file_ to file_path --- polyply/src/load_library.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 512158c6..a4591098 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -27,21 +27,21 @@ BUILD_FILE_PARSERS = {'bld': read_build_file} FORCE_FIELD_PARSERS = {'rtp': read_rtp, 'ff': read_ff, 'itp': read_polyply, 'bib': read_bib} -def get_parser(file_, file_parsers, is_lib_file): +def get_parser(file_path, file_parsers, is_lib_file): """ check if file can be parsed and if possible return the respective parser Parameters ---------- - file_: class:`pathlib.PosixPath` + file_path: `pathlib.PosixPath` path to file file_parsers: dict dictionary of available file parsers is_lib_file: bool indicates whether the provided path is from a data library """ - file_extension = file_.suffix[1:] + file_extension = file_path.suffix[1:] if file_extension in file_parsers: return file_parsers[file_extension] elif not is_lib_file: From 760c0bded77945a50bcd26a67b87a9f639070455 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 23 Mar 2023 18:19:40 +0100 Subject: [PATCH 232/275] Warning when unkown file in library --- polyply/src/load_library.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index a4591098..153dd162 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -14,6 +14,7 @@ import os from pathlib import Path +from collections import ChainMap import vermouth from vermouth.gmx.rtp import read_rtp from vermouth.citation_parser import read_bib @@ -45,8 +46,11 @@ def get_parser(file_path, file_parsers, is_lib_file): if file_extension in file_parsers: return file_parsers[file_extension] elif not is_lib_file: - msg = "Cannot parse user provided file with extension {file_extension}." + msg = f"Cannot parse user provided file with extension {file_extension}." raise IOError(msg) + elif file_extension not in ChainMap(FORCE_FIELD_PARSERS, BUILD_FILE_PARSERS): + msg = f"File with unknown extension {file_extension} found in force field library." + LOGGER.warning(msg) def _resolve_lib_files(lib_names, data_path): From c6630cffdcde8dc8d0f58b97f12197e3bea61995 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 23 Mar 2023 18:21:26 +0100 Subject: [PATCH 233/275] Return storage object --- polyply/src/load_library.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 153dd162..6c4c8707 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -87,6 +87,9 @@ def read_options_from_files(paths, storage_object, file_parsers): file_parsers: dict dictionary of available file parsers + Returns + ------- + `polyply.src.topology.Topology` or `vermouth.forcefield.Forcefield` """ def parse_file(parser, path, storage_object): @@ -100,6 +103,7 @@ def parse_file(parser, path, storage_object): parser = get_parser(path, file_parsers, is_lib_file) if parser: parse_file(parser, path, storage_object) + return storage_object def load_build_files(topology, lib_name, build_file): From 6e23d73680a28a5c9eeb6d22c3824a717805391f Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Thu, 23 Mar 2023 18:22:58 +0100 Subject: [PATCH 234/275] Improved docstrings and variable names --- polyply/src/load_library.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/polyply/src/load_library.py b/polyply/src/load_library.py index 6c4c8707..ca6915ac 100644 --- a/polyply/src/load_library.py +++ b/polyply/src/load_library.py @@ -81,11 +81,12 @@ def read_options_from_files(paths, storage_object, file_parsers): Parameters ---------- - paths: list[`pathlib.Path`] - List of provided file paths - storage_object: polyply.src.topology.Topology or vermouth.ForceField + paths: list[list[`pathlib.Path`], list[`pathlib.Path`]] + The list contains exactly two sublist, respectively list containing + the resolved library files and user provided files. + storage_object: `polyply.src.topology.Topology` or `vermouth.forcefield.Forcefield` file_parsers: dict - dictionary of available file parsers + Dictionary of available file parsers Returns ------- @@ -106,16 +107,16 @@ def parse_file(parser, path, storage_object): return storage_object -def load_build_files(topology, lib_name, build_file): +def load_build_files(topology, lib_name, build_files): """ Load build file options and molecule templates into topology. Parameters ---------- - topology: :class:`polyply.src.topology` - lib_name: str + topology: `polyply.src.topology` + lib_name: `pathlib.Path` Library from where to load templates - build_file: str + build_files: list[`pathlib.Path`] List of build files to parse Returns @@ -123,7 +124,7 @@ def load_build_files(topology, lib_name, build_file): """ lib_name = [lib_name] if lib_name else [] - all_files = [_resolve_lib_files(lib_name, DATA_PATH), build_file] + all_files = [_resolve_lib_files(lib_name, DATA_PATH), build_files] read_options_from_files(all_files, topology, BUILD_FILE_PARSERS) From e6a784ef5ef11f0297f50e9601a0a8030d68a408 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 24 Mar 2023 11:36:52 +0100 Subject: [PATCH 235/275] Add test for unknown file warning --- polyply/tests/test_data/ff/unknown_file.txt | 0 polyply/tests/test_load_library.py | 27 ++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 polyply/tests/test_data/ff/unknown_file.txt diff --git a/polyply/tests/test_data/ff/unknown_file.txt b/polyply/tests/test_data/ff/unknown_file.txt new file mode 100644 index 00000000..e69de29b diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index b9a2cfab..8e0f31f6 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -12,26 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. """ -Test linear algebra aux functions. +Test library loading behaviour. """ -import textwrap +import os +import logging import pytest from pathlib import Path -import numpy as np -import os -import math from contextlib import contextmanager -import networkx as nx import vermouth -import polyply from polyply import TEST_DATA -from polyply import DATA_PATH from polyply.src.topology import Topology from polyply.src.load_library import FORCE_FIELD_PARSERS, BUILD_FILE_PARSERS from polyply.src.load_library import _resolve_lib_files, get_parser from polyply.src.load_library import load_build_files, read_options_from_files -from polyply.src.build_file_parser import read_build_file @contextmanager @@ -49,18 +43,29 @@ def test_get_parser(file_, file_parser, ignore_bld_files, expectation): parser = get_parser(file_, file_parser, ignore_bld_files) -def test_read_ff_from_files(): +def test_read_ff_from_files(caplog): + name = "ff" force_field = vermouth.forcefield.ForceField(name) lib_files = _resolve_lib_files([name], TEST_DATA) user_files = [] all_files = [lib_files, user_files] - read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) + + # Check if warning is thrown for unknown file + caplog.set_level(logging.WARNING) + with caplog.at_level(logging.WARNING): + read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) + for record in caplog.records: + assert record.levelname == "WARNING" + break + else: + assert False # Check if .ff files were parsed assert force_field.blocks assert force_field.links + def test_read_build_options_from_files(): topfile = Path('topology_test/system.top') From d7b66d2c0fff86a32ca975fda8be884f5e3d9316 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 24 Mar 2023 11:46:52 +0100 Subject: [PATCH 236/275] Fixed test for older python versions --- polyply/tests/test_load_library.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index 8e0f31f6..6aead57c 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -53,11 +53,12 @@ def test_read_ff_from_files(caplog): # Check if warning is thrown for unknown file caplog.set_level(logging.WARNING) + msg = "File with unknown extension txt found in force field library." with caplog.at_level(logging.WARNING): read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) for record in caplog.records: - assert record.levelname == "WARNING" - break + if record.message == msg: + break else: assert False From b1b8beb96533e8e0cc241321baa081dbab8bb157 Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 24 Mar 2023 13:03:42 +0100 Subject: [PATCH 237/275] Trying to figure out why the tests fail --- polyply/tests/test_load_library.py | 1 + 1 file changed, 1 insertion(+) diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index 6aead57c..3bca448d 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -56,6 +56,7 @@ def test_read_ff_from_files(caplog): msg = "File with unknown extension txt found in force field library." with caplog.at_level(logging.WARNING): read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) + print(caplog.records) for record in caplog.records: if record.message == msg: break From 911a548f7f2b6e2f92b4e724ccf5faae5ecf16dc Mon Sep 17 00:00:00 2001 From: jan-stevens Date: Fri, 24 Mar 2023 13:09:40 +0100 Subject: [PATCH 238/275] This might fix the test --- polyply/tests/test_load_library.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/polyply/tests/test_load_library.py b/polyply/tests/test_load_library.py index 3bca448d..86d2857a 100644 --- a/polyply/tests/test_load_library.py +++ b/polyply/tests/test_load_library.py @@ -22,6 +22,7 @@ from contextlib import contextmanager import vermouth from polyply import TEST_DATA +from polyply.src.logging import LOGGER from polyply.src.topology import Topology from polyply.src.load_library import FORCE_FIELD_PARSERS, BUILD_FILE_PARSERS from polyply.src.load_library import _resolve_lib_files, get_parser @@ -52,11 +53,12 @@ def test_read_ff_from_files(caplog): all_files = [lib_files, user_files] # Check if warning is thrown for unknown file - caplog.set_level(logging.WARNING) + loglevel = getattr(logging, 'WARNING') + LOGGER.setLevel(loglevel) + msg = "File with unknown extension txt found in force field library." - with caplog.at_level(logging.WARNING): + with caplog.at_level(loglevel): read_options_from_files(all_files, force_field, FORCE_FIELD_PARSERS) - print(caplog.records) for record in caplog.records: if record.message == msg: break From 94c5ee53214fd04602a7498079069197fe1a32c8 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 9 Mar 2023 14:06:44 +0100 Subject: [PATCH 239/275] assign proper resid to first residue --- polyply/src/map_to_molecule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 63721ff7..e879e344 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -209,6 +209,8 @@ def add_blocks(self, meta_molecule): # get the first node and convert it to molecule start_node = node_keys[0] new_mol = self.force_field.blocks[self.node_to_block[start_node]].to_molecule() + # set the resid of the new-molecule in case we don't start with 1 + nx.set_node_attributes(new_mol, resid_dict[start_node], "resid") # in this case the node belongs to a fragment for which there is a # multiresidue block @@ -244,7 +246,7 @@ def add_blocks(self, meta_molecule): if node in self.added_fragment_nodes: fragment_id = self.node_to_fragment[node] correspondence = self.multiblock_correspondence[fragment_id] - # in this case we have to add the node from the block definitions + # in this case we have to add the node from the block definitions else: block = self.force_field.blocks[self.node_to_block[node]] # if the block represents more than one residue all residues From cd40e5056fce220abe3552d5eb7012573e56d487 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 9 Mar 2023 15:03:28 +0100 Subject: [PATCH 240/275] test resid starting with higher number than 1 --- polyply/tests/test_map_to_molecule.py | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/polyply/tests/test_map_to_molecule.py b/polyply/tests/test_map_to_molecule.py index aa62a500..fa32fa3a 100644 --- a/polyply/tests/test_map_to_molecule.py +++ b/polyply/tests/test_map_to_molecule.py @@ -442,3 +442,45 @@ def test_error_missing_residues_multi(lines, monomers, from_itp): # map to molecule with pytest.raises(IOError): polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) + + +@pytest.mark.parametrize('nmon, resids', ( + (4, (1, 2, 3, 4)), + (4, (100, 101, 102, 103)), +# gaps are not supported at the moment +# (4, (1, 2, 5, 6)), + (4, (1, 3, 2, 4)), + )) +def test_resid_assigment(nmon, resids): + """ + Test if the resids are assigned correctly + to the high-res molecule and graph fragment. + """ + lines =""" + [ moleculetype ] + ; name nexcl. + PEO 1 + ; + [ atoms ] + 1 SN1a 1 R2 C1 1 0.000 45 + """ + lines = textwrap.dedent(lines).splitlines() + ff = vermouth.forcefield.ForceField(name='test_ff') + polyply.src.polyply_parser.read_polyply(lines, ff) + # build the meta-molecule + meta_mol = MetaMolecule(name="test", force_field=ff) + nodes = list(range(0, nmon)) + node_to_resid = dict(zip(nodes, resids)) + for node, resid in node_to_resid.items(): + meta_mol.add_monomer(node, "PEO", []) + meta_mol.nodes[node]['resid'] = resid + meta_mol.add_edges_from(zip(nodes[:-1], nodes[1:])) + + # map to molecule + new_meta_mol = polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) + # check that the resids are set correctly + for node in new_meta_mol.nodes: + ref_resid = node_to_resid[node] + assert new_meta_mol.nodes[node]['resid'] == ref_resid + attr_node = list(new_meta_mol.nodes[node]['graph'].nodes)[0] + assert new_meta_mol.nodes[node]['graph'].nodes[attr_node]['resid'] == ref_resid From 16c1e570702d37a833fea6bf0b803827cbe294f8 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Thu, 9 Mar 2023 15:03:54 +0100 Subject: [PATCH 241/275] assign proper resid to first residue --- polyply/src/map_to_molecule.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index e879e344..090170c9 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -209,8 +209,6 @@ def add_blocks(self, meta_molecule): # get the first node and convert it to molecule start_node = node_keys[0] new_mol = self.force_field.blocks[self.node_to_block[start_node]].to_molecule() - # set the resid of the new-molecule in case we don't start with 1 - nx.set_node_attributes(new_mol, resid_dict[start_node], "resid") # in this case the node belongs to a fragment for which there is a # multiresidue block @@ -236,6 +234,9 @@ def add_blocks(self, meta_molecule): if len(set(nx.get_node_attributes(new_mol, "resid").values())) > 1: raise IOError(MultiblockError.format(meta_molecule.nodes[start_node]["resname"])) + # set the resid of the new-molecule in case we don't start with 1 + nx.set_node_attributes(new_mol, resid_dict[start_node], "resid") + # we store the block together with the residue node meta_molecule.nodes[start_node]["graph"] = new_mol.copy() @@ -258,7 +259,6 @@ def add_blocks(self, meta_molecule): raise IOError(MultiblockError.format(self.node_to_block[node])) correspondence = new_mol.merge_molecule(block) - # make the residue from the correspondence residue = _correspondence_to_residue(meta_molecule, new_mol, From 846f4c8c63d77fe7edc761ebb333120cf65c6a76 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sun, 2 Apr 2023 18:03:13 +0200 Subject: [PATCH 242/275] move pbc_complete and max_dim check to linalg module --- polyply/src/linalg_functions.py | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/polyply/src/linalg_functions.py b/polyply/src/linalg_functions.py index d22d0fab..17f78237 100644 --- a/polyply/src/linalg_functions.py +++ b/polyply/src/linalg_functions.py @@ -235,3 +235,38 @@ def _rotate_xyz(object_xyz, theta_x, theta_y, theta_z): return rotated_object rotate_xyz = jit(_rotate_xyz) + +def not_exceeds_max_dimensions(point, maxdim): + """ + Check if point is within the compontents of + the maxdim vector. Note that all coodinates in + polyply are definiet positive. + + Parameters: + ----------- + point: np.ndarray + maxdim: np.ndarray + + Returns: + -------- + bool + """ + return np.all(point <= maxdim) and np.all(point >= np.array([0., 0., 0.])) + +def pbc_complete(point, maxdim): + """ + Wrap point around pbc conditions to keep + points from being larger than the compontents of + the maxdim vector. Note that all coodinates in + polyply are definiet positive. + + Parameters: + ----------- + point: np.ndarray + maxdim: np.ndarray + + Returns: + -------- + np.ndarray + """ + return point % maxdim From c3a678497c99e1038b62dcd345bbab789955afd7 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sun, 2 Apr 2023 18:03:33 +0200 Subject: [PATCH 243/275] remove pbc_complete and max_dim check from rw module --- polyply/src/random_walk.py | 43 ++------------------------------------ 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/polyply/src/random_walk.py b/polyply/src/random_walk.py index 539801a7..2463b886 100644 --- a/polyply/src/random_walk.py +++ b/polyply/src/random_walk.py @@ -17,8 +17,7 @@ from numpy.linalg import norm import networkx as nx from .processor import Processor -from .linalg_functions import norm_sphere -from .linalg_functions import _vector_angle_degrees +from .linalg_functions import _vector_angle_degrees, not_exceeds_max_dimensions, norm_sphere, pbc_complete from .graph_utils import neighborhood from .meta_molecule import _find_starting_node """ @@ -26,26 +25,6 @@ coordinates for a meta-molecule. """ - -def pbc_complete(point, maxdim): - """ - Wrap point around pbc conditions to keep - points from being larger than the compontents of - the maxdim vector. Note that all coodinates in - polyply are definiet positive. - - Parameters: - ----------- - point: np.ndarray - maxdim: np.ndarray - - Returns: - -------- - np.ndarray - """ - return point % maxdim - - def _take_step(vectors, step_length, coord, box): """ Given a list of unit `vectors` choose one randomly, @@ -69,24 +48,6 @@ def _take_step(vectors, step_length, coord, box): new_coord = pbc_complete(new_coord, box) return new_coord, index - -def not_exceeds_max_dimensions(point, maxdim): - """ - Check if point is within the compontents of - the maxdim vector. Note that all coodinates in - polyply are definiet positive. - - Parameters: - ----------- - point: np.ndarray - maxdim: np.ndarray - - Returns: - -------- - bool - """ - return np.all(point < maxdim) and np.all(point > np.array([0., 0., 0.])) - def is_restricted(point, old_point, node_dict): """ The function checks, if the step `old_point` to @@ -381,7 +342,7 @@ def _random_walk(self, meta_molecule): if "position" not in meta_molecule.nodes[first_node]: constrained = fulfill_geometrical_constraints(self.start, self.molecule.nodes[first_node]) - + print(constrained) if constrained and not self._is_overlap(self.start, first_node): self.nonbond_matrix.add_positions(self.start, self.mol_idx, From 3692f45c403eda383fd2fca391129ffc3f109699 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sun, 2 Apr 2023 18:05:01 +0200 Subject: [PATCH 244/275] implement warning; replace cKDTree by KDTree as per deprecation --- polyply/src/nonbond_engine.py | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/polyply/src/nonbond_engine.py b/polyply/src/nonbond_engine.py index 3b454f62..ddcdbc4a 100644 --- a/polyply/src/nonbond_engine.py +++ b/polyply/src/nonbond_engine.py @@ -16,6 +16,7 @@ import scipy.spatial from polyply import jit from .topology import lorentz_berthelot_rule +from .linalg_functions import not_exceeds_max_dimensions def _lennard_jones_force(dist, point, ref, params): """ @@ -106,8 +107,8 @@ def __init__(self, self.boxsize = boxsize self.defined_idxs = [list(np.where(self.positions[:, 0].reshape(-1) != np.inf)[0])] - self.position_trees = [scipy.spatial.ckdtree.cKDTree(positions[self.defined_idxs[-1]], - boxsize=boxsize)] + self.position_trees = [scipy.spatial.KDTree(positions[self.defined_idxs[-1]], + boxsize=boxsize)] # given a global node index, in which tree is the position saved self.gndx_to_tree = {idx: 0 for idx in self.defined_idxs[0]} @@ -131,8 +132,8 @@ def concatenate_trees(self): saved over multiple trees into a single tree. """ self.defined_idxs = [list(np.where(self.positions[:, 0].reshape(-1) != np.inf)[0])] - self.position_trees = [scipy.spatial.ckdtree.cKDTree(self.positions[self.defined_idxs[-1]], - boxsize=self.boxsize)] + self.position_trees = [scipy.spatial.KDTree(self.positions[self.defined_idxs[-1]], + boxsize=self.boxsize)] self.gndx_to_tree = {idx: 0 for idx in self.defined_idxs[0]} def add_positions(self, point, mol_idx, node_key, start=True): @@ -149,14 +150,14 @@ def add_positions(self, point, mol_idx, node_key, start=True): if start and self.position_trees[-1].n > 5000: self.defined_idxs.append([gndx]) self.gndx_to_tree[gndx] = len(self.position_trees) - self.position_trees.append(scipy.spatial.ckdtree.cKDTree(point.reshape(1,3), + self.position_trees.append(scipy.spatial.KDTree(point.reshape(1,3), boxsize=self.boxsize, balanced_tree=False, compact_nodes=False)) else: self.defined_idxs[-1].append(gndx) self.gndx_to_tree[gndx] = len(self.position_trees) - 1 - new_tree = scipy.spatial.ckdtree.cKDTree(self.positions[self.defined_idxs[-1]], + new_tree = scipy.spatial.KDTree(self.positions[self.defined_idxs[-1]], boxsize=self.boxsize, balanced_tree=False, compact_nodes=False) @@ -187,10 +188,10 @@ def remove_positions(self, mol_idx, node_keys): tree_idxs.append(tree_idx) for tree_idx in tree_idxs: - new_tree = scipy.spatial.ckdtree.cKDTree(self.positions[self.defined_idxs[tree_idx]], - boxsize=self.boxsize, - balanced_tree=False, - compact_nodes=False) + new_tree = scipy.spatial.KDTree(self.positions[self.defined_idxs[tree_idx]], + boxsize=self.boxsize, + balanced_tree=False, + compact_nodes=False) self.position_trees[tree_idx] = new_tree def pbc_min_dist(self, pos_a, pos_b): @@ -269,8 +270,8 @@ def compute_force_point(self, point, mol_idx, node, exclude=[], potential="LJ"): """ exclusions = [self.nodes_to_gndx[(mol_idx, node)] for node in exclude] - ref_tree = scipy.spatial.ckdtree.cKDTree(point.reshape(1, 3), - boxsize=self.boxsize) + ref_tree = scipy.spatial.KDTree(point.reshape(1, 3), + boxsize=self.boxsize) force = 0 for pos_tree, defined_idxs in zip(self.position_trees, self.defined_idxs): @@ -318,7 +319,14 @@ def from_topology(cls, molecules, topology, box): for molecule in molecules: for node in molecule.nodes: if "position" in molecule.nodes[node]: - positions[idx, :] = molecule.nodes[node]["position"] + # check if position is inside grid + if not_exceeds_max_dimensions(molecule.nodes[node]["position"], box): + positions[idx, :] = molecule.nodes[node]["position"] + else: + print(molecule.nodes[node]["position"], molecule.nodes[node]) + msg = ("Provided coordinate exceeds maximum box dimensions." + "Make sure all coordiantes are wrapped inside the box") + raise IOError(msg) resname = molecule.nodes[node]["resname"] atom_types.append(resname) From 7c58276fb109e3ed052cecdf83988f81b0741759 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sun, 2 Apr 2023 18:05:21 +0200 Subject: [PATCH 245/275] add test for logic check --- polyply/tests/test_nb_engine.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/polyply/tests/test_nb_engine.py b/polyply/tests/test_nb_engine.py index 691dda38..4aa59354 100644 --- a/polyply/tests/test_nb_engine.py +++ b/polyply/tests/test_nb_engine.py @@ -159,7 +159,6 @@ def test_update_positions_in_molecules(topology): positions = np.random.random(5*3).reshape(-1, 3) for mol_idx, mol in enumerate(topology.molecules): for node in mol.nodes: - print(mol_idx, node) mol.nodes[node]["position"] = positions[mol_idx + node] nb_engine = NonBondEngine.from_topology(topology.molecules, @@ -216,5 +215,12 @@ def test_LJ_force(dist, ref, expected): point = np.array([0.0, 0.0, 0.0]) params = (0.35, 2.1) value = polyply.src.nonbond_engine._lennard_jones_force(dist, point, ref, params) - print(value) assert np.allclose(value, expected) + +def test_init_coord_error(topology): + topology.molecules[2].nodes[0]['position'] = np.array([11., 11., 11.]) + with pytest.raises(IOError): + # initiate the nb_engine + nb_engine = NonBondEngine.from_topology(topology.molecules, + topology, + box=np.array([10., 10., 10.])) From 5ee9d6f267fa9dd1db49e457ebeb846a0a56166a Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sun, 2 Apr 2023 18:15:33 +0200 Subject: [PATCH 246/275] provide more detail for error message on too large inital coords --- polyply/src/nonbond_engine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/polyply/src/nonbond_engine.py b/polyply/src/nonbond_engine.py index ddcdbc4a..b9493b91 100644 --- a/polyply/src/nonbond_engine.py +++ b/polyply/src/nonbond_engine.py @@ -323,9 +323,11 @@ def from_topology(cls, molecules, topology, box): if not_exceeds_max_dimensions(molecule.nodes[node]["position"], box): positions[idx, :] = molecule.nodes[node]["position"] else: - print(molecule.nodes[node]["position"], molecule.nodes[node]) - msg = ("Provided coordinate exceeds maximum box dimensions." - "Make sure all coordiantes are wrapped inside the box") + mol_name = molecule.mol_name + resname = molecule.nodes[node]['resname'] + msg = (f"Provided coordinate for residue {resname} in molecule {mol_name}\n" + f"with molecule index {idx} exceeds maximum box dimensions.\n" + "Make sure all coordiantes are wrapped inside the box.") raise IOError(msg) resname = molecule.nodes[node]["resname"] From 36488c28fbb960c0bdeb2080d323574128021505 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Sun, 2 Apr 2023 18:18:13 +0200 Subject: [PATCH 247/275] require scipy 1.6.0 to be complient with change in KDTree naming --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 6e9602aa..9f671339 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,7 +36,7 @@ install-requires = # ?? requires-dist? decorator == 4.4.2 networkx ~= 2.0 vermouth >= 0.9.1 - scipy + scipy >= 1.6.0 tqdm zip-safe = False From 7c98d4f6009fbb3c0f73ce405eb0bc1d2d9da6b9 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 4 Apr 2023 11:45:53 +0200 Subject: [PATCH 248/275] fix docstring and typoes --- polyply/src/linalg_functions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polyply/src/linalg_functions.py b/polyply/src/linalg_functions.py index 17f78237..3b7da24b 100644 --- a/polyply/src/linalg_functions.py +++ b/polyply/src/linalg_functions.py @@ -238,9 +238,9 @@ def _rotate_xyz(object_xyz, theta_x, theta_y, theta_z): def not_exceeds_max_dimensions(point, maxdim): """ - Check if point is within the compontents of - the maxdim vector. Note that all coodinates in - polyply are definiet positive. + Check if point is within the components of + the maxdim vector. Note that all coordinates in + polyply are positive semi-definite. Parameters: ----------- From d711fda4ed492253fd63034ce5d06283a09d630d Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 4 Apr 2023 11:47:21 +0200 Subject: [PATCH 249/275] remove contaminating line from other PR --- polyply/src/map_to_molecule.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 090170c9..d5249b6d 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -234,9 +234,6 @@ def add_blocks(self, meta_molecule): if len(set(nx.get_node_attributes(new_mol, "resid").values())) > 1: raise IOError(MultiblockError.format(meta_molecule.nodes[start_node]["resname"])) - # set the resid of the new-molecule in case we don't start with 1 - nx.set_node_attributes(new_mol, resid_dict[start_node], "resid") - # we store the block together with the residue node meta_molecule.nodes[start_node]["graph"] = new_mol.copy() @@ -247,7 +244,7 @@ def add_blocks(self, meta_molecule): if node in self.added_fragment_nodes: fragment_id = self.node_to_fragment[node] correspondence = self.multiblock_correspondence[fragment_id] - # in this case we have to add the node from the block definitions + # in this case we have to add the node from the block definitions else: block = self.force_field.blocks[self.node_to_block[node]] # if the block represents more than one residue all residues From c290dc6d70d312a40b617e2cd41044bbaa3589e0 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 4 Apr 2023 11:51:35 +0200 Subject: [PATCH 250/275] add error for non finite coordinates --- polyply/src/nonbond_engine.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/polyply/src/nonbond_engine.py b/polyply/src/nonbond_engine.py index b9493b91..623ace7e 100644 --- a/polyply/src/nonbond_engine.py +++ b/polyply/src/nonbond_engine.py @@ -320,8 +320,16 @@ def from_topology(cls, molecules, topology, box): for node in molecule.nodes: if "position" in molecule.nodes[node]: # check if position is inside grid - if not_exceeds_max_dimensions(molecule.nodes[node]["position"], box): + is_finite = np.isfinite(molecule.nodes[node]["position"]) + if not_exceeds_max_dimensions(molecule.nodes[node]["position"], box) and is_finite: positions[idx, :] = molecule.nodes[node]["position"] + elif not is_finite: + mol_name = molecule.mol_name + resname = molecule.nodes[node]['resname'] + msg = (f"Provided coordinate for residue {resname} in molecule {mol_name}\n" + f"with molecule index {idx} is not finite. All coordinates in\n" + "polyply must be positive semi-definite.") + raise IOError(msg) else: mol_name = molecule.mol_name resname = molecule.nodes[node]['resname'] From 59501d4ccdcee1827c848cd868f190678f7bc60a Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 4 Apr 2023 11:56:03 +0200 Subject: [PATCH 251/275] remove contaminating test from other PR --- polyply/tests/test_map_to_molecule.py | 42 --------------------------- 1 file changed, 42 deletions(-) diff --git a/polyply/tests/test_map_to_molecule.py b/polyply/tests/test_map_to_molecule.py index fa32fa3a..aa62a500 100644 --- a/polyply/tests/test_map_to_molecule.py +++ b/polyply/tests/test_map_to_molecule.py @@ -442,45 +442,3 @@ def test_error_missing_residues_multi(lines, monomers, from_itp): # map to molecule with pytest.raises(IOError): polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) - - -@pytest.mark.parametrize('nmon, resids', ( - (4, (1, 2, 3, 4)), - (4, (100, 101, 102, 103)), -# gaps are not supported at the moment -# (4, (1, 2, 5, 6)), - (4, (1, 3, 2, 4)), - )) -def test_resid_assigment(nmon, resids): - """ - Test if the resids are assigned correctly - to the high-res molecule and graph fragment. - """ - lines =""" - [ moleculetype ] - ; name nexcl. - PEO 1 - ; - [ atoms ] - 1 SN1a 1 R2 C1 1 0.000 45 - """ - lines = textwrap.dedent(lines).splitlines() - ff = vermouth.forcefield.ForceField(name='test_ff') - polyply.src.polyply_parser.read_polyply(lines, ff) - # build the meta-molecule - meta_mol = MetaMolecule(name="test", force_field=ff) - nodes = list(range(0, nmon)) - node_to_resid = dict(zip(nodes, resids)) - for node, resid in node_to_resid.items(): - meta_mol.add_monomer(node, "PEO", []) - meta_mol.nodes[node]['resid'] = resid - meta_mol.add_edges_from(zip(nodes[:-1], nodes[1:])) - - # map to molecule - new_meta_mol = polyply.src.map_to_molecule.MapToMolecule(ff).run_molecule(meta_mol) - # check that the resids are set correctly - for node in new_meta_mol.nodes: - ref_resid = node_to_resid[node] - assert new_meta_mol.nodes[node]['resid'] == ref_resid - attr_node = list(new_meta_mol.nodes[node]['graph'].nodes)[0] - assert new_meta_mol.nodes[node]['graph'].nodes[attr_node]['resid'] == ref_resid From 929738b0ddf98504e756a710cea02cf214e64ec6 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 4 Apr 2023 11:56:31 +0200 Subject: [PATCH 252/275] remove print --- polyply/src/random_walk.py | 1 - 1 file changed, 1 deletion(-) diff --git a/polyply/src/random_walk.py b/polyply/src/random_walk.py index 2463b886..cb8acc3f 100644 --- a/polyply/src/random_walk.py +++ b/polyply/src/random_walk.py @@ -342,7 +342,6 @@ def _random_walk(self, meta_molecule): if "position" not in meta_molecule.nodes[first_node]: constrained = fulfill_geometrical_constraints(self.start, self.molecule.nodes[first_node]) - print(constrained) if constrained and not self._is_overlap(self.start, first_node): self.nonbond_matrix.add_positions(self.start, self.mol_idx, From d829a9496fa56e2484b0b6e0ea3b0845778f63c8 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 4 Apr 2023 12:00:13 +0200 Subject: [PATCH 253/275] add tests for non finite coords and more tests --- polyply/src/nonbond_engine.py | 2 +- polyply/tests/test_nb_engine.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/polyply/src/nonbond_engine.py b/polyply/src/nonbond_engine.py index 623ace7e..a02ecf55 100644 --- a/polyply/src/nonbond_engine.py +++ b/polyply/src/nonbond_engine.py @@ -320,7 +320,7 @@ def from_topology(cls, molecules, topology, box): for node in molecule.nodes: if "position" in molecule.nodes[node]: # check if position is inside grid - is_finite = np.isfinite(molecule.nodes[node]["position"]) + is_finite = np.all(np.isfinite(molecule.nodes[node]["position"])) if not_exceeds_max_dimensions(molecule.nodes[node]["position"], box) and is_finite: positions[idx, :] = molecule.nodes[node]["position"] elif not is_finite: diff --git a/polyply/tests/test_nb_engine.py b/polyply/tests/test_nb_engine.py index 4aa59354..bacd91a7 100644 --- a/polyply/tests/test_nb_engine.py +++ b/polyply/tests/test_nb_engine.py @@ -217,8 +217,17 @@ def test_LJ_force(dist, ref, expected): value = polyply.src.nonbond_engine._lennard_jones_force(dist, point, ref, params) assert np.allclose(value, expected) -def test_init_coord_error(topology): - topology.molecules[2].nodes[0]['position'] = np.array([11., 11., 11.]) + +@pytest.mark.parametrize('position',( + np.array([11., 11., 11.]), + np.array([9., 9., 11.]), + np.array([9., 11, 9.]), + np.array([11., 9., 9.]), + np.array([11., 9., -5.]), + np.array([np.inf, 9., 9.]), + np.array([9., 9., np.nan]),)) +def test_init_coord_error(topology, position): + topology.molecules[2].nodes[0]['position'] = position with pytest.raises(IOError): # initiate the nb_engine nb_engine = NonBondEngine.from_topology(topology.molecules, From 83120964bc0a80f817cc21c5451088147cc6799e Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Mon, 10 Apr 2023 20:06:07 +0200 Subject: [PATCH 254/275] fix spellig error --- polyply/src/linalg_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/linalg_functions.py b/polyply/src/linalg_functions.py index 3b7da24b..8663a59f 100644 --- a/polyply/src/linalg_functions.py +++ b/polyply/src/linalg_functions.py @@ -258,7 +258,7 @@ def pbc_complete(point, maxdim): Wrap point around pbc conditions to keep points from being larger than the compontents of the maxdim vector. Note that all coodinates in - polyply are definiet positive. + polyply are positive semi-definite. Parameters: ----------- From 237faf6340773e27c2c7ede0ca723a5a3480a9fe Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Mon, 10 Apr 2023 20:07:15 +0200 Subject: [PATCH 255/275] fix indent in comment --- polyply/src/map_to_molecule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyply/src/map_to_molecule.py b/polyply/src/map_to_molecule.py index 090170c9..abb489da 100644 --- a/polyply/src/map_to_molecule.py +++ b/polyply/src/map_to_molecule.py @@ -247,7 +247,7 @@ def add_blocks(self, meta_molecule): if node in self.added_fragment_nodes: fragment_id = self.node_to_fragment[node] correspondence = self.multiblock_correspondence[fragment_id] - # in this case we have to add the node from the block definitions + # in this case we have to add the node from the block definitions else: block = self.force_field.blocks[self.node_to_block[node]] # if the block represents more than one residue all residues From 578a47de89e056fcffa39e9ac168e6c60e0bb991 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 13 Apr 2023 13:48:45 +0200 Subject: [PATCH 256/275] added ide ignore to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 6b40660e..5de86f38 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ est.pdb **.pyc **.bak +*.idea + **.lprof polyply.egg-info From 85c7f291897b6d53a67db4f0acfed5fb8b828001 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 13 Apr 2023 13:49:16 +0200 Subject: [PATCH 257/275] added error message to gen_seq --- polyply/src/gen_seq.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/polyply/src/gen_seq.py b/polyply/src/gen_seq.py index 649b21e2..c3d490ea 100644 --- a/polyply/src/gen_seq.py +++ b/polyply/src/gen_seq.py @@ -226,6 +226,10 @@ def generate_seq_graph(sequence, macros, connects): `:class:networkx.graph` """ seq_graph = nx.Graph() + if sequence is None: + msg = ("sequence is empty; you need to provide a sequence to gen_seq") + raise IOError(msg) + for idx, macro_name in enumerate(sequence): sub_graph = macros[macro_name].gen_graph() From 2b5cd5b3c1d7d367106da5fe8cfaf512bd4494cb Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 13 Apr 2023 13:49:28 +0200 Subject: [PATCH 258/275] changed some defaults in main script made -name optional in gen_coords added a default output file name in gen_coords made -seq a required argument in gen_seq --- bin/polyply | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/polyply b/bin/polyply index ad4de054..3776c9e9 100755 --- a/bin/polyply +++ b/bin/polyply @@ -81,7 +81,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements # Input Arguments for the coordinate generation tool # ============================================================================ - parser_gen_coords.add_argument('-name', required=True, type=str, dest="name", + parser_gen_coords.add_argument('-name', required=False, type=str, dest="name", default='molname', help="name of the final molecule") parser_gen_coords.add_argument('-v', dest='verbosity', action='count', @@ -91,7 +91,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements file_group = parser_gen_coords.add_argument_group('Input and output files') file_group.add_argument('-p', dest='toppath', required=False, type=Path, help='topology file (.top)') - file_group.add_argument('-o', dest='outpath', type=Path, + file_group.add_argument('-o', dest='outpath', type=Path, default='coords.gro', help='output GRO (.gro)') file_group.add_argument('-c', dest='coordpath', type=Path, help='input file molecules (.gro)', default=None) @@ -197,7 +197,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements "is .") seq_group = parser_gen_seq.add_argument_group('Definition of sequence') - seq_group.add_argument('-seq', dest='seq', nargs='+', type=str, + seq_group.add_argument('-seq', dest='seq', nargs='+', type=str, required=True, help="Define the sequence order in which to combine macros." "The format is . For example, " "to combine three blocks called A, B, which are defined by the " From a0572dfea4330dbddca3b82d4e1af99025c78672 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 21 Apr 2023 14:11:20 +0200 Subject: [PATCH 259/275] Update CI --- .github/workflows/python-app.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index bf8cf2f9..aa2edcb0 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -32,9 +32,8 @@ jobs: - name: Run pytest with codecoverage run: | - coverage run --source=polyply $(which pytest) -vv polyply - coverage report --omit='*/bin/pytest' - codecov + pytest --cov polyply --hypothesis-show-statistics + codecov/codecov-action@v3 --omit='*/bin/pytest' lint: runs-on: ubuntu-latest From b3aae4716a1271099092d3f3232e2433c8707613 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 21 Apr 2023 14:12:50 +0200 Subject: [PATCH 260/275] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index aa2edcb0..6e643110 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -32,7 +32,7 @@ jobs: - name: Run pytest with codecoverage run: | - pytest --cov polyply --hypothesis-show-statistics + pytest --cov polyply codecov/codecov-action@v3 --omit='*/bin/pytest' lint: From e6084c9f1b1f5c678f5f17741efe4524b84a893d Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Fri, 21 Apr 2023 14:20:47 +0200 Subject: [PATCH 261/275] Update python-app.yml --- .github/workflows/python-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 6e643110..f03079fd 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,6 +31,7 @@ jobs: pip install -r requirements-tests.txt - name: Run pytest with codecoverage + - uses: codecov/codecov-action@v3 run: | pytest --cov polyply codecov/codecov-action@v3 --omit='*/bin/pytest' From 9f944b668506d05668b43a45b9f3b78c2f8d6c6c Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 24 Apr 2023 09:46:09 +0200 Subject: [PATCH 262/275] fix yml syntax error --- .github/workflows/python-app.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index f03079fd..2db9ff99 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,10 +31,9 @@ jobs: pip install -r requirements-tests.txt - name: Run pytest with codecoverage - - uses: codecov/codecov-action@v3 - run: | - pytest --cov polyply - codecov/codecov-action@v3 --omit='*/bin/pytest' + run: pytest --cov polyply + - name: Upload coverage codecov + uses: codecov/codecov-action@v3 --omit='*/bin/pytest' lint: runs-on: ubuntu-latest From 0ba4aa0f4ad8b396e7a874203ec5a88a3364dae6 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 24 Apr 2023 09:48:09 +0200 Subject: [PATCH 263/275] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 2db9ff99..a60d82be 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,7 +33,7 @@ jobs: - name: Run pytest with codecoverage run: pytest --cov polyply - name: Upload coverage codecov - uses: codecov/codecov-action@v3 --omit='*/bin/pytest' + uses: codecov/codecov-action@v3 lint: runs-on: ubuntu-latest From a008032e31530fe161eaeaa15a1b200b7d94e9b9 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:07:53 +0200 Subject: [PATCH 264/275] Update python-app.yml --- .github/workflows/python-app.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a60d82be..255c0d43 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -34,6 +34,8 @@ jobs: run: pytest --cov polyply - name: Upload coverage codecov uses: codecov/codecov-action@v3 + with: + gcov_ignore: '*/bin/pytest' lint: runs-on: ubuntu-latest From fd3bc19b04b4dcdd140c1ae70e8d156e53098834 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:12:28 +0200 Subject: [PATCH 265/275] change CI in deploy file --- .github/workflows/pypi_deploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pypi_deploy.yml b/.github/workflows/pypi_deploy.yml index 952cfb55..4b093f91 100644 --- a/.github/workflows/pypi_deploy.yml +++ b/.github/workflows/pypi_deploy.yml @@ -28,11 +28,12 @@ jobs: pip install -r requirements-tests.txt - name: Run pytest with codecoverage - run: | - coverage run --source=polyply $(which pytest) -vv polyply - coverage report --omit='*/bin/pytest' - codecov - + run: pytest --cov polyply + - name: Upload coverage codecov + uses: codecov/codecov-action@v3 + with: + gcov_ignore: '*/bin/pytest' + verbose: true deploy: needs: test From e8865c0098a3bcc0edeaaf5bc68d0a7e9ea9a167 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:12:56 +0200 Subject: [PATCH 266/275] add verbose to coverage test --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 255c0d43..78efdb29 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,7 +36,8 @@ jobs: uses: codecov/codecov-action@v3 with: gcov_ignore: '*/bin/pytest' - + verbose: true + lint: runs-on: ubuntu-latest From 2e1acf3fe9d1b9869467fb314c0ba14498100742 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 11:43:10 +0200 Subject: [PATCH 267/275] ignore tests with coverage this should take care to ignore test files when dealing with coverage reporting --- .codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index 93454cf0..3d698b5b 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -10,4 +10,6 @@ coverage: patch: default: target: 90 +ignore: + - polyply/src/tests comment: off From 7b3e72667ed1b8189bcfcfe0ca54d5406243098c Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 11:44:27 +0200 Subject: [PATCH 268/275] Update pypi_deploy.yml fix CI in deploy --- .github/workflows/pypi_deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi_deploy.yml b/.github/workflows/pypi_deploy.yml index 4b093f91..fbed02e3 100644 --- a/.github/workflows/pypi_deploy.yml +++ b/.github/workflows/pypi_deploy.yml @@ -32,7 +32,10 @@ jobs: - name: Upload coverage codecov uses: codecov/codecov-action@v3 with: - gcov_ignore: '*/bin/pytest' + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + fail_ci_if_error: true verbose: true deploy: From 69ee3beedf8fdc9950bc239f22a33069378c39e8 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 11:44:58 +0200 Subject: [PATCH 269/275] Update python-app.yml fix CI in tests --- .github/workflows/python-app.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 78efdb29..427a414a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -35,7 +35,9 @@ jobs: - name: Upload coverage codecov uses: codecov/codecov-action@v3 with: - gcov_ignore: '*/bin/pytest' + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + fail_ci_if_error: true verbose: true lint: From cdcd89233d8d2a646099afaf949b9ea8df4aa6ec Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 11:51:22 +0200 Subject: [PATCH 270/275] Update python-app.yml --- .github/workflows/python-app.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 427a414a..c80095cb 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -35,7 +35,6 @@ jobs: - name: Upload coverage codecov uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml fail_ci_if_error: true verbose: true From fdda9cee84b95c470e8098401fbb015e47e43889 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 12:07:55 +0200 Subject: [PATCH 271/275] add token for Coverage --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index c80095cb..5eacdc5c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -35,10 +35,11 @@ jobs: - name: Upload coverage codecov uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml fail_ci_if_error: true verbose: true - + lint: runs-on: ubuntu-latest From 49763dcca8bf01c47579586d14f97adbaa1515eb Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 12:25:18 +0200 Subject: [PATCH 272/275] Update pypi_deploy.yml --- .github/workflows/pypi_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi_deploy.yml b/.github/workflows/pypi_deploy.yml index fbed02e3..6ea81d90 100644 --- a/.github/workflows/pypi_deploy.yml +++ b/.github/workflows/pypi_deploy.yml @@ -28,7 +28,7 @@ jobs: pip install -r requirements-tests.txt - name: Run pytest with codecoverage - run: pytest --cov polyply + run: pytest --cov polyply --cov-report=xml - name: Upload coverage codecov uses: codecov/codecov-action@v3 with: From ee95f706c9fded48dbce8c1af24b586a058c89c0 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 12:25:35 +0200 Subject: [PATCH 273/275] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5eacdc5c..4e06bc07 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,7 +31,7 @@ jobs: pip install -r requirements-tests.txt - name: Run pytest with codecoverage - run: pytest --cov polyply + run: pytest --cov polyply --cov-report=xml - name: Upload coverage codecov uses: codecov/codecov-action@v3 with: From cc28e3da2a470d557e8db53f5d494cef047364a5 Mon Sep 17 00:00:00 2001 From: Fabian Grunewald <32294573+fgrunewald@users.noreply.github.com> Date: Tue, 25 Apr 2023 12:35:09 +0200 Subject: [PATCH 274/275] Update .codecov.yml --- .codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codecov.yml b/.codecov.yml index 3d698b5b..758389a3 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -11,5 +11,5 @@ coverage: default: target: 90 ignore: - - polyply/src/tests + - polyply/tests comment: off From 9d3af57e924bc41bc2dd3184744490e162be3a4a Mon Sep 17 00:00:00 2001 From: ricalessandri Date: Tue, 25 Apr 2023 18:44:42 -0500 Subject: [PATCH 275/275] Switch to default OPLS atomtype names (instead of redundant LigParGen-generated ones) --- polyply/data/oplsaaLigParGen/OHter.ff | 10 +- .../oplsaaLigParGen/PEO.oplsaa.LigParGen.ff | 24 +-- .../oplsaaLigParGen/PEO/polyply/PEO.itp | 160 +++++++++--------- 3 files changed, 92 insertions(+), 102 deletions(-) diff --git a/polyply/data/oplsaaLigParGen/OHter.ff b/polyply/data/oplsaaLigParGen/OHter.ff index 1270a1da..c0fa8b89 100644 --- a/polyply/data/oplsaaLigParGen/OHter.ff +++ b/polyply/data/oplsaaLigParGen/OHter.ff @@ -6,11 +6,11 @@ OHter 3 [ atoms ] ; nr type resnr residue atom cgnr charge mass - 1 opls_803 1 OHter OA1 1 -0.6887 15.9990 - 2 opls_800 1 OHter C2 2 0.1070 12.0110 - 3 opls_802 1 OHter HA3 3 0.4173 1.0080 - 4 opls_802 1 OHter H4 4 0.0822 1.0080 - 5 opls_802 1 OHter H5 5 0.0822 1.0080 + 1 opls_154 1 OHter OA1 1 -0.6887 15.9990 + 2 opls_135 1 OHter C2 2 0.1070 12.0110 + 3 opls_004 1 OHter HA3 3 0.4173 1.0080 + 4 opls_140 1 OHter H4 4 0.0822 1.0080 + 5 opls_140 1 OHter H5 5 0.0822 1.0080 [ bonds ] ; ai aj funct c0 c1 2 1 1 0.1410 267776.000 diff --git a/polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff b/polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff index 7112d538..5ada927e 100644 --- a/polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff +++ b/polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff @@ -1,25 +1,15 @@ -;;;; -;;;; GENERATED BY LigParGen Server -;;;; Jorgensen Lab @ Yale University -;;;; -;;;[ atomtypes ] -;;; opls_800 C800 6 12.0110 0.000 A 3.50000E-01 2.76144E-01 ; C -;;; opls_801 O801 8 15.9990 0.000 A 2.90000E-01 5.85760E-01 ; O -;;; opls_802 H802 1 1.0080 0.000 A 2.50000E-01 1.25520E-01 ; H -;;; opls_803 O803 8 15.9990 0.000 A 3.12000E-01 7.11280E-01 ; O (ALCOHOL, TERMINI) -;;; [ moleculetype ] ; Name nrexcl PEO 3 [ atoms ] ; nr type resnr residue atom cgnr charge mass - 1 opls_800 1 PEO C01 1 0.0089 12.0110 - 2 opls_801 1 PEO O02 2 -0.3846 15.9990 - 3 opls_800 1 PEO C03 3 0.0089 12.0110 - 4 opls_802 1 PEO H04 4 0.0917 1.0080 - 5 opls_802 1 PEO H05 5 0.0917 1.0080 - 6 opls_802 1 PEO H06 6 0.0917 1.0080 - 7 opls_802 1 PEO H07 7 0.0917 1.0080 + 1 opls_135 1 PEO C01 1 0.0089 12.0110 + 2 opls_179 1 PEO O02 2 -0.3846 15.9990 + 3 opls_135 1 PEO C03 3 0.0089 12.0110 + 4 opls_140 1 PEO H04 4 0.0917 1.0080 + 5 opls_140 1 PEO H05 5 0.0917 1.0080 + 6 opls_140 1 PEO H06 6 0.0917 1.0080 + 7 opls_140 1 PEO H07 7 0.0917 1.0080 [ bonds ] 2 1 1 0.1410 267776.000 3 2 1 0.1410 267776.000 diff --git a/polyply/tests/test_data/library_tests/oplsaaLigParGen/PEO/polyply/PEO.itp b/polyply/tests/test_data/library_tests/oplsaaLigParGen/PEO/polyply/PEO.itp index 6b39ff8a..2e99d84d 100644 --- a/polyply/tests/test_data/library_tests/oplsaaLigParGen/PEO/polyply/PEO.itp +++ b/polyply/tests/test_data/library_tests/oplsaaLigParGen/PEO/polyply/PEO.itp @@ -9,86 +9,86 @@ PEO 3 [ atoms ] - 1 opls_803 1 OHter OA1 1 -0.6887 15.999 - 2 opls_800 1 OHter C2 2 0.107 12.011 - 3 opls_802 1 OHter HA3 3 0.4173 1.008 - 4 opls_802 1 OHter H4 4 0.0822 1.008 - 5 opls_802 1 OHter H5 5 0.0822 1.008 - 6 opls_800 2 PEO C01 6 0.0089 12.011 - 7 opls_801 2 PEO O02 7 -0.3846 15.999 - 8 opls_800 2 PEO C03 8 0.0089 12.011 - 9 opls_802 2 PEO H04 9 0.0917 1.008 -10 opls_802 2 PEO H05 10 0.0917 1.008 -11 opls_802 2 PEO H06 11 0.0917 1.008 -12 opls_802 2 PEO H07 12 0.0917 1.008 -13 opls_800 3 PEO C01 13 0.0089 12.011 -14 opls_801 3 PEO O02 14 -0.3846 15.999 -15 opls_800 3 PEO C03 15 0.0089 12.011 -16 opls_802 3 PEO H04 16 0.0917 1.008 -17 opls_802 3 PEO H05 17 0.0917 1.008 -18 opls_802 3 PEO H06 18 0.0917 1.008 -19 opls_802 3 PEO H07 19 0.0917 1.008 -20 opls_800 4 PEO C01 20 0.0089 12.011 -21 opls_801 4 PEO O02 21 -0.3846 15.999 -22 opls_800 4 PEO C03 22 0.0089 12.011 -23 opls_802 4 PEO H04 23 0.0917 1.008 -24 opls_802 4 PEO H05 24 0.0917 1.008 -25 opls_802 4 PEO H06 25 0.0917 1.008 -26 opls_802 4 PEO H07 26 0.0917 1.008 -27 opls_800 5 PEO C01 27 0.0089 12.011 -28 opls_801 5 PEO O02 28 -0.3846 15.999 -29 opls_800 5 PEO C03 29 0.0089 12.011 -30 opls_802 5 PEO H04 30 0.0917 1.008 -31 opls_802 5 PEO H05 31 0.0917 1.008 -32 opls_802 5 PEO H06 32 0.0917 1.008 -33 opls_802 5 PEO H07 33 0.0917 1.008 -34 opls_800 6 PEO C01 34 0.0089 12.011 -35 opls_801 6 PEO O02 35 -0.3846 15.999 -36 opls_800 6 PEO C03 36 0.0089 12.011 -37 opls_802 6 PEO H04 37 0.0917 1.008 -38 opls_802 6 PEO H05 38 0.0917 1.008 -39 opls_802 6 PEO H06 39 0.0917 1.008 -40 opls_802 6 PEO H07 40 0.0917 1.008 -41 opls_800 7 PEO C01 41 0.0089 12.011 -42 opls_801 7 PEO O02 42 -0.3846 15.999 -43 opls_800 7 PEO C03 43 0.0089 12.011 -44 opls_802 7 PEO H04 44 0.0917 1.008 -45 opls_802 7 PEO H05 45 0.0917 1.008 -46 opls_802 7 PEO H06 46 0.0917 1.008 -47 opls_802 7 PEO H07 47 0.0917 1.008 -48 opls_800 8 PEO C01 48 0.0089 12.011 -49 opls_801 8 PEO O02 49 -0.3846 15.999 -50 opls_800 8 PEO C03 50 0.0089 12.011 -51 opls_802 8 PEO H04 51 0.0917 1.008 -52 opls_802 8 PEO H05 52 0.0917 1.008 -53 opls_802 8 PEO H06 53 0.0917 1.008 -54 opls_802 8 PEO H07 54 0.0917 1.008 -55 opls_800 9 PEO C01 55 0.0089 12.011 -56 opls_801 9 PEO O02 56 -0.3846 15.999 -57 opls_800 9 PEO C03 57 0.0089 12.011 -58 opls_802 9 PEO H04 58 0.0917 1.008 -59 opls_802 9 PEO H05 59 0.0917 1.008 -60 opls_802 9 PEO H06 60 0.0917 1.008 -61 opls_802 9 PEO H07 61 0.0917 1.008 -62 opls_800 10 PEO C01 62 0.0089 12.011 -63 opls_801 10 PEO O02 63 -0.3846 15.999 -64 opls_800 10 PEO C03 64 0.0089 12.011 -65 opls_802 10 PEO H04 65 0.0917 1.008 -66 opls_802 10 PEO H05 66 0.0917 1.008 -67 opls_802 10 PEO H06 67 0.0917 1.008 -68 opls_802 10 PEO H07 68 0.0917 1.008 -69 opls_800 11 PEO C01 69 0.0089 12.011 -70 opls_801 11 PEO O02 70 -0.3846 15.999 -71 opls_800 11 PEO C03 71 0.0089 12.011 -72 opls_802 11 PEO H04 72 0.0917 1.008 -73 opls_802 11 PEO H05 73 0.0917 1.008 -74 opls_802 11 PEO H06 74 0.0917 1.008 -75 opls_802 11 PEO H07 75 0.0917 1.008 -76 opls_803 12 OHter OA1 76 -0.6887 15.999 -77 opls_800 12 OHter C2 77 0.107 12.011 -78 opls_802 12 OHter HA3 78 0.4173 1.008 -79 opls_802 12 OHter H4 79 0.0822 1.008 -80 opls_802 12 OHter H5 80 0.0822 1.008 + 1 opls_154 1 OHter OA1 1 -0.6887 15.999 + 2 opls_135 1 OHter C2 2 0.107 12.011 + 3 opls_004 1 OHter HA3 3 0.4173 1.008 + 4 opls_140 1 OHter H4 4 0.0822 1.008 + 5 opls_140 1 OHter H5 5 0.0822 1.008 + 6 opls_135 2 PEO C01 6 0.0089 12.011 + 7 opls_179 2 PEO O02 7 -0.3846 15.999 + 8 opls_135 2 PEO C03 8 0.0089 12.011 + 9 opls_140 2 PEO H04 9 0.0917 1.008 +10 opls_140 2 PEO H05 10 0.0917 1.008 +11 opls_140 2 PEO H06 11 0.0917 1.008 +12 opls_140 2 PEO H07 12 0.0917 1.008 +13 opls_135 3 PEO C01 13 0.0089 12.011 +14 opls_179 3 PEO O02 14 -0.3846 15.999 +15 opls_135 3 PEO C03 15 0.0089 12.011 +16 opls_140 3 PEO H04 16 0.0917 1.008 +17 opls_140 3 PEO H05 17 0.0917 1.008 +18 opls_140 3 PEO H06 18 0.0917 1.008 +19 opls_140 3 PEO H07 19 0.0917 1.008 +20 opls_135 4 PEO C01 20 0.0089 12.011 +21 opls_179 4 PEO O02 21 -0.3846 15.999 +22 opls_135 4 PEO C03 22 0.0089 12.011 +23 opls_140 4 PEO H04 23 0.0917 1.008 +24 opls_140 4 PEO H05 24 0.0917 1.008 +25 opls_140 4 PEO H06 25 0.0917 1.008 +26 opls_140 4 PEO H07 26 0.0917 1.008 +27 opls_135 5 PEO C01 27 0.0089 12.011 +28 opls_179 5 PEO O02 28 -0.3846 15.999 +29 opls_135 5 PEO C03 29 0.0089 12.011 +30 opls_140 5 PEO H04 30 0.0917 1.008 +31 opls_140 5 PEO H05 31 0.0917 1.008 +32 opls_140 5 PEO H06 32 0.0917 1.008 +33 opls_140 5 PEO H07 33 0.0917 1.008 +34 opls_135 6 PEO C01 34 0.0089 12.011 +35 opls_179 6 PEO O02 35 -0.3846 15.999 +36 opls_135 6 PEO C03 36 0.0089 12.011 +37 opls_140 6 PEO H04 37 0.0917 1.008 +38 opls_140 6 PEO H05 38 0.0917 1.008 +39 opls_140 6 PEO H06 39 0.0917 1.008 +40 opls_140 6 PEO H07 40 0.0917 1.008 +41 opls_135 7 PEO C01 41 0.0089 12.011 +42 opls_179 7 PEO O02 42 -0.3846 15.999 +43 opls_135 7 PEO C03 43 0.0089 12.011 +44 opls_140 7 PEO H04 44 0.0917 1.008 +45 opls_140 7 PEO H05 45 0.0917 1.008 +46 opls_140 7 PEO H06 46 0.0917 1.008 +47 opls_140 7 PEO H07 47 0.0917 1.008 +48 opls_135 8 PEO C01 48 0.0089 12.011 +49 opls_179 8 PEO O02 49 -0.3846 15.999 +50 opls_135 8 PEO C03 50 0.0089 12.011 +51 opls_140 8 PEO H04 51 0.0917 1.008 +52 opls_140 8 PEO H05 52 0.0917 1.008 +53 opls_140 8 PEO H06 53 0.0917 1.008 +54 opls_140 8 PEO H07 54 0.0917 1.008 +55 opls_135 9 PEO C01 55 0.0089 12.011 +56 opls_179 9 PEO O02 56 -0.3846 15.999 +57 opls_135 9 PEO C03 57 0.0089 12.011 +58 opls_140 9 PEO H04 58 0.0917 1.008 +59 opls_140 9 PEO H05 59 0.0917 1.008 +60 opls_140 9 PEO H06 60 0.0917 1.008 +61 opls_140 9 PEO H07 61 0.0917 1.008 +62 opls_135 10 PEO C01 62 0.0089 12.011 +63 opls_179 10 PEO O02 63 -0.3846 15.999 +64 opls_135 10 PEO C03 64 0.0089 12.011 +65 opls_140 10 PEO H04 65 0.0917 1.008 +66 opls_140 10 PEO H05 66 0.0917 1.008 +67 opls_140 10 PEO H06 67 0.0917 1.008 +68 opls_140 10 PEO H07 68 0.0917 1.008 +69 opls_135 11 PEO C01 69 0.0089 12.011 +70 opls_179 11 PEO O02 70 -0.3846 15.999 +71 opls_135 11 PEO C03 71 0.0089 12.011 +72 opls_140 11 PEO H04 72 0.0917 1.008 +73 opls_140 11 PEO H05 73 0.0917 1.008 +74 opls_140 11 PEO H06 74 0.0917 1.008 +75 opls_140 11 PEO H07 75 0.0917 1.008 +76 opls_154 12 OHter OA1 76 -0.6887 15.999 +77 opls_135 12 OHter C2 77 0.107 12.011 +78 opls_004 12 OHter HA3 78 0.4173 1.008 +79 opls_140 12 OHter H4 79 0.0822 1.008 +80 opls_140 12 OHter H5 80 0.0822 1.008 [ bonds ] 2 1 1 0.1410 267776.000