From 7ce12547b860ab722cc61d724b30f8c4771cde73 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Tue, 23 Apr 2024 15:14:38 +0200 Subject: [PATCH 01/20] fix missing bias application, add preprint citation --- vermouth/data/force_fields/martini3001/citations.bib | 9 ++++++++- vermouth/processors/water_bias.py | 1 + vermouth/rcsu/go_vs_includes.py | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/vermouth/data/force_fields/martini3001/citations.bib b/vermouth/data/force_fields/martini3001/citations.bib index 3d4f843c2..54a53a083 100644 --- a/vermouth/data/force_fields/martini3001/citations.bib +++ b/vermouth/data/force_fields/martini3001/citations.bib @@ -27,4 +27,11 @@ @article{MDTraj pages={1528 -- 1532}, year={2015}, doi={10.1016/j.bpj.2015.08.015} -} \ No newline at end of file +} +@article{M3_GO, +title={GōMartini 3: From large conformational changes in proteins to environmental bias corrections}, +author={Souza, Paulo C. T. and Araujo, Luis P. Borges and Brasnett, Chris and Moreira, Rodrigo A. and Grunewald, Fabian and Park, Peter and Wang, Liguo and Razmazma, Hafez and Borges-Araujo, Ana C. and Cofas-Vargas, Luis F. and Monticelli, Luca and Mera-Adasme, Raul and Melo, Manuel N. and Wu, Sangwook and Marrink, Siewert J. and Poma, Adolfo B. and Thallmair, Sebastian}, +url={https://www.biorxiv.org/content/10.1101/2024.04.15.589479v1}, +doi={10.1101/2024.04.15.589479}, +year={2024}, +} diff --git a/vermouth/processors/water_bias.py b/vermouth/processors/water_bias.py index 859a1cb41..eb112f155 100644 --- a/vermouth/processors/water_bias.py +++ b/vermouth/processors/water_bias.py @@ -89,6 +89,7 @@ def assign_residue_water_bias(self, molecule, res_graph): if _in_resid_region(_old_resid, self.idr_regions): eps = self.water_bias.get('idr', 0.0) + sec_struc = res_graph.nodes[res_node]['cgsecstruct'] elif self.auto_bias: sec_struc = res_graph.nodes[res_node]['cgsecstruct'] eps = self.water_bias.get(sec_struc, 0.0) diff --git a/vermouth/rcsu/go_vs_includes.py b/vermouth/rcsu/go_vs_includes.py index 3402441fa..a65920ab1 100644 --- a/vermouth/rcsu/go_vs_includes.py +++ b/vermouth/rcsu/go_vs_includes.py @@ -50,6 +50,7 @@ def run_molecule(self, molecule): if not self.system: raise ValueError('This processor requires a system.') + molecule.citations.add('M3_GO') self.add_virtual_sites(molecule, prefix=moltype) From 51c284d0c22f2b5804265570255abcefc52939b8 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Tue, 23 Apr 2024 17:53:15 +0200 Subject: [PATCH 02/20] added integration test --- .../data/integration_tests/tier-1/hst5/README | 8 + .../data/integration_tests/tier-1/hst5/aa.pdb | 423 ++++++++++++++++++ .../tier-1/hst5/martinize2/cg.pdb | 154 +++++++ .../tier-1/hst5/martinize2/citation | 1 + .../tier-1/hst5/martinize2/command | 9 + .../tier-1/hst5/martinize2/molecule_0.itp | 395 ++++++++++++++++ .../tier-1/hst5/martinize2/topol.top | 12 + .../martinize2/virtual_sites_atomtypes.itp | 25 ++ .../virtual_sites_nonbond_params.itp | 25 ++ 9 files changed, 1052 insertions(+) create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/README create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/aa.pdb create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/citation create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/topol.top create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_atomtypes.itp create mode 100644 vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/README b/vermouth/tests/data/integration_tests/tier-1/hst5/README new file mode 100644 index 000000000..930cd9ff6 --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/README @@ -0,0 +1,8 @@ +### DETAILS: + +# Histidin 5 peptide, IDP + +### TEST: + +# -ff martini 3001 +# BB-W bias for idr diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/aa.pdb b/vermouth/tests/data/integration_tests/tier-1/hst5/aa.pdb new file mode 100644 index 000000000..f9e52fee1 --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/aa.pdb @@ -0,0 +1,423 @@ +TITLE Protein in water t= 0.00000 step= 0 +REMARK THIS IS A SIMULATION BOX +CRYST1 82.310 74.040 80.660 90.00 90.00 90.00 P 1 1 +MODEL 1 +ATOM 1 N ASP 1 52.824 25.284 47.143 1.00 0.00 +ATOM 2 H1 ASP 1 53.764 25.594 47.443 1.00 0.00 +ATOM 3 H2 ASP 1 52.604 24.494 47.783 1.00 0.00 +ATOM 4 H3 ASP 1 52.844 24.934 46.173 1.00 0.00 +ATOM 5 CA ASP 1 51.834 26.344 47.493 1.00 0.00 +ATOM 6 HA ASP 1 51.754 26.414 48.573 1.00 0.00 +ATOM 7 CB ASP 1 52.294 27.644 46.733 1.00 0.00 +ATOM 8 HB1 ASP 1 52.574 27.464 45.663 1.00 0.00 +ATOM 9 HB2 ASP 1 51.554 28.454 46.813 1.00 0.00 +ATOM 10 CG ASP 1 53.594 28.134 47.323 1.00 0.00 +ATOM 11 OD1 ASP 1 53.974 27.584 48.403 1.00 0.00 +ATOM 12 OD2 ASP 1 54.224 29.014 46.723 1.00 0.00 +ATOM 13 C ASP 1 50.434 26.044 47.003 1.00 0.00 +ATOM 14 O ASP 1 50.224 25.874 45.773 1.00 0.00 +ATOM 15 N SER 2 49.484 25.994 47.873 1.00 0.00 +ATOM 16 HN SER 2 49.774 25.914 48.833 1.00 0.00 +ATOM 17 CA SER 2 48.104 26.024 47.443 1.00 0.00 +ATOM 18 HA SER 2 48.044 25.984 46.363 1.00 0.00 +ATOM 19 CB SER 2 47.264 24.874 47.963 1.00 0.00 +ATOM 20 HB1 SER 2 46.224 24.904 47.583 1.00 0.00 +ATOM 21 HB2 SER 2 47.184 24.974 49.063 1.00 0.00 +ATOM 22 OG SER 2 47.824 23.564 47.673 1.00 0.00 +ATOM 23 HG1 SER 2 48.364 23.374 48.443 1.00 0.00 +ATOM 24 C SER 2 47.424 27.304 47.983 1.00 0.00 +ATOM 25 O SER 2 46.324 27.624 47.673 1.00 0.00 +ATOM 26 N HIS 3 48.074 28.124 48.823 1.00 0.00 +ATOM 27 HN HIS 3 48.914 27.784 49.223 1.00 0.00 +ATOM 28 CA HIS 3 47.504 29.364 49.303 1.00 0.00 +ATOM 29 HA HIS 3 46.804 29.704 48.553 1.00 0.00 +ATOM 30 CB HIS 3 46.814 29.194 50.673 1.00 0.00 +ATOM 31 HB1 HIS 3 47.684 29.304 51.363 1.00 0.00 +ATOM 32 HB2 HIS 3 46.274 30.124 50.943 1.00 0.00 +ATOM 33 ND1 HIS 3 46.744 26.704 51.273 1.00 0.00 +ATOM 34 CG HIS 3 46.094 27.864 50.893 1.00 0.00 +ATOM 35 CE1 HIS 3 45.794 25.764 51.343 1.00 0.00 +ATOM 36 HE1 HIS 3 45.914 24.714 51.623 1.00 0.00 +ATOM 37 NE2 HIS 3 44.544 26.294 51.073 1.00 0.00 +ATOM 38 HE2 HIS 3 43.704 25.784 50.893 1.00 0.00 +ATOM 39 CD2 HIS 3 44.764 27.644 50.723 1.00 0.00 +ATOM 40 HD2 HIS 3 43.944 28.354 50.633 1.00 0.00 +ATOM 41 C HIS 3 48.704 30.334 49.343 1.00 0.00 +ATOM 42 O HIS 3 49.834 30.014 49.413 1.00 0.00 +ATOM 43 N ALA 4 48.414 31.634 49.333 1.00 0.00 +ATOM 44 HN ALA 4 47.474 31.894 49.123 1.00 0.00 +ATOM 45 CA ALA 4 49.384 32.714 49.563 1.00 0.00 +ATOM 46 HA ALA 4 50.024 32.374 50.363 1.00 0.00 +ATOM 47 CB ALA 4 50.214 32.984 48.343 1.00 0.00 +ATOM 48 HB1 ALA 4 50.854 33.894 48.403 1.00 0.00 +ATOM 49 HB2 ALA 4 50.894 32.124 48.173 1.00 0.00 +ATOM 50 HB3 ALA 4 49.634 33.094 47.403 1.00 0.00 +ATOM 51 C ALA 4 48.464 33.914 49.943 1.00 0.00 +ATOM 52 O ALA 4 47.284 33.964 49.533 1.00 0.00 +ATOM 53 N LYS 5 49.014 34.814 50.763 1.00 0.00 +ATOM 54 HN LYS 5 50.004 34.764 50.913 1.00 0.00 +ATOM 55 CA LYS 5 48.294 35.824 51.563 1.00 0.00 +ATOM 56 HA LYS 5 47.244 35.584 51.593 1.00 0.00 +ATOM 57 CB LYS 5 48.804 35.934 53.023 1.00 0.00 +ATOM 58 HB1 LYS 5 48.064 36.524 53.613 1.00 0.00 +ATOM 59 HB2 LYS 5 48.784 34.924 53.483 1.00 0.00 +ATOM 60 CG LYS 5 50.234 36.384 53.263 1.00 0.00 +ATOM 61 HG1 LYS 5 50.384 37.344 52.723 1.00 0.00 +ATOM 62 HG2 LYS 5 50.884 35.594 52.833 1.00 0.00 +ATOM 63 CD LYS 5 50.344 36.504 54.783 1.00 0.00 +ATOM 64 HD1 LYS 5 49.824 35.654 55.273 1.00 0.00 +ATOM 65 HD2 LYS 5 49.834 37.474 55.003 1.00 0.00 +ATOM 66 CE LYS 5 51.764 36.754 55.253 1.00 0.00 +ATOM 67 HE1 LYS 5 52.204 37.764 55.103 1.00 0.00 +ATOM 68 HE2 LYS 5 52.504 35.984 54.933 1.00 0.00 +ATOM 69 NZ LYS 5 51.794 36.624 56.723 1.00 0.00 +ATOM 70 HZ1 LYS 5 51.604 37.494 57.273 1.00 0.00 +ATOM 71 HZ2 LYS 5 51.244 35.784 56.983 1.00 0.00 +ATOM 72 HZ3 LYS 5 52.804 36.434 56.883 1.00 0.00 +ATOM 73 C LYS 5 48.394 37.174 50.873 1.00 0.00 +ATOM 74 O LYS 5 47.584 38.064 51.043 1.00 0.00 +ATOM 75 N ARG 6 49.434 37.294 50.023 1.00 0.00 +ATOM 76 HN ARG 6 50.204 36.664 50.033 1.00 0.00 +ATOM 77 CA ARG 6 49.524 38.314 49.053 1.00 0.00 +ATOM 78 HA ARG 6 49.324 39.274 49.493 1.00 0.00 +ATOM 79 CB ARG 6 51.014 38.304 48.493 1.00 0.00 +ATOM 80 HB1 ARG 6 51.344 37.304 48.133 1.00 0.00 +ATOM 81 HB2 ARG 6 50.994 39.004 47.623 1.00 0.00 +ATOM 82 CG ARG 6 52.074 38.834 49.453 1.00 0.00 +ATOM 83 HG1 ARG 6 52.524 38.044 50.093 1.00 0.00 +ATOM 84 HG2 ARG 6 51.584 39.574 50.113 1.00 0.00 +ATOM 85 CD ARG 6 53.344 39.414 48.753 1.00 0.00 +ATOM 86 HD1 ARG 6 53.974 39.924 49.513 1.00 0.00 +ATOM 87 HD2 ARG 6 52.964 40.074 47.953 1.00 0.00 +ATOM 88 NE ARG 6 54.114 38.224 48.263 1.00 0.00 +ATOM 89 HE ARG 6 53.634 37.424 47.893 1.00 0.00 +ATOM 90 CZ ARG 6 55.424 38.214 47.963 1.00 0.00 +ATOM 91 NH1 ARG 6 56.184 39.284 48.133 1.00 0.00 +ATOM 92 HH11 ARG 6 57.164 39.154 48.003 1.00 0.00 +ATOM 93 HH12 ARG 6 55.884 40.214 48.373 1.00 0.00 +ATOM 94 NH2 ARG 6 55.904 37.144 47.363 1.00 0.00 +ATOM 95 HH21 ARG 6 56.794 37.144 46.913 1.00 0.00 +ATOM 96 HH22 ARG 6 55.304 36.354 47.353 1.00 0.00 +ATOM 97 C ARG 6 48.434 38.234 47.923 1.00 0.00 +ATOM 98 O ARG 6 47.874 37.164 47.593 1.00 0.00 +ATOM 99 N HIS 7 48.144 39.374 47.283 1.00 0.00 +ATOM 100 HN HIS 7 48.644 40.194 47.533 1.00 0.00 +ATOM 101 CA HIS 7 47.034 39.504 46.353 1.00 0.00 +ATOM 102 HA HIS 7 46.334 38.684 46.383 1.00 0.00 +ATOM 103 CB HIS 7 46.134 40.794 46.623 1.00 0.00 +ATOM 104 HB1 HIS 7 46.804 41.684 46.563 1.00 0.00 +ATOM 105 HB2 HIS 7 45.284 40.924 45.913 1.00 0.00 +ATOM 106 ND1 HIS 7 46.384 41.024 49.153 1.00 0.00 +ATOM 107 CG HIS 7 45.614 40.814 48.033 1.00 0.00 +ATOM 108 CE1 HIS 7 45.514 41.144 50.183 1.00 0.00 +ATOM 109 HE1 HIS 7 45.714 41.204 51.253 1.00 0.00 +ATOM 110 NE2 HIS 7 44.274 41.114 49.733 1.00 0.00 +ATOM 111 HE2 HIS 7 43.444 41.284 50.253 1.00 0.00 +ATOM 112 CD2 HIS 7 44.334 40.804 48.433 1.00 0.00 +ATOM 113 HD2 HIS 7 43.444 40.834 47.823 1.00 0.00 +ATOM 114 C HIS 7 47.484 39.634 44.943 1.00 0.00 +ATOM 115 O HIS 7 46.734 40.104 44.103 1.00 0.00 +ATOM 116 N HIS 8 48.654 39.124 44.653 1.00 0.00 +ATOM 117 HN HIS 8 49.184 38.754 45.413 1.00 0.00 +ATOM 118 CA HIS 8 49.164 39.064 43.333 1.00 0.00 +ATOM 119 HA HIS 8 48.964 39.974 42.773 1.00 0.00 +ATOM 120 CB HIS 8 50.684 38.864 43.243 1.00 0.00 +ATOM 121 HB1 HIS 8 51.104 37.984 43.763 1.00 0.00 +ATOM 122 HB2 HIS 8 51.014 39.004 42.183 1.00 0.00 +ATOM 123 ND1 HIS 8 51.214 41.254 43.563 1.00 0.00 +ATOM 124 CG HIS 8 51.394 39.994 43.973 1.00 0.00 +ATOM 125 CE1 HIS 8 52.124 41.924 44.243 1.00 0.00 +ATOM 126 HE1 HIS 8 52.234 43.004 44.273 1.00 0.00 +ATOM 127 NE2 HIS 8 52.844 41.144 45.113 1.00 0.00 +ATOM 128 HE2 HIS 8 53.714 41.444 45.503 1.00 0.00 +ATOM 129 CD2 HIS 8 52.334 39.904 44.963 1.00 0.00 +ATOM 130 HD2 HIS 8 52.814 39.034 45.383 1.00 0.00 +ATOM 131 C HIS 8 48.674 37.844 42.543 1.00 0.00 +ATOM 132 O HIS 8 48.834 36.704 42.903 1.00 0.00 +ATOM 133 N GLY 9 47.984 38.264 41.403 1.00 0.00 +ATOM 134 HN GLY 9 47.944 39.244 41.273 1.00 0.00 +ATOM 135 CA GLY 9 47.464 37.404 40.373 1.00 0.00 +ATOM 136 HA1 GLY 9 47.664 36.364 40.623 1.00 0.00 +ATOM 137 HA2 GLY 9 47.894 37.674 39.423 1.00 0.00 +ATOM 138 C GLY 9 46.004 37.674 40.153 1.00 0.00 +ATOM 139 O GLY 9 45.334 37.224 39.203 1.00 0.00 +ATOM 140 N TYR 10 45.394 38.444 41.053 1.00 0.00 +ATOM 141 HN TYR 10 45.974 39.024 41.613 1.00 0.00 +ATOM 142 CA TYR 10 43.974 38.744 41.173 1.00 0.00 +ATOM 143 HA TYR 10 43.424 38.074 40.533 1.00 0.00 +ATOM 144 CB TYR 10 43.214 38.344 42.453 1.00 0.00 +ATOM 145 HB1 TYR 10 43.404 39.144 43.203 1.00 0.00 +ATOM 146 HB2 TYR 10 42.154 38.064 42.313 1.00 0.00 +ATOM 147 CG TYR 10 43.834 37.124 43.033 1.00 0.00 +ATOM 148 CD1 TYR 10 44.784 37.074 44.073 1.00 0.00 +ATOM 149 HD1 TYR 10 45.074 38.044 44.433 1.00 0.00 +ATOM 150 CE1 TYR 10 45.154 35.834 44.633 1.00 0.00 +ATOM 151 HE1 TYR 10 45.784 35.874 45.503 1.00 0.00 +ATOM 152 CZ TYR 10 44.874 34.624 44.023 1.00 0.00 +ATOM 153 OH TYR 10 45.454 33.454 44.443 1.00 0.00 +ATOM 154 HH TYR 10 45.094 32.784 43.863 1.00 0.00 +ATOM 155 CD2 TYR 10 43.504 35.874 42.473 1.00 0.00 +ATOM 156 HD2 TYR 10 42.924 35.964 41.573 1.00 0.00 +ATOM 157 CE2 TYR 10 43.974 34.674 42.963 1.00 0.00 +ATOM 158 HE2 TYR 10 43.634 33.834 42.373 1.00 0.00 +ATOM 159 C TYR 10 43.614 40.134 40.863 1.00 0.00 +ATOM 160 O TYR 10 44.264 41.024 41.323 1.00 0.00 +ATOM 161 N LYS 11 42.484 40.324 40.093 1.00 0.00 +ATOM 162 HN LYS 11 41.954 39.514 39.813 1.00 0.00 +ATOM 163 CA LYS 11 42.054 41.604 39.653 1.00 0.00 +ATOM 164 HA LYS 11 41.174 41.284 39.113 1.00 0.00 +ATOM 165 CB LYS 11 41.714 42.604 40.773 1.00 0.00 +ATOM 166 HB1 LYS 11 42.674 42.764 41.313 1.00 0.00 +ATOM 167 HB2 LYS 11 41.334 43.534 40.293 1.00 0.00 +ATOM 168 CG LYS 11 40.634 42.134 41.773 1.00 0.00 +ATOM 169 HG1 LYS 11 41.034 41.404 42.493 1.00 0.00 +ATOM 170 HG2 LYS 11 39.904 41.564 41.163 1.00 0.00 +ATOM 171 CD LYS 11 40.064 43.284 42.533 1.00 0.00 +ATOM 172 HD1 LYS 11 39.844 44.174 41.893 1.00 0.00 +ATOM 173 HD2 LYS 11 40.814 43.674 43.253 1.00 0.00 +ATOM 174 CE LYS 11 38.684 42.924 43.153 1.00 0.00 +ATOM 175 HE1 LYS 11 38.644 41.944 43.683 1.00 0.00 +ATOM 176 HE2 LYS 11 38.074 42.894 42.223 1.00 0.00 +ATOM 177 NZ LYS 11 38.194 43.934 44.113 1.00 0.00 +ATOM 178 HZ1 LYS 11 38.774 43.794 44.953 1.00 0.00 +ATOM 179 HZ2 LYS 11 38.504 44.904 43.913 1.00 0.00 +ATOM 180 HZ3 LYS 11 37.204 43.824 44.433 1.00 0.00 +ATOM 181 C LYS 11 42.864 42.214 38.513 1.00 0.00 +ATOM 182 O LYS 11 42.944 43.444 38.373 1.00 0.00 +ATOM 183 N ARG 12 43.584 41.364 37.663 1.00 0.00 +ATOM 184 HN ARG 12 43.574 40.364 37.643 1.00 0.00 +ATOM 185 CA ARG 12 44.404 41.924 36.643 1.00 0.00 +ATOM 186 HA ARG 12 44.844 42.894 36.803 1.00 0.00 +ATOM 187 CB ARG 12 45.604 40.964 36.513 1.00 0.00 +ATOM 188 HB1 ARG 12 45.284 39.914 36.313 1.00 0.00 +ATOM 189 HB2 ARG 12 46.184 41.244 35.603 1.00 0.00 +ATOM 190 CG ARG 12 46.574 40.834 37.733 1.00 0.00 +ATOM 191 HG1 ARG 12 47.344 40.134 37.343 1.00 0.00 +ATOM 192 HG2 ARG 12 46.134 40.284 38.593 1.00 0.00 +ATOM 193 CD ARG 12 47.214 42.094 38.253 1.00 0.00 +ATOM 194 HD1 ARG 12 48.024 41.924 38.993 1.00 0.00 +ATOM 195 HD2 ARG 12 46.464 42.664 38.853 1.00 0.00 +ATOM 196 NE ARG 12 47.744 43.004 37.153 1.00 0.00 +ATOM 197 HE ARG 12 47.104 43.634 36.703 1.00 0.00 +ATOM 198 CZ ARG 12 48.904 42.924 36.523 1.00 0.00 +ATOM 199 NH1 ARG 12 49.834 42.064 36.833 1.00 0.00 +ATOM 200 HH11 ARG 12 50.564 41.994 36.153 1.00 0.00 +ATOM 201 HH12 ARG 12 49.664 41.264 37.413 1.00 0.00 +ATOM 202 NH2 ARG 12 49.054 43.764 35.523 1.00 0.00 +ATOM 203 HH21 ARG 12 49.884 43.924 34.983 1.00 0.00 +ATOM 204 HH22 ARG 12 48.274 44.364 35.343 1.00 0.00 +ATOM 205 C ARG 12 43.714 42.234 35.343 1.00 0.00 +ATOM 206 O ARG 12 44.214 42.984 34.483 1.00 0.00 +ATOM 207 N LYS 13 42.544 41.664 35.063 1.00 0.00 +ATOM 208 HN LYS 13 42.174 41.024 35.733 1.00 0.00 +ATOM 209 CA LYS 13 41.574 42.014 33.983 1.00 0.00 +ATOM 210 HA LYS 13 42.104 41.954 33.053 1.00 0.00 +ATOM 211 CB LYS 13 40.454 40.974 33.823 1.00 0.00 +ATOM 212 HB1 LYS 13 39.794 40.964 34.713 1.00 0.00 +ATOM 213 HB2 LYS 13 39.774 41.204 32.983 1.00 0.00 +ATOM 214 CG LYS 13 40.914 39.504 33.583 1.00 0.00 +ATOM 215 HG1 LYS 13 41.364 39.044 34.483 1.00 0.00 +ATOM 216 HG2 LYS 13 41.694 39.414 32.783 1.00 0.00 +ATOM 217 CD LYS 13 39.724 38.554 33.183 1.00 0.00 +ATOM 218 HD1 LYS 13 39.584 38.774 32.103 1.00 0.00 +ATOM 219 HD2 LYS 13 38.884 38.904 33.813 1.00 0.00 +ATOM 220 CE LYS 13 40.004 37.044 33.283 1.00 0.00 +ATOM 221 HE1 LYS 13 40.104 36.824 34.373 1.00 0.00 +ATOM 222 HE2 LYS 13 40.914 36.644 32.793 1.00 0.00 +ATOM 223 NZ LYS 13 38.774 36.274 32.883 1.00 0.00 +ATOM 224 HZ1 LYS 13 38.744 36.344 31.843 1.00 0.00 +ATOM 225 HZ2 LYS 13 38.744 35.264 33.123 1.00 0.00 +ATOM 226 HZ3 LYS 13 37.944 36.794 33.233 1.00 0.00 +ATOM 227 C LYS 13 41.044 43.394 33.873 1.00 0.00 +ATOM 228 O LYS 13 40.934 44.054 34.923 1.00 0.00 +ATOM 229 N PHE 14 40.684 43.794 32.633 1.00 0.00 +ATOM 230 HN PHE 14 40.594 43.114 31.913 1.00 0.00 +ATOM 231 CA PHE 14 40.424 45.174 32.173 1.00 0.00 +ATOM 232 HA PHE 14 40.634 45.914 32.933 1.00 0.00 +ATOM 233 CB PHE 14 41.194 45.354 30.813 1.00 0.00 +ATOM 234 HB1 PHE 14 40.984 44.534 30.093 1.00 0.00 +ATOM 235 HB2 PHE 14 40.944 46.364 30.443 1.00 0.00 +ATOM 236 CG PHE 14 42.744 45.354 31.093 1.00 0.00 +ATOM 237 CD1 PHE 14 43.464 46.504 31.533 1.00 0.00 +ATOM 238 HD1 PHE 14 42.894 47.414 31.653 1.00 0.00 +ATOM 239 CE1 PHE 14 44.854 46.474 31.583 1.00 0.00 +ATOM 240 HE1 PHE 14 45.354 47.364 31.953 1.00 0.00 +ATOM 241 CZ PHE 14 45.584 45.274 31.443 1.00 0.00 +ATOM 242 HZ PHE 14 46.654 45.314 31.543 1.00 0.00 +ATOM 243 CD2 PHE 14 43.454 44.154 30.893 1.00 0.00 +ATOM 244 HD2 PHE 14 42.994 43.304 30.403 1.00 0.00 +ATOM 245 CE2 PHE 14 44.874 44.164 31.033 1.00 0.00 +ATOM 246 HE2 PHE 14 45.434 43.254 30.913 1.00 0.00 +ATOM 247 C PHE 14 38.954 45.364 31.933 1.00 0.00 +ATOM 248 O PHE 14 38.504 46.394 31.423 1.00 0.00 +ATOM 249 N HIS 15 38.144 44.364 32.233 1.00 0.00 +ATOM 250 HN HIS 15 38.474 43.594 32.783 1.00 0.00 +ATOM 251 CA HIS 15 36.734 44.354 31.863 1.00 0.00 +ATOM 252 HA HIS 15 36.434 45.394 31.843 1.00 0.00 +ATOM 253 CB HIS 15 36.444 43.594 30.513 1.00 0.00 +ATOM 254 HB1 HIS 15 36.324 42.504 30.723 1.00 0.00 +ATOM 255 HB2 HIS 15 35.434 44.034 30.373 1.00 0.00 +ATOM 256 ND1 HIS 15 38.354 42.694 29.243 1.00 0.00 +ATOM 257 CG HIS 15 37.434 43.714 29.423 1.00 0.00 +ATOM 258 CE1 HIS 15 38.914 42.974 28.043 1.00 0.00 +ATOM 259 HE1 HIS 15 39.854 42.554 27.703 1.00 0.00 +ATOM 260 NE2 HIS 15 38.404 44.034 27.463 1.00 0.00 +ATOM 261 HE2 HIS 15 38.624 44.514 26.613 1.00 0.00 +ATOM 262 CD2 HIS 15 37.444 44.504 28.333 1.00 0.00 +ATOM 263 HD2 HIS 15 36.874 45.404 28.123 1.00 0.00 +ATOM 264 C HIS 15 36.064 43.624 33.033 1.00 0.00 +ATOM 265 O HIS 15 36.694 42.944 33.823 1.00 0.00 +ATOM 266 N GLU 16 34.714 43.844 33.193 1.00 0.00 +ATOM 267 HN GLU 16 34.164 44.364 32.543 1.00 0.00 +ATOM 268 CA GLU 16 33.904 43.354 34.223 1.00 0.00 +ATOM 269 HA GLU 16 34.364 43.554 35.173 1.00 0.00 +ATOM 270 CB GLU 16 32.494 44.024 34.203 1.00 0.00 +ATOM 271 HB1 GLU 16 31.844 43.914 33.303 1.00 0.00 +ATOM 272 HB2 GLU 16 31.854 43.384 34.853 1.00 0.00 +ATOM 273 CG GLU 16 32.604 45.484 34.783 1.00 0.00 +ATOM 274 HG1 GLU 16 33.154 46.114 34.043 1.00 0.00 +ATOM 275 HG2 GLU 16 33.104 45.394 35.763 1.00 0.00 +ATOM 276 CD GLU 16 31.144 45.884 34.983 1.00 0.00 +ATOM 277 OE1 GLU 16 30.534 45.474 35.943 1.00 0.00 +ATOM 278 OE2 GLU 16 30.604 46.594 34.143 1.00 0.00 +ATOM 279 C GLU 16 33.684 41.844 34.213 1.00 0.00 +ATOM 280 O GLU 16 33.424 41.234 33.193 1.00 0.00 +ATOM 281 N LYS 17 33.814 41.264 35.433 1.00 0.00 +ATOM 282 HN LYS 17 34.054 41.784 36.243 1.00 0.00 +ATOM 283 CA LYS 17 33.604 39.894 35.683 1.00 0.00 +ATOM 284 HA LYS 17 34.364 39.404 35.083 1.00 0.00 +ATOM 285 CB LYS 17 33.974 39.594 37.193 1.00 0.00 +ATOM 286 HB1 LYS 17 33.444 40.324 37.833 1.00 0.00 +ATOM 287 HB2 LYS 17 33.654 38.544 37.353 1.00 0.00 +ATOM 288 CG LYS 17 35.414 39.584 37.703 1.00 0.00 +ATOM 289 HG1 LYS 17 35.824 40.604 37.873 1.00 0.00 +ATOM 290 HG2 LYS 17 36.074 39.074 36.973 1.00 0.00 +ATOM 291 CD LYS 17 35.584 38.934 39.133 1.00 0.00 +ATOM 292 HD1 LYS 17 34.854 39.464 39.773 1.00 0.00 +ATOM 293 HD2 LYS 17 36.614 39.164 39.493 1.00 0.00 +ATOM 294 CE LYS 17 35.394 37.444 39.163 1.00 0.00 +ATOM 295 HE1 LYS 17 36.054 36.874 38.483 1.00 0.00 +ATOM 296 HE2 LYS 17 34.364 37.214 38.843 1.00 0.00 +ATOM 297 NZ LYS 17 35.624 37.044 40.563 1.00 0.00 +ATOM 298 HZ1 LYS 17 34.884 37.474 41.163 1.00 0.00 +ATOM 299 HZ2 LYS 17 35.674 36.014 40.703 1.00 0.00 +ATOM 300 HZ3 LYS 17 36.504 37.474 40.913 1.00 0.00 +ATOM 301 C LYS 17 32.264 39.284 35.293 1.00 0.00 +ATOM 302 O LYS 17 31.194 39.594 35.823 1.00 0.00 +ATOM 303 N HIS 18 32.344 38.394 34.303 1.00 0.00 +ATOM 304 HN HIS 18 33.254 38.184 33.953 1.00 0.00 +ATOM 305 CA HIS 18 31.234 37.494 34.063 1.00 0.00 +ATOM 306 HA HIS 18 30.374 38.134 34.113 1.00 0.00 +ATOM 307 CB HIS 18 31.264 36.704 32.693 1.00 0.00 +ATOM 308 HB1 HIS 18 32.054 35.924 32.703 1.00 0.00 +ATOM 309 HB2 HIS 18 30.244 36.264 32.603 1.00 0.00 +ATOM 310 ND1 HIS 18 31.334 37.014 30.243 1.00 0.00 +ATOM 311 CG HIS 18 31.514 37.534 31.493 1.00 0.00 +ATOM 312 CE1 HIS 18 31.394 38.104 29.433 1.00 0.00 +ATOM 313 HE1 HIS 18 31.384 38.034 28.343 1.00 0.00 +ATOM 314 NE2 HIS 18 31.574 39.234 30.133 1.00 0.00 +ATOM 315 HE2 HIS 18 31.584 40.174 29.793 1.00 0.00 +ATOM 316 CD2 HIS 18 31.544 38.904 31.443 1.00 0.00 +ATOM 317 HD2 HIS 18 31.654 39.594 32.273 1.00 0.00 +ATOM 318 C HIS 18 31.014 36.544 35.273 1.00 0.00 +ATOM 319 O HIS 18 32.024 36.014 35.753 1.00 0.00 +ATOM 320 N HIS 19 29.794 36.364 35.733 1.00 0.00 +ATOM 321 HN HIS 19 28.994 36.894 35.453 1.00 0.00 +ATOM 322 CA HIS 19 29.544 35.374 36.823 1.00 0.00 +ATOM 323 HA HIS 19 30.464 35.074 37.313 1.00 0.00 +ATOM 324 CB HIS 19 28.624 36.054 37.973 1.00 0.00 +ATOM 325 HB1 HIS 19 27.984 35.404 38.603 1.00 0.00 +ATOM 326 HB2 HIS 19 29.274 36.694 38.613 1.00 0.00 +ATOM 327 ND1 HIS 19 26.504 36.644 36.843 1.00 0.00 +ATOM 328 CG HIS 19 27.724 37.094 37.373 1.00 0.00 +ATOM 329 CE1 HIS 19 25.894 37.724 36.553 1.00 0.00 +ATOM 330 HE1 HIS 19 24.854 37.684 36.253 1.00 0.00 +ATOM 331 NE2 HIS 19 26.614 38.834 36.863 1.00 0.00 +ATOM 332 HE2 HIS 19 26.314 39.754 36.633 1.00 0.00 +ATOM 333 CD2 HIS 19 27.824 38.424 37.453 1.00 0.00 +ATOM 334 HD2 HIS 19 28.504 39.094 37.963 1.00 0.00 +ATOM 335 C HIS 19 29.054 34.064 36.303 1.00 0.00 +ATOM 336 O HIS 19 28.924 33.144 37.143 1.00 0.00 +ATOM 337 N SER 20 28.844 33.874 34.973 1.00 0.00 +ATOM 338 HN SER 20 29.014 34.664 34.373 1.00 0.00 +ATOM 339 CA SER 20 28.644 32.614 34.273 1.00 0.00 +ATOM 340 HA SER 20 27.654 32.304 34.583 1.00 0.00 +ATOM 341 CB SER 20 28.804 32.914 32.743 1.00 0.00 +ATOM 342 HB1 SER 20 28.134 33.754 32.453 1.00 0.00 +ATOM 343 HB2 SER 20 28.584 32.044 32.083 1.00 0.00 +ATOM 344 OG SER 20 30.104 33.254 32.453 1.00 0.00 +ATOM 345 HG1 SER 20 30.134 33.114 31.503 1.00 0.00 +ATOM 346 C SER 20 29.584 31.424 34.613 1.00 0.00 +ATOM 347 O SER 20 29.174 30.334 34.893 1.00 0.00 +ATOM 348 N HIS 21 30.894 31.674 34.613 1.00 0.00 +ATOM 349 HN HIS 21 31.134 32.574 34.253 1.00 0.00 +ATOM 350 CA HIS 21 31.834 30.714 35.083 1.00 0.00 +ATOM 351 HA HIS 21 31.434 29.714 35.133 1.00 0.00 +ATOM 352 CB HIS 21 33.174 30.724 34.303 1.00 0.00 +ATOM 353 HB1 HIS 21 33.534 31.774 34.213 1.00 0.00 +ATOM 354 HB2 HIS 21 34.004 30.124 34.733 1.00 0.00 +ATOM 355 ND1 HIS 21 32.654 29.124 32.533 1.00 0.00 +ATOM 356 CG HIS 21 33.004 30.404 32.863 1.00 0.00 +ATOM 357 CE1 HIS 21 32.454 29.204 31.213 1.00 0.00 +ATOM 358 HE1 HIS 21 32.014 28.354 30.693 1.00 0.00 +ATOM 359 NE2 HIS 21 32.674 30.454 30.753 1.00 0.00 +ATOM 360 HE2 HIS 21 32.714 30.684 29.783 1.00 0.00 +ATOM 361 CD2 HIS 21 33.144 31.164 31.783 1.00 0.00 +ATOM 362 HD2 HIS 21 33.154 32.244 31.663 1.00 0.00 +ATOM 363 C HIS 21 32.134 31.064 36.503 1.00 0.00 +ATOM 364 O HIS 21 32.474 32.204 36.923 1.00 0.00 +ATOM 365 N ARG 22 31.994 30.164 37.363 1.00 0.00 +ATOM 366 HN ARG 22 31.784 29.214 37.143 1.00 0.00 +ATOM 367 CA ARG 22 32.384 30.134 38.813 1.00 0.00 +ATOM 368 HA ARG 22 32.154 31.044 39.353 1.00 0.00 +ATOM 369 CB ARG 22 31.664 29.034 39.703 1.00 0.00 +ATOM 370 HB1 ARG 22 31.974 28.004 39.433 1.00 0.00 +ATOM 371 HB2 ARG 22 32.114 29.064 40.723 1.00 0.00 +ATOM 372 CG ARG 22 30.174 29.314 39.893 1.00 0.00 +ATOM 373 HG1 ARG 22 30.064 30.184 40.573 1.00 0.00 +ATOM 374 HG2 ARG 22 29.714 28.364 40.243 1.00 0.00 +ATOM 375 CD ARG 22 29.324 29.584 38.533 1.00 0.00 +ATOM 376 HD1 ARG 22 29.584 28.834 37.753 1.00 0.00 +ATOM 377 HD2 ARG 22 29.674 30.544 38.103 1.00 0.00 +ATOM 378 NE ARG 22 27.854 29.714 38.853 1.00 0.00 +ATOM 379 HE ARG 22 27.624 29.664 39.823 1.00 0.00 +ATOM 380 CZ ARG 22 26.884 30.094 37.973 1.00 0.00 +ATOM 381 NH1 ARG 22 26.954 30.374 36.703 1.00 0.00 +ATOM 382 HH11 ARG 22 26.124 30.664 36.223 1.00 0.00 +ATOM 383 HH12 ARG 22 27.854 30.384 36.273 1.00 0.00 +ATOM 384 NH2 ARG 22 25.664 30.234 38.563 1.00 0.00 +ATOM 385 HH21 ARG 22 24.874 30.484 38.003 1.00 0.00 +ATOM 386 HH22 ARG 22 25.554 30.054 39.543 1.00 0.00 +ATOM 387 C ARG 22 33.914 29.854 38.963 1.00 0.00 +ATOM 388 O ARG 22 34.534 29.014 38.253 1.00 0.00 +ATOM 389 N GLY 23 34.514 30.634 39.893 1.00 0.00 +ATOM 390 HN GLY 23 33.904 31.364 40.203 1.00 0.00 +ATOM 391 CA GLY 23 35.934 30.874 40.133 1.00 0.00 +ATOM 392 HA1 GLY 23 36.504 29.994 39.873 1.00 0.00 +ATOM 393 HA2 GLY 23 36.024 31.194 41.163 1.00 0.00 +ATOM 394 C GLY 23 36.444 31.954 39.163 1.00 0.00 +ATOM 395 O GLY 23 35.994 32.024 38.003 1.00 0.00 +ATOM 396 N TYR 24 37.504 32.704 39.493 1.00 0.00 +ATOM 397 HN TYR 24 37.924 32.624 40.393 1.00 0.00 +ATOM 398 CA TYR 24 38.134 33.624 38.573 1.00 0.00 +ATOM 399 HA TYR 24 37.384 33.964 37.883 1.00 0.00 +ATOM 400 CB TYR 24 38.714 34.784 39.433 1.00 0.00 +ATOM 401 HB1 TYR 24 37.944 35.034 40.193 1.00 0.00 +ATOM 402 HB2 TYR 24 39.574 34.324 39.973 1.00 0.00 +ATOM 403 CG TYR 24 39.084 36.074 38.813 1.00 0.00 +ATOM 404 CD1 TYR 24 38.504 36.504 37.593 1.00 0.00 +ATOM 405 HD1 TYR 24 37.984 35.814 36.933 1.00 0.00 +ATOM 406 CE1 TYR 24 38.774 37.764 37.073 1.00 0.00 +ATOM 407 HE1 TYR 24 38.374 38.094 36.123 1.00 0.00 +ATOM 408 CZ TYR 24 39.404 38.724 37.833 1.00 0.00 +ATOM 409 OH TYR 24 39.634 39.994 37.333 1.00 0.00 +ATOM 410 HH TYR 24 38.934 40.244 36.723 1.00 0.00 +ATOM 411 CD2 TYR 24 39.674 37.064 39.613 1.00 0.00 +ATOM 412 HD2 TYR 24 39.984 36.834 40.623 1.00 0.00 +ATOM 413 CE2 TYR 24 39.754 38.414 39.163 1.00 0.00 +ATOM 414 HE2 TYR 24 40.034 39.174 39.883 1.00 0.00 +ATOM 415 C TYR 24 39.214 32.884 37.743 1.00 0.00 +ATOM 416 OT1 TYR 24 39.124 32.784 36.513 1.00 0.00 +ATOM 417 OT2 TYR 24 40.164 32.344 38.403 1.00 0.00 +TER +ENDMDL diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb new file mode 100644 index 000000000..7c5c95f6a --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb @@ -0,0 +1,154 @@ +ATOM 1 BB ASP 1 53.101 31.658 49.332 1.00 0.00 +ATOM 2 SC1 ASP 1 55.309 33.963 49.864 1.00 0.00 +ATOM 3 CA ASP 1 53.101 31.658 49.332 1.00 0.00 +ATOM 4 BB SER 2 49.524 32.599 50.292 1.00 0.00 +ATOM 5 SC1 SER 2 49.316 29.940 50.350 1.00 0.00 +ATOM 6 CA SER 2 49.524 32.599 50.292 1.00 0.00 +ATOM 7 BB HIS 3 50.319 35.260 51.750 1.00 0.00 +ATOM 8 SC1 HIS 3 48.159 34.369 53.313 1.00 0.00 +ATOM 9 SC2 HIS 3 46.292 32.768 53.431 1.00 0.00 +ATOM 10 SC3 HIS 3 47.996 32.053 53.847 1.00 0.00 +ATOM 11 CA HIS 3 50.319 35.260 51.750 1.00 0.00 +ATOM 12 BB ALA 4 49.996 38.890 52.101 1.00 0.00 +ATOM 13 SC1 ALA 4 51.919 38.824 50.873 1.00 0.00 +ATOM 14 CA ALA 4 49.996 38.890 52.101 1.00 0.00 +ATOM 15 BB LYS 5 50.029 42.334 53.576 1.00 0.00 +ATOM 16 SC1 LYS 5 51.499 42.114 56.220 1.00 0.00 +ATOM 17 SC2 LYS 5 53.532 42.525 58.605 1.00 0.00 +ATOM 18 CA LYS 5 50.029 42.334 53.576 1.00 0.00 +ATOM 19 BB ARG 6 50.501 43.512 51.176 1.00 0.00 +ATOM 20 SC1 ARG 6 53.849 44.691 51.430 1.00 0.00 +ATOM 21 SC2 ARG 6 57.141 44.043 50.440 1.00 0.00 +ATOM 22 CA ARG 6 50.501 43.512 51.176 1.00 0.00 +ATOM 23 BB HIS 7 49.062 45.526 48.179 1.00 0.00 +ATOM 24 SC1 HIS 7 47.579 46.644 49.858 1.00 0.00 +ATOM 25 SC2 HIS 7 45.945 46.817 51.656 1.00 0.00 +ATOM 26 SC3 HIS 7 47.678 46.924 52.219 1.00 0.00 +ATOM 27 CA HIS 7 49.062 45.526 48.179 1.00 0.00 +ATOM 28 BB HIS 8 50.537 43.961 45.939 1.00 0.00 +ATOM 29 SC1 HIS 8 52.744 45.269 46.138 1.00 0.00 +ATOM 30 SC2 HIS 8 54.360 46.388 47.602 1.00 0.00 +ATOM 31 SC3 HIS 8 53.361 47.457 46.422 1.00 0.00 +ATOM 32 CA HIS 8 50.537 43.961 45.939 1.00 0.00 +ATOM 33 BB GLY 9 48.372 43.503 42.793 1.00 0.00 +ATOM 34 CA GLY 9 48.372 43.503 42.793 1.00 0.00 +ATOM 35 BB TYR 10 46.083 45.479 43.656 1.00 0.00 +ATOM 36 SC1 TYR 10 45.229 43.574 45.273 1.00 0.00 +ATOM 37 SC2 TYR 10 46.709 42.333 46.930 1.00 0.00 +ATOM 38 SC3 TYR 10 45.409 41.085 45.191 1.00 0.00 +ATOM 39 SC4 TYR 10 46.907 39.755 46.779 1.00 0.00 +ATOM 40 CA TYR 10 46.083 45.479 43.656 1.00 0.00 +ATOM 41 BB LYS 11 44.302 47.749 41.677 1.00 0.00 +ATOM 42 SC1 LYS 11 42.509 48.514 44.223 1.00 0.00 +ATOM 43 SC2 LYS 11 40.096 49.309 46.228 1.00 0.00 +ATOM 44 CA LYS 11 44.302 47.749 41.677 1.00 0.00 +ATOM 45 BB ARG 12 45.679 47.969 38.539 1.00 0.00 +ATOM 46 SC1 ARG 12 48.169 47.137 40.030 1.00 0.00 +ATOM 47 SC2 ARG 12 50.606 48.788 39.005 1.00 0.00 +ATOM 48 CA ARG 12 45.679 47.969 38.539 1.00 0.00 +ATOM 49 BB LYS 13 43.235 48.641 37.069 1.00 0.00 +ATOM 50 SC1 LYS 13 42.069 45.517 36.060 1.00 0.00 +ATOM 51 SC2 LYS 13 41.038 42.428 35.598 1.00 0.00 +ATOM 52 CA LYS 13 43.235 48.641 37.069 1.00 0.00 +ATOM 53 BB PHE 14 41.319 51.022 34.545 1.00 0.00 +ATOM 54 SC1 PHE 14 43.979 51.194 33.505 1.00 0.00 +ATOM 55 SC2 PHE 14 46.323 52.100 34.083 1.00 0.00 +ATOM 56 SC3 PHE 14 46.334 50.205 33.600 1.00 0.00 +ATOM 57 CA PHE 14 41.319 51.022 34.545 1.00 0.00 +ATOM 58 BB HIS 15 38.672 49.613 35.329 1.00 0.00 +ATOM 59 SC1 HIS 15 38.644 49.494 32.498 1.00 0.00 +ATOM 60 SC2 HIS 15 39.651 50.142 30.359 1.00 0.00 +ATOM 61 SC3 HIS 15 40.363 48.653 31.183 1.00 0.00 +ATOM 62 CA HIS 15 38.672 49.613 35.329 1.00 0.00 +ATOM 63 BB GLU 16 35.632 48.391 36.158 1.00 0.00 +ATOM 64 SC1 GLU 16 33.074 51.396 37.368 1.00 0.00 +ATOM 65 CA GLU 16 35.632 48.391 36.158 1.00 0.00 +ATOM 66 BB LYS 17 34.377 45.897 38.115 1.00 0.00 +ATOM 67 SC1 LYS 17 36.696 45.211 40.540 1.00 0.00 +ATOM 68 SC2 LYS 17 37.219 43.033 42.464 1.00 0.00 +ATOM 69 CA LYS 17 34.377 45.897 38.115 1.00 0.00 +ATOM 70 BB HIS 18 33.440 42.938 37.408 1.00 0.00 +ATOM 71 SC1 HIS 18 33.094 42.959 34.623 1.00 0.00 +ATOM 72 SC2 HIS 18 33.269 44.979 33.289 1.00 0.00 +ATOM 73 SC3 HIS 18 33.068 43.376 32.343 1.00 0.00 +ATOM 74 CA HIS 18 33.440 42.938 37.408 1.00 0.00 +ATOM 75 BB HIS 19 31.015 40.559 39.030 1.00 0.00 +ATOM 76 SC1 HIS 19 29.879 42.414 40.203 1.00 0.00 +ATOM 77 SC2 HIS 19 28.894 44.540 39.677 1.00 0.00 +ATOM 78 SC3 HIS 19 27.877 43.003 39.222 1.00 0.00 +ATOM 79 CA HIS 19 31.015 40.559 39.030 1.00 0.00 +ATOM 80 BB SER 20 30.766 37.889 37.238 1.00 0.00 +ATOM 81 SC1 SER 20 31.272 38.948 35.070 1.00 0.00 +ATOM 82 CA SER 20 30.766 37.889 37.238 1.00 0.00 +ATOM 83 BB HIS 21 33.539 37.342 38.323 1.00 0.00 +ATOM 84 SC1 HIS 21 34.794 36.404 36.113 1.00 0.00 +ATOM 85 SC2 HIS 21 34.599 36.670 33.722 1.00 0.00 +ATOM 86 SC3 HIS 21 34.246 34.971 34.408 1.00 0.00 +ATOM 87 CA HIS 21 33.539 37.342 38.323 1.00 0.00 +ATOM 88 BB ARG 22 34.938 35.578 40.813 1.00 0.00 +ATOM 89 SC1 ARG 22 32.092 35.151 41.906 1.00 0.00 +ATOM 90 SC2 ARG 22 28.506 35.957 40.550 1.00 0.00 +ATOM 91 CA ARG 22 34.938 35.578 40.813 1.00 0.00 +ATOM 92 BB GLY 23 37.369 37.232 41.772 1.00 0.00 +ATOM 93 CA GLY 23 37.369 37.232 41.772 1.00 0.00 +ATOM 94 BB TYR 24 40.575 38.666 40.667 1.00 0.00 +ATOM 95 SC1 TYR 24 40.604 41.269 41.653 1.00 0.00 +ATOM 96 SC2 TYR 24 40.309 42.960 39.801 1.00 0.00 +ATOM 97 SC3 TYR 24 41.442 43.599 41.985 1.00 0.00 +ATOM 98 SC4 TYR 24 41.220 45.317 40.049 1.00 0.00 +ATOM 99 CA TYR 24 40.575 38.666 40.667 1.00 0.00 +TER 100 TYR 24 +CONECT 1 2 4 +CONECT 4 5 7 +CONECT 7 8 12 +CONECT 8 9 10 +CONECT 9 10 +CONECT 12 13 15 +CONECT 15 16 19 +CONECT 16 17 +CONECT 19 20 23 +CONECT 20 21 +CONECT 23 24 28 +CONECT 24 25 26 +CONECT 25 26 +CONECT 28 29 33 +CONECT 29 30 31 +CONECT 30 31 +CONECT 33 35 +CONECT 35 36 41 +CONECT 36 37 38 +CONECT 37 38 39 +CONECT 38 39 +CONECT 41 42 45 +CONECT 42 43 +CONECT 45 46 49 +CONECT 46 47 +CONECT 49 50 53 +CONECT 50 51 +CONECT 53 54 58 +CONECT 54 55 56 +CONECT 55 56 +CONECT 58 59 63 +CONECT 59 60 61 +CONECT 60 61 +CONECT 63 64 66 +CONECT 66 67 70 +CONECT 67 68 +CONECT 70 71 75 +CONECT 71 72 73 +CONECT 72 73 +CONECT 75 76 80 +CONECT 76 77 78 +CONECT 77 78 +CONECT 80 81 83 +CONECT 83 84 88 +CONECT 84 85 86 +CONECT 85 86 +CONECT 88 89 92 +CONECT 89 90 +CONECT 92 94 +CONECT 94 95 +CONECT 95 96 97 +CONECT 96 97 98 +CONECT 97 98 +END \ No newline at end of file diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/citation b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/citation new file mode 100644 index 000000000..6209c13b8 --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/citation @@ -0,0 +1 @@ +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 \ No newline at end of file diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command new file mode 100644 index 000000000..17d8e42b1 --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command @@ -0,0 +1,9 @@ +martinize2 +-f ../aa.pdb +-ff martini3001 +-x cg.pdb +-o topol.top +-ss C +-water-bias +-water-bias-eps idr:0.5 +-id-regions 1:24 \ No newline at end of file diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp new file mode 100644 index 000000000..74f239c42 --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp @@ -0,0 +1,395 @@ +; This file was generated using the following command: +; /coarse/chris/python_packages/vermouth_dev/vermouth-martinize/venv/bin/martinize2 -f ../aa.pdb -ff martini3001 -o topol.top -x cg.pdb -ss C -water-bias -water-bias-eps idr:0.5 -id-regions 1:24 +; martinize with vermouth 0.0.1.dev1728 +; The following sequence of secondary structure +; was used for the full system: +; CCCCCCCCCCCCCCCCCCCCCCCC + +; 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 +; Souza, P C T; Araujo, L P B; Brasnett, C; Moreira, R A; Grunewald, F; Park, P; Wang, L; Razmazma, H; Borges-Araujo, A C; Cofas-Vargas, L F; Monticelli, L; Mera-Adasme, R; Melo, M N; Wu, S; Marrink, S J; Poma, A B; Thallmair, S; 2024; 10.1101/2024.04.15.589479 + +[ moleculetype ] +molecule_0 1 + +[ atoms ] + 1 Q5 1 ASP BB 1 1 + 2 SQ5n 1 ASP SC1 2 -1.0 + 3 molecule_0_1 1 ASP CA 76 0 0.0 + 4 P2 2 SER BB 3 0.0 + 5 TP1 2 SER SC1 4 0.0 + 6 molecule_0_2 2 SER CA 77 0 0.0 + 7 P2 3 HIS BB 5 0.0 + 8 TC4 3 HIS SC1 6 0.0 + 9 TN6d 3 HIS SC2 7 0.0 +10 TN5a 3 HIS SC3 8 0.0 +11 molecule_0_3 3 HIS CA 78 0 0.0 +12 SP2 4 ALA BB 9 0.0 +13 TC3 4 ALA SC1 10 0.0 +14 molecule_0_4 4 ALA CA 79 0 0.0 +15 P2 5 LYS BB 11 0.0 +16 SC3 5 LYS SC1 12 0.0 +17 SQ4p 5 LYS SC2 13 1.0 +18 molecule_0_5 5 LYS CA 80 0 0.0 +19 P2 6 ARG BB 14 0.0 +20 SC3 6 ARG SC1 15 0.0 +21 SQ3p 6 ARG SC2 16 1.0 +22 molecule_0_6 6 ARG CA 81 0 0.0 +23 P2 7 HIS BB 17 0.0 +24 TC4 7 HIS SC1 18 0.0 +25 TN6d 7 HIS SC2 19 0.0 +26 TN5a 7 HIS SC3 20 0.0 +27 molecule_0_7 7 HIS CA 82 0 0.0 +28 P2 8 HIS BB 21 0.0 +29 TC4 8 HIS SC1 22 0.0 +30 TN6d 8 HIS SC2 23 0.0 +31 TN5a 8 HIS SC3 24 0.0 +32 molecule_0_8 8 HIS CA 83 0 0.0 +33 SP1 9 GLY BB 25 0.0 +34 molecule_0_9 9 GLY CA 84 0 0.0 +35 P2 10 TYR BB 26 0.0 +36 TC4 10 TYR SC1 27 0.0 +37 TC5 10 TYR SC2 28 0.0 +38 TC5 10 TYR SC3 29 0.0 +39 TN6 10 TYR SC4 30 0.0 +40 molecule_0_10 10 TYR CA 85 0 0.0 +41 P2 11 LYS BB 31 0.0 +42 SC3 11 LYS SC1 32 0.0 +43 SQ4p 11 LYS SC2 33 1.0 +44 molecule_0_11 11 LYS CA 86 0 0.0 +45 P2 12 ARG BB 34 0.0 +46 SC3 12 ARG SC1 35 0.0 +47 SQ3p 12 ARG SC2 36 1.0 +48 molecule_0_12 12 ARG CA 87 0 0.0 +49 P2 13 LYS BB 37 0.0 +50 SC3 13 LYS SC1 38 0.0 +51 SQ4p 13 LYS SC2 39 1.0 +52 molecule_0_13 13 LYS CA 88 0 0.0 +53 P2 14 PHE BB 40 0.0 +54 SC4 14 PHE SC1 41 0.0 +55 TC5 14 PHE SC2 42 0.0 +56 TC5 14 PHE SC3 43 0.0 +57 molecule_0_14 14 PHE CA 89 0 0.0 +58 P2 15 HIS BB 44 0.0 +59 TC4 15 HIS SC1 45 0.0 +60 TN6d 15 HIS SC2 46 0.0 +61 TN5a 15 HIS SC3 47 0.0 +62 molecule_0_15 15 HIS CA 90 0 0.0 +63 P2 16 GLU BB 48 0.0 +64 Q5n 16 GLU SC1 49 -1.0 +65 molecule_0_16 16 GLU CA 91 0 0.0 +66 P2 17 LYS BB 50 0.0 +67 SC3 17 LYS SC1 51 0.0 +68 SQ4p 17 LYS SC2 52 1.0 +69 molecule_0_17 17 LYS CA 92 0 0.0 +70 P2 18 HIS BB 53 0.0 +71 TC4 18 HIS SC1 54 0.0 +72 TN6d 18 HIS SC2 55 0.0 +73 TN5a 18 HIS SC3 56 0.0 +74 molecule_0_18 18 HIS CA 93 0 0.0 +75 P2 19 HIS BB 57 0.0 +76 TC4 19 HIS SC1 58 0.0 +77 TN6d 19 HIS SC2 59 0.0 +78 TN5a 19 HIS SC3 60 0.0 +79 molecule_0_19 19 HIS CA 94 0 0.0 +80 P2 20 SER BB 61 0.0 +81 TP1 20 SER SC1 62 0.0 +82 molecule_0_20 20 SER CA 95 0 0.0 +83 P2 21 HIS BB 63 0.0 +84 TC4 21 HIS SC1 64 0.0 +85 TN6d 21 HIS SC2 65 0.0 +86 TN5a 21 HIS SC3 66 0.0 +87 molecule_0_21 21 HIS CA 96 0 0.0 +88 P2 22 ARG BB 67 0.0 +89 SC3 22 ARG SC1 68 0.0 +90 SQ3p 22 ARG SC2 69 1.0 +91 molecule_0_22 22 ARG CA 97 0 0.0 +92 SP1 23 GLY BB 70 0.0 +93 molecule_0_23 23 GLY CA 98 0 0.0 +94 Q5 24 TYR BB 71 -1 +95 TC4 24 TYR SC1 72 0.0 +96 TC5 24 TYR SC2 73 0.0 +97 TC5 24 TYR SC3 74 0.0 +98 TN6 24 TYR SC4 75 0.0 +99 molecule_0_24 24 TYR CA 99 0 0.0 + +[ bonds ] +; Backbone bonds + 1 4 1 0.350 4000 + 4 7 1 0.350 4000 + 7 12 1 0.350 4000 +12 15 1 0.350 4000 +15 19 1 0.350 4000 +19 23 1 0.350 4000 +23 28 1 0.350 4000 +28 33 1 0.350 4000 +33 35 1 0.350 4000 +35 41 1 0.350 4000 +41 45 1 0.350 4000 +45 49 1 0.350 4000 +49 53 1 0.350 4000 +53 58 1 0.350 4000 +58 63 1 0.350 4000 +63 66 1 0.350 4000 +66 70 1 0.350 4000 +70 75 1 0.350 4000 +75 80 1 0.350 4000 +80 83 1 0.350 4000 +83 88 1 0.350 4000 +88 92 1 0.350 4000 +92 94 1 0.350 4000 + +; Side chain bonds + 1 2 1 0.352 7500 + 4 5 1 0.287 7500 + 7 8 1 0.336 7500 +15 16 1 0.330 5000 +16 17 1 0.360 5000 +19 20 1 0.330 5000 +20 21 1 0.380 5000 +23 24 1 0.336 7500 +28 29 1 0.336 7500 +35 36 1 0.325 5000 +41 42 1 0.330 5000 +42 43 1 0.360 5000 +45 46 1 0.330 5000 +46 47 1 0.380 5000 +49 50 1 0.330 5000 +50 51 1 0.360 5000 +53 54 1 0.325 7500 +58 59 1 0.336 7500 +63 64 1 0.400 5000 +66 67 1 0.330 5000 +67 68 1 0.360 5000 +70 71 1 0.336 7500 +75 76 1 0.336 7500 +80 81 1 0.287 7500 +83 84 1 0.336 7500 +88 89 1 0.330 5000 +89 90 1 0.380 5000 +94 95 1 0.325 5000 + +#ifdef FLEXIBLE +; Side chain bonds + 8 9 1 0.320 1000000 + 8 10 1 0.300 1000000 + 9 10 1 0.270 1000000 +12 13 1 0.270 1000000 +24 25 1 0.320 1000000 +24 26 1 0.300 1000000 +25 26 1 0.270 1000000 +29 30 1 0.320 1000000 +29 31 1 0.300 1000000 +30 31 1 0.270 1000000 +36 37 1 0.300 1000000 +36 38 1 0.300 1000000 +37 39 1 0.285 1000000 +38 39 1 0.285 1000000 +37 38 1 0.300 1000000 +54 55 1 0.340 1000000 +54 56 1 0.340 1000000 +55 56 1 0.290 1000000 +59 60 1 0.320 1000000 +59 61 1 0.300 1000000 +60 61 1 0.270 1000000 +71 72 1 0.320 1000000 +71 73 1 0.300 1000000 +72 73 1 0.270 1000000 +76 77 1 0.320 1000000 +76 78 1 0.300 1000000 +77 78 1 0.270 1000000 +84 85 1 0.320 1000000 +84 86 1 0.300 1000000 +85 86 1 0.270 1000000 +95 96 1 0.300 1000000 +95 97 1 0.300 1000000 +96 98 1 0.285 1000000 +97 98 1 0.285 1000000 +96 97 1 0.300 1000000 +#endif + +[ constraints ] +#ifndef FLEXIBLE +; Side chain bonds + 8 9 1 0.320 + 8 10 1 0.300 + 9 10 1 0.270 +12 13 1 0.270 +24 25 1 0.320 +24 26 1 0.300 +25 26 1 0.270 +29 30 1 0.320 +29 31 1 0.300 +30 31 1 0.270 +36 37 1 0.300 +36 38 1 0.300 +37 39 1 0.285 +38 39 1 0.285 +37 38 1 0.300 +54 55 1 0.340 +54 56 1 0.340 +55 56 1 0.290 +59 60 1 0.320 +59 61 1 0.300 +60 61 1 0.270 +71 72 1 0.320 +71 73 1 0.300 +72 73 1 0.270 +76 77 1 0.320 +76 78 1 0.300 +77 78 1 0.270 +84 85 1 0.320 +84 86 1 0.300 +85 86 1 0.270 +95 96 1 0.300 +95 97 1 0.300 +96 98 1 0.285 +97 98 1 0.285 +96 97 1 0.300 +#endif + +[ virtual_sitesn ] +; Virtual go site + 3 1 1 + 6 1 4 +11 1 7 +14 1 12 +18 1 15 +22 1 19 +27 1 23 +32 1 28 +34 1 33 +40 1 35 +44 1 41 +48 1 45 +52 1 49 +57 1 53 +62 1 58 +65 1 63 +69 1 66 +74 1 70 +79 1 75 +82 1 80 +87 1 83 +91 1 88 +93 1 92 +99 1 94 + +[ angles ] +; BBB angles + 1 4 7 10 127 20 + 4 7 12 10 127 20 + 7 12 15 10 127 20 +12 15 19 10 127 20 +15 19 23 10 127 20 +19 23 28 10 127 20 +23 28 33 10 127 20 +28 33 35 10 127 20 +33 35 41 10 127 20 +35 41 45 10 127 20 +41 45 49 10 127 20 +45 49 53 10 127 20 +49 53 58 10 127 20 +53 58 63 10 127 20 +58 63 66 10 127 20 +63 66 70 10 127 20 +66 70 75 10 127 20 +70 75 80 10 127 20 +75 80 83 10 127 20 +80 83 88 10 127 20 +83 88 92 10 127 20 +88 92 94 10 127 20 + +; BBS angles regular martini + 1 4 5 2 100 25 + 4 7 8 2 100 25 + 7 12 13 2 100 25 +12 15 16 2 100 25 +15 19 20 2 100 25 +19 23 24 2 100 25 +23 28 29 2 100 25 +33 35 36 2 100 25 +35 41 42 2 100 25 +41 45 46 2 100 25 +45 49 50 2 100 25 +49 53 54 2 100 25 +53 58 59 2 100 25 +58 63 64 2 100 25 +63 66 67 2 100 25 +66 70 71 2 100 25 +70 75 76 2 100 25 +75 80 81 2 100 25 +80 83 84 2 100 25 +83 88 89 2 100 25 +92 94 95 2 100 25 + +; First SBB regular martini + 2 1 4 2 100 25 + +; Side chain angles + 7 8 9 2 120.000 50.0 + 7 8 10 2 120.000 50.0 +15 16 17 2 180.000 25.0 +19 20 21 2 180.000 25.0 +23 24 25 2 120.000 50.0 +23 24 26 2 120.000 50.0 +28 29 30 2 120.000 50.0 +28 29 31 2 120.000 50.0 +35 36 37 2 120.000 60.0 +35 36 38 2 120.000 60.0 +41 42 43 2 180.000 25.0 +45 46 47 2 180.000 25.0 +49 50 51 2 180.000 25.0 +53 54 55 2 120.000 50.0 +53 54 56 2 120.000 50.0 +58 59 60 2 120.000 50.0 +58 59 61 2 120.000 50.0 +66 67 68 2 180.000 25.0 +70 71 72 2 120.000 50.0 +70 71 73 2 120.000 50.0 +75 76 77 2 120.000 50.0 +75 76 78 2 120.000 50.0 +83 84 85 2 120.000 50.0 +83 84 86 2 120.000 50.0 +88 89 90 2 180.000 25.0 +94 95 96 2 120.000 60.0 +94 95 97 2 120.000 60.0 + +[ exclusions ] + 7 8 9 10 + 8 9 10 + 9 10 +23 24 25 26 +24 25 26 +25 26 +28 29 30 31 +29 30 31 +30 31 +35 36 37 38 39 +36 37 38 39 +37 38 39 +38 39 +53 54 55 56 +54 55 56 +55 56 +58 59 60 61 +59 60 61 +60 61 +70 71 72 73 +71 72 73 +72 73 +75 76 77 78 +76 77 78 +77 78 +83 84 85 86 +84 85 86 +85 86 +94 95 96 97 98 +95 96 97 98 +96 97 98 +97 98 + +[ dihedrals ] +39 37 38 36 2 180.0 50.0 +98 96 97 95 2 180.0 50.0 + diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/topol.top b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/topol.top new file mode 100644 index 000000000..21d9bb951 --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/topol.top @@ -0,0 +1,12 @@ + +#include "martini.itp" + + #include "virtual_sites_atomtypes.itp" + #include "virtual_sites_nonbond_params.itp" +#include "molecule_0.itp" + +[ system ] +Title of the system + +[ molecules ] +molecule_0 1 diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_atomtypes.itp b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_atomtypes.itp new file mode 100644 index 000000000..a54d29712 --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_atomtypes.itp @@ -0,0 +1,25 @@ +[ atomtypes ] +molecule_0_1 0.0 0 A 0.00000000 0.00000000 +molecule_0_2 0.0 0 A 0.00000000 0.00000000 +molecule_0_3 0.0 0 A 0.00000000 0.00000000 +molecule_0_4 0.0 0 A 0.00000000 0.00000000 +molecule_0_5 0.0 0 A 0.00000000 0.00000000 +molecule_0_6 0.0 0 A 0.00000000 0.00000000 +molecule_0_7 0.0 0 A 0.00000000 0.00000000 +molecule_0_8 0.0 0 A 0.00000000 0.00000000 +molecule_0_9 0.0 0 A 0.00000000 0.00000000 +molecule_0_10 0.0 0 A 0.00000000 0.00000000 +molecule_0_11 0.0 0 A 0.00000000 0.00000000 +molecule_0_12 0.0 0 A 0.00000000 0.00000000 +molecule_0_13 0.0 0 A 0.00000000 0.00000000 +molecule_0_14 0.0 0 A 0.00000000 0.00000000 +molecule_0_15 0.0 0 A 0.00000000 0.00000000 +molecule_0_16 0.0 0 A 0.00000000 0.00000000 +molecule_0_17 0.0 0 A 0.00000000 0.00000000 +molecule_0_18 0.0 0 A 0.00000000 0.00000000 +molecule_0_19 0.0 0 A 0.00000000 0.00000000 +molecule_0_20 0.0 0 A 0.00000000 0.00000000 +molecule_0_21 0.0 0 A 0.00000000 0.00000000 +molecule_0_22 0.0 0 A 0.00000000 0.00000000 +molecule_0_23 0.0 0 A 0.00000000 0.00000000 +molecule_0_24 0.0 0 A 0.00000000 0.00000000 diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp new file mode 100644 index 000000000..104a9ff9d --- /dev/null +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp @@ -0,0 +1,25 @@ +[ nonbond_params ] +W molecule_0_1 1 0.47000000 0.50000000 ;water bias C +W molecule_0_2 1 0.47000000 0.50000000 ;water bias C +W molecule_0_3 1 0.47000000 0.50000000 ;water bias C +W molecule_0_4 1 0.41000000 0.50000000 ;water bias C +W molecule_0_5 1 0.47000000 0.50000000 ;water bias C +W molecule_0_6 1 0.47000000 0.50000000 ;water bias C +W molecule_0_7 1 0.47000000 0.50000000 ;water bias C +W molecule_0_8 1 0.47000000 0.50000000 ;water bias C +W molecule_0_9 1 0.41000000 0.50000000 ;water bias C +W molecule_0_10 1 0.47000000 0.50000000 ;water bias C +W molecule_0_11 1 0.47000000 0.50000000 ;water bias C +W molecule_0_12 1 0.47000000 0.50000000 ;water bias C +W molecule_0_13 1 0.47000000 0.50000000 ;water bias C +W molecule_0_14 1 0.47000000 0.50000000 ;water bias C +W molecule_0_15 1 0.47000000 0.50000000 ;water bias C +W molecule_0_16 1 0.47000000 0.50000000 ;water bias C +W molecule_0_17 1 0.47000000 0.50000000 ;water bias C +W molecule_0_18 1 0.47000000 0.50000000 ;water bias C +W molecule_0_19 1 0.47000000 0.50000000 ;water bias C +W molecule_0_20 1 0.47000000 0.50000000 ;water bias C +W molecule_0_21 1 0.47000000 0.50000000 ;water bias C +W molecule_0_22 1 0.47000000 0.50000000 ;water bias C +W molecule_0_23 1 0.41000000 0.50000000 ;water bias C +W molecule_0_24 1 0.47000000 0.50000000 ;water bias C From 0aaf85899368e515578071881039be26c051865f Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 24 Apr 2024 10:42:52 +0200 Subject: [PATCH 03/20] added more detail to -ss help --- bin/martinize2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/martinize2 b/bin/martinize2 index fb269959d..f0bf91f5d 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -444,7 +444,9 @@ def entry(): dest="ss", type=str.upper, metavar="SEQUENCE", - help=("Manually set the secondary " "structure of the proteins."), + help=("Manually set the secondary structure of the proteins. " + "Either give a dssp sequence for each residue in your input file " + "or a single letter to be repeated for the entire sequence, e.g. -ss C"), ) secstruct_exclusion.add_argument( "-collagen", action="store_true", default=False, help="Use collagen parameters" From d084a7379991f6ada82723d55d872c021a2a5b7d Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 24 Apr 2024 14:36:54 +0200 Subject: [PATCH 04/20] start of adding additional idp bonded potentials with the extra flag -idp-tune (probably a better name) martinize will add additional potentials as per the Go paper. This commit: 1) finds cross Go interactions between folded and idrs and removes them 2) identifies BB and SC1 beads in idrs --- bin/martinize2 | 11 ++ vermouth/processors/__init__.py | 1 + vermouth/processors/tune_idp_bonds.py | 144 ++++++++++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 vermouth/processors/tune_idp_bonds.py diff --git a/bin/martinize2 b/bin/martinize2 index f0bf91f5d..d7899f57b 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -610,6 +610,13 @@ def entry(): "format: : :..." ), ) + water_group.add_argument( + "-idr-tune", + dest="idr_tune", + action="store_true", + default=False, + help=("Tune the idr regions with specific bonded potentials."), + ) prot_group = parser.add_argument_group("Protein description") @@ -1038,6 +1045,10 @@ def entry(): vermouth.rcsu.go_vs_includes.VirtualSiteCreator().run_system(system) itp_paths = {"atomtypes": "virtual_sites_atomtypes.itp", "nonbond_params": "virtual_sites_nonbond_params.itp"} + # apply idr specific bonded potentials + if args.idr_tune: + vermouth.processors.IDRBonds([(int(start), int(stop)) for start, stop in args.water_idrs] + ).run_system(system) # now we add a bias by defining specific virtual-site water interactions vermouth.processors.ComputeWaterBias(args.water_bias, { s:float(eps) for s, eps in args.water_bias_eps}, diff --git a/vermouth/processors/__init__.py b/vermouth/processors/__init__.py index 4cdcc58ef..a314521bc 100644 --- a/vermouth/processors/__init__.py +++ b/vermouth/processors/__init__.py @@ -44,3 +44,4 @@ from .merge_all_molecules import MergeAllMolecules from .annotate_mut_mod import AnnotateMutMod from .water_bias import ComputeWaterBias +from .tune_idp_bonds import IDRBonds diff --git a/vermouth/processors/tune_idp_bonds.py b/vermouth/processors/tune_idp_bonds.py new file mode 100644 index 000000000..d50449a2e --- /dev/null +++ b/vermouth/processors/tune_idp_bonds.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2018 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. +""" +Provides processors that can add and remove IDR specific bonds +""" + +import functools + +from .processor import Processor +from ..graph_utils import make_residue_graph +from ..rcsu.go_utils import get_go_type_from_attributes, _get_bead_size, _in_resid_region +from ..gmx.topology import AngleParam, DihParam +import numpy as np +from vermouth import selectors + +class IDRBonds(Processor): + """ + Processor which adds additional bonded potentials, and removes + unnecessary present ones to IDR regions in the protein. + + This processor is designed for the work described in the reference + M3_GO, but is generally applicable for such circumstances where extra + addition/removals are necessary. + + """ + + def __init__(self, idr_regions): + """ + Parameters + ---------- + + idr_regions: + regions defining the IDRs + """ + self.idr_regions = idr_regions + + def remove_cross_nb_interactions(self, molecule, res_graph): + """ + Remove existing bonded interactions in idr region + """ + + #list of all the Go pairs in the molecule + all_go_pairs = np.array([list(i.atoms) for i in self.system.gmx_topology_params["nonbond_params"]]) + + # list to record which items we don't want. cross = go potential between folded and disordered domain. + all_cross_pairs = [] + + for res_node in res_graph.nodes: + resid = res_graph.nodes[res_node]['resid'] + _old_resid = res_graph.nodes[res_node]['_old_resid'] + chain = res_graph.nodes[res_node]['chain'] + + if _in_resid_region(_old_resid, self.idr_regions): + vs_go_node = next(get_go_type_from_attributes(res_graph.nodes[res_node]['graph'], + resid=resid, + chain=chain, + prefix=molecule.meta.get('moltype'))) + all_cross_pairs.append(np.where(all_go_pairs == vs_go_node)[0]) #just need the first one + + # make sure we only have one entry in case a site has more than one interaction + all_cross_pairs = np.unique([x for xs in all_cross_pairs for x in xs]) + # delete the folded-disordered Go interactions from the list going backwards. + # otherwise list order gets messed up. + for i in all_cross_pairs[::-1]: + del self.system.gmx_topology_params["nonbond_params"][i] + + def get_idr_keys(self, molecule): + """ + get the keys of BB and SC1 beads in IDR regions + """ + + BB = [] + SC1 = [] + + for key, node in molecule.nodes.items(): + resid = node['resid'] + _old_resid = node['_old_resid'] + chain = node['chain'] + + if _in_resid_region(_old_resid, self.idr_regions): + if selectors.select_backbone(node): + BB.append(key) + if node.get('resname') == 'GLY': + SC1.append(np.nan) + + if node.get('atomname') == 'SC1': + SC1.append(key) + return BB, SC1 + + + + def run_molecule(self, molecule): + """ + Assign water bias for a single molecule + """ + if not self.system: + raise IOError('This processor requires a system.') + + if not molecule.meta.get('moltype'): + raise ValueError('The molecule does not have a moltype name.') + + if hasattr(molecule, 'res_graph'): + res_graph = molecule.res_graph + else: + res_graph = make_residue_graph(molecule) + + self.remove_cross_nb_interactions(molecule, res_graph) + + BB, SC1 = self.get_idr_keys(molecule) + + + + return molecule + + + + def run_system(self, system): + """ + Assign the water bias of the Go model to file. Biasing + is always molecule specific i.e. no two different + vermouth molecules can have the same bias. + + Parameters + ---------- + system: :class:`vermouth.system.System` + """ + if not (self.idr_regions or self.auto_bias): + return system + self.system = system + super().run_system(system) + From 359cd7786e3b096e5049137ad7d5b825e2605001 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 24 Apr 2024 17:22:49 +0200 Subject: [PATCH 05/20] add idr interactions --- bin/martinize2 | 13 +- vermouth/processors/tune_idp_bonds.py | 200 ++++++++++++++++++++++++-- vermouth/rcsu/go_utils.py | 22 +++ 3 files changed, 218 insertions(+), 17 deletions(-) diff --git a/bin/martinize2 b/bin/martinize2 index d7899f57b..7b5a81cdf 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -610,7 +610,7 @@ def entry(): "format: : :..." ), ) - water_group.add_argument( + idr_tuning = water_group.add_argument( "-idr-tune", dest="idr_tune", action="store_true", @@ -1045,10 +1045,17 @@ def entry(): vermouth.rcsu.go_vs_includes.VirtualSiteCreator().run_system(system) itp_paths = {"atomtypes": "virtual_sites_atomtypes.itp", "nonbond_params": "virtual_sites_nonbond_params.itp"} - # apply idr specific bonded potentials - if args.idr_tune: + # apply idr specific bonded potentials if + if args.idr_tune and args.to_ff == 'martini3001': vermouth.processors.IDRBonds([(int(start), int(stop)) for start, stop in args.water_idrs] ).run_system(system) + else: + raise argparse.ArgumentError(idr_tuning, + message=("Either you are applying water biasing without also adjusting " + "bonded parameters for disordered regions, or your target force field " + "is not martini3001. IDR bonded parameter tuning is intended to" + "complement water biasing in martini3001 and not elsewhere.")) + # now we add a bias by defining specific virtual-site water interactions vermouth.processors.ComputeWaterBias(args.water_bias, { s:float(eps) for s, eps in args.water_bias_eps}, diff --git a/vermouth/processors/tune_idp_bonds.py b/vermouth/processors/tune_idp_bonds.py index d50449a2e..5f1a64a06 100644 --- a/vermouth/processors/tune_idp_bonds.py +++ b/vermouth/processors/tune_idp_bonds.py @@ -21,10 +21,13 @@ from .processor import Processor from ..graph_utils import make_residue_graph -from ..rcsu.go_utils import get_go_type_from_attributes, _get_bead_size, _in_resid_region -from ..gmx.topology import AngleParam, DihParam +from ..rcsu.go_utils import get_go_type_from_attributes, _get_resid_region, _in_resid_region import numpy as np from vermouth import selectors +from ..log_helpers import StyleAdapter, get_logger + +LOGGER = StyleAdapter(get_logger(__name__)) + class IDRBonds(Processor): """ @@ -86,21 +89,192 @@ def get_idr_keys(self, molecule): SC1 = [] for key, node in molecule.nodes.items(): - resid = node['resid'] _old_resid = node['_old_resid'] - chain = node['chain'] - if _in_resid_region(_old_resid, self.idr_regions): + region = _get_resid_region(_old_resid, self.idr_regions) if selectors.select_backbone(node): - BB.append(key) + BB.append(np.array([region, key])) + #if the residue is a GLY and doesn't have a sidechain we need to note it if node.get('resname') == 'GLY': - SC1.append(np.nan) - + SC1.append(np.array([region, np.nan])) if node.get('atomname') == 'SC1': - SC1.append(key) + SC1.append(np.array([region, key])) return BB, SC1 + def add_idr_angles(self, molecule, BB, SC1): + """ + add idr specific angles to the idr region + """ + #find how many disordered regions we've been given + regions = list(set([i[0] for i in BB])) + + # BB-BB-SC1 angles + for region in regions: + BB_keys = [i[1] for i in BB if i[0] == region] + SC_keys = [i[1] for i in SC1 if i[0] == region] + + window = 2 + for i in range(len(BB_keys) - window + 1): + BB_atoms = BB_keys[i: i + window] + SC_atoms = SC_keys[i: i + window] + #ie. if we don't have any residues without sidechains + if all(~np.isnan(np.array(SC_atoms))): + bbs_atomlist = [BB_atoms[0], BB_atoms[1], SC_atoms[1]] + sbb_atomlist = [SC_atoms[0], BB_atoms[0], BB_atoms[1]] + + molecule.add_or_replace_interaction('angles', + atoms=bbs_atomlist, + parameters=['10', '85', '10'], + meta={"group": "idp-fix", "comment": "BB-BB-SC1-v1", + "version": 1} + ) + + molecule.add_or_replace_interaction('angles', + atoms=sbb_atomlist, + parameters=['10', '85', '10'], + meta={"group": "idp-fix", "comment": "SC1-BB-BB-v1", + "version": 1} + ) + #SC1-BB-BB(GLY)-BB and BB-BB(GLY)-BB-SC1 dihedrals + for region in regions: + BB_keys = [i[1] for i in BB if i[0] == region] + SC_keys = [i[1] for i in SC1 if i[0] == region] + + inds = np.where(np.isnan(SC_keys) == True)[0] + + for i in inds: + sbb_atomlist = [SC_keys[i-1], + BB_keys[i-1], + BB_keys[i]] + + bbs_atomlist = [BB_keys[i], + BB_keys[i+1], + SC_keys[i+1]] + try: + molecule.remove_interaction('angles', + atoms=sbb_atomlist) + except KeyError: + pass + try: + molecule.remove_interaction('angles', + atoms=bbs_atomlist) + except KeyError: + pass + molecule.add_or_replace_interaction('angles', + atoms=bbs_atomlist, + parameters=['10', '85', '10', ], + meta={"group": "idp-fix", "comment": "BB(GLY)-BB-SC1-v1", + "version": 1} + ) + + molecule.add_or_replace_interaction('angles', + atoms=sbb_atomlist, + parameters=['10', '85', '10', ], + meta={"group": "idp-fix", "comment": "SC1-BB-BB(GLY)-v1", + "version": 1} + ) + + def add_idr_dih(self, molecule, BB, SC1): + """ + add idr specific dihedrals to the idr region + """ + #find how many disordered regions we've been given + regions = list(set([i[0] for i in BB])) + + # BB-BB-BB-BB dihedrals + #make sure we're only applying interactions within regions + for region in regions: + keys = [i[1] for i in BB if i[0] == region] + window = 4 + for i in range(len(keys) - window + 1): + atoms = keys[i: i + window] + try: + molecule.remove_interaction('dihedrals', + atoms=atoms) + except KeyError: + pass + molecule.add_or_replace_interaction('dihedrals', + atoms = atoms, + parameters = ['9', '-120', '-1', '1'], + meta = {"group": "idp-fix", "comment": "BB-BB-BB-BB-v1", "version":1} + ) + molecule.add_or_replace_interaction('dihedrals', + atoms = atoms, + parameters = ['9', '-120', '-1', '2'], + meta={"group": "idp-fix", "comment": "BB-BB-BB-BB-v2", "version": 2} + ) + + # SC1-BB-BB-SC1 dihedrals + for region in regions: + BB_keys = [i[1] for i in BB if i[0] == region] + SC_keys = [i[1] for i in SC1 if i[0] == region] + + window = 2 + for i in range(len(BB_keys) - window + 1): + BB_atoms = BB_keys[i: i + window] + SC_atoms = SC_keys[i: i + window] + #ie. if we don't have any residues without sidechains + if all(~np.isnan(np.array(SC_atoms))): + atomlist = [SC_atoms[0], BB_atoms[0], BB_atoms[1], SC_atoms[1]] + try: + molecule.remove_interaction('dihedrals', + atoms=atomlist) + except KeyError: + pass + + molecule.add_or_replace_interaction('dihedrals', + atoms=atomlist, + parameters=['9', '-130', '-1.5', '1'], + meta={"group": "idp-fix", "comment": "SC1-BB-BB-SC1-v1", + "version": 1} + ) + molecule.add_or_replace_interaction('dihedrals', + atoms=atomlist, + parameters=['9', '100', '-1.5', '2'], + meta={"group": "idp-fix", "comment": "SC1-BB-BB-SC1-v2", + "version": 2} + ) + #SC1-BB-BB(GLY)-BB and BB-BB(GLY)-BB-SC1 dihedrals + for region in regions: + BB_keys = [i[1] for i in BB if i[0] == region] + SC_keys = [i[1] for i in SC1 if i[0] == region] + + inds = np.where(np.isnan(SC_keys) == True)[0] + + for i in inds: + sbbb_atomlist = [SC_keys[i-1], + BB_keys[i-1], + BB_keys[i], + BB_keys[i+1]] + + bbbs_atomlist = [BB_keys[i-1], + BB_keys[i], + BB_keys[i+1], + SC_keys[i+1]] + + try: + molecule.remove_interaction('dihedrals', + atoms=sbbb_atomlist) + except KeyError: + pass + try: + molecule.remove_interaction('dihedrals', + atoms=bbbs_atomlist) + except KeyError: + pass + molecule.add_or_replace_interaction('dihedrals', + atoms=sbbb_atomlist, + parameters=['1', '115', '-4.5', '1'], + meta={"group": "idp-fix", "comment": "SC1-BB-BB(GLY)-BB-v1", + "version": 1} + ) + molecule.add_or_replace_interaction('dihedrals', + atoms=bbbs_atomlist, + parameters=['1', '0', '-2.0', '1'], + meta={"group": "idp-fix", "comment": "BB-BB(GLY)-BB-SC1-v1", + "version": 1} + ) def run_molecule(self, molecule): """ @@ -120,13 +294,11 @@ def run_molecule(self, molecule): self.remove_cross_nb_interactions(molecule, res_graph) BB, SC1 = self.get_idr_keys(molecule) - - + self.add_idr_dih(molecule, BB, SC1) + self.add_idr_angles(molecule, BB, SC1) return molecule - - def run_system(self, system): """ Assign the water bias of the Go model to file. Biasing @@ -140,5 +312,5 @@ def run_system(self, system): if not (self.idr_regions or self.auto_bias): return system self.system = system + LOGGER.info("Applying extra bonded potentials to IDRs", type="step") super().run_system(system) - diff --git a/vermouth/rcsu/go_utils.py b/vermouth/rcsu/go_utils.py index 01646617a..160e0f18a 100644 --- a/vermouth/rcsu/go_utils.py +++ b/vermouth/rcsu/go_utils.py @@ -71,6 +71,28 @@ def _in_resid_region(resid, regions): return True return False +def _get_resid_region(resid, regions): + """ + Check if resid falls in regions interval. + + Parameters + ---------- + resid: int + the resid of a molecule + regions: list[tuple(int, int)] + a list of the intervals + + Returns + ------- + bool + """ + for region_index, limits in enumerate(regions): + # perhaps someone gives them as reversed + low, up = sorted(limits) + if low <= resid <= up: + return region_index + return False + def _get_bead_size(atype): if atype.startswith("S"): bead_size = "small" From 46e84733bf3d010ba71615340e785ca17140441a Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 25 Apr 2024 11:55:28 +0200 Subject: [PATCH 06/20] cleaned up and fixed --- bin/martinize2 | 20 +- vermouth/processors/tune_idp_bonds.py | 7 +- vermouth/processors/water_bias.py | 2 +- .../tier-1/hst5/martinize2/cg.pdb | 198 +++++++++--------- .../tier-1/hst5/martinize2/command | 3 +- .../tier-1/hst5/martinize2/molecule_0.itp | 161 +++++++++++--- .../virtual_sites_nonbond_params.itp | 48 ++--- .../integration_tests/test_integration.py | 1 + 8 files changed, 273 insertions(+), 167 deletions(-) diff --git a/bin/martinize2 b/bin/martinize2 index 7b5a81cdf..d959d9e45 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -1045,16 +1045,6 @@ def entry(): vermouth.rcsu.go_vs_includes.VirtualSiteCreator().run_system(system) itp_paths = {"atomtypes": "virtual_sites_atomtypes.itp", "nonbond_params": "virtual_sites_nonbond_params.itp"} - # apply idr specific bonded potentials if - if args.idr_tune and args.to_ff == 'martini3001': - vermouth.processors.IDRBonds([(int(start), int(stop)) for start, stop in args.water_idrs] - ).run_system(system) - else: - raise argparse.ArgumentError(idr_tuning, - message=("Either you are applying water biasing without also adjusting " - "bonded parameters for disordered regions, or your target force field " - "is not martini3001. IDR bonded parameter tuning is intended to" - "complement water biasing in martini3001 and not elsewhere.")) # now we add a bias by defining specific virtual-site water interactions vermouth.processors.ComputeWaterBias(args.water_bias, @@ -1062,6 +1052,16 @@ def entry(): [(int(start), int(stop)) for start, stop in args.water_idrs], ).run_system(system) + # apply idr specific bonded potentials if required + if args.idr_tune: + if args.to_ff == 'martini3001': + vermouth.processors.IDRBonds([(int(start), int(stop)) for start, stop in args.water_idrs] + ).run_system(system) + else: + raise argparse.ArgumentError(idr_tuning, + message=("You are trying to apply IDR biasing to a force field which " + "isn't martini3001, which this is not designed for.")) + # Here we need to add the resids from the PDB back if that is needed if args.resid_handling == "input": for molecule in system.molecules: diff --git a/vermouth/processors/tune_idp_bonds.py b/vermouth/processors/tune_idp_bonds.py index 5f1a64a06..ccc663504 100644 --- a/vermouth/processors/tune_idp_bonds.py +++ b/vermouth/processors/tune_idp_bonds.py @@ -40,7 +40,7 @@ class IDRBonds(Processor): """ - def __init__(self, idr_regions): + def __init__(self, idr_regions = None): """ Parameters ---------- @@ -56,8 +56,7 @@ def remove_cross_nb_interactions(self, molecule, res_graph): """ #list of all the Go pairs in the molecule - all_go_pairs = np.array([list(i.atoms) for i in self.system.gmx_topology_params["nonbond_params"]]) - + all_go_pairs = np.array([list(i.atoms) for i in self.system.gmx_topology_params["nonbond_params"] if 'W' not in list(i.atoms)]) # list to record which items we don't want. cross = go potential between folded and disordered domain. all_cross_pairs = [] @@ -309,7 +308,7 @@ def run_system(self, system): ---------- system: :class:`vermouth.system.System` """ - if not (self.idr_regions or self.auto_bias): + if not self.idr_regions: return system self.system = system LOGGER.info("Applying extra bonded potentials to IDRs", type="step") diff --git a/vermouth/processors/water_bias.py b/vermouth/processors/water_bias.py index eb112f155..5bd5cfc50 100644 --- a/vermouth/processors/water_bias.py +++ b/vermouth/processors/water_bias.py @@ -89,7 +89,7 @@ def assign_residue_water_bias(self, molecule, res_graph): if _in_resid_region(_old_resid, self.idr_regions): eps = self.water_bias.get('idr', 0.0) - sec_struc = res_graph.nodes[res_node]['cgsecstruct'] + sec_struc = 'idr' elif self.auto_bias: sec_struc = res_graph.nodes[res_node]['cgsecstruct'] eps = self.water_bias.get(sec_struc, 0.0) diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb index 7c5c95f6a..eff259c8e 100644 --- a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/cg.pdb @@ -1,102 +1,102 @@ -ATOM 1 BB ASP 1 53.101 31.658 49.332 1.00 0.00 -ATOM 2 SC1 ASP 1 55.309 33.963 49.864 1.00 0.00 -ATOM 3 CA ASP 1 53.101 31.658 49.332 1.00 0.00 -ATOM 4 BB SER 2 49.524 32.599 50.292 1.00 0.00 -ATOM 5 SC1 SER 2 49.316 29.940 50.350 1.00 0.00 -ATOM 6 CA SER 2 49.524 32.599 50.292 1.00 0.00 -ATOM 7 BB HIS 3 50.319 35.260 51.750 1.00 0.00 -ATOM 8 SC1 HIS 3 48.159 34.369 53.313 1.00 0.00 -ATOM 9 SC2 HIS 3 46.292 32.768 53.431 1.00 0.00 -ATOM 10 SC3 HIS 3 47.996 32.053 53.847 1.00 0.00 -ATOM 11 CA HIS 3 50.319 35.260 51.750 1.00 0.00 -ATOM 12 BB ALA 4 49.996 38.890 52.101 1.00 0.00 -ATOM 13 SC1 ALA 4 51.919 38.824 50.873 1.00 0.00 -ATOM 14 CA ALA 4 49.996 38.890 52.101 1.00 0.00 -ATOM 15 BB LYS 5 50.029 42.334 53.576 1.00 0.00 -ATOM 16 SC1 LYS 5 51.499 42.114 56.220 1.00 0.00 -ATOM 17 SC2 LYS 5 53.532 42.525 58.605 1.00 0.00 -ATOM 18 CA LYS 5 50.029 42.334 53.576 1.00 0.00 -ATOM 19 BB ARG 6 50.501 43.512 51.176 1.00 0.00 -ATOM 20 SC1 ARG 6 53.849 44.691 51.430 1.00 0.00 -ATOM 21 SC2 ARG 6 57.141 44.043 50.440 1.00 0.00 -ATOM 22 CA ARG 6 50.501 43.512 51.176 1.00 0.00 -ATOM 23 BB HIS 7 49.062 45.526 48.179 1.00 0.00 -ATOM 24 SC1 HIS 7 47.579 46.644 49.858 1.00 0.00 -ATOM 25 SC2 HIS 7 45.945 46.817 51.656 1.00 0.00 -ATOM 26 SC3 HIS 7 47.678 46.924 52.219 1.00 0.00 -ATOM 27 CA HIS 7 49.062 45.526 48.179 1.00 0.00 -ATOM 28 BB HIS 8 50.537 43.961 45.939 1.00 0.00 -ATOM 29 SC1 HIS 8 52.744 45.269 46.138 1.00 0.00 -ATOM 30 SC2 HIS 8 54.360 46.388 47.602 1.00 0.00 -ATOM 31 SC3 HIS 8 53.361 47.457 46.422 1.00 0.00 -ATOM 32 CA HIS 8 50.537 43.961 45.939 1.00 0.00 -ATOM 33 BB GLY 9 48.372 43.503 42.793 1.00 0.00 -ATOM 34 CA GLY 9 48.372 43.503 42.793 1.00 0.00 -ATOM 35 BB TYR 10 46.083 45.479 43.656 1.00 0.00 -ATOM 36 SC1 TYR 10 45.229 43.574 45.273 1.00 0.00 -ATOM 37 SC2 TYR 10 46.709 42.333 46.930 1.00 0.00 -ATOM 38 SC3 TYR 10 45.409 41.085 45.191 1.00 0.00 -ATOM 39 SC4 TYR 10 46.907 39.755 46.779 1.00 0.00 -ATOM 40 CA TYR 10 46.083 45.479 43.656 1.00 0.00 -ATOM 41 BB LYS 11 44.302 47.749 41.677 1.00 0.00 -ATOM 42 SC1 LYS 11 42.509 48.514 44.223 1.00 0.00 -ATOM 43 SC2 LYS 11 40.096 49.309 46.228 1.00 0.00 -ATOM 44 CA LYS 11 44.302 47.749 41.677 1.00 0.00 -ATOM 45 BB ARG 12 45.679 47.969 38.539 1.00 0.00 -ATOM 46 SC1 ARG 12 48.169 47.137 40.030 1.00 0.00 -ATOM 47 SC2 ARG 12 50.606 48.788 39.005 1.00 0.00 -ATOM 48 CA ARG 12 45.679 47.969 38.539 1.00 0.00 -ATOM 49 BB LYS 13 43.235 48.641 37.069 1.00 0.00 -ATOM 50 SC1 LYS 13 42.069 45.517 36.060 1.00 0.00 -ATOM 51 SC2 LYS 13 41.038 42.428 35.598 1.00 0.00 -ATOM 52 CA LYS 13 43.235 48.641 37.069 1.00 0.00 -ATOM 53 BB PHE 14 41.319 51.022 34.545 1.00 0.00 -ATOM 54 SC1 PHE 14 43.979 51.194 33.505 1.00 0.00 -ATOM 55 SC2 PHE 14 46.323 52.100 34.083 1.00 0.00 -ATOM 56 SC3 PHE 14 46.334 50.205 33.600 1.00 0.00 -ATOM 57 CA PHE 14 41.319 51.022 34.545 1.00 0.00 -ATOM 58 BB HIS 15 38.672 49.613 35.329 1.00 0.00 -ATOM 59 SC1 HIS 15 38.644 49.494 32.498 1.00 0.00 -ATOM 60 SC2 HIS 15 39.651 50.142 30.359 1.00 0.00 -ATOM 61 SC3 HIS 15 40.363 48.653 31.183 1.00 0.00 -ATOM 62 CA HIS 15 38.672 49.613 35.329 1.00 0.00 -ATOM 63 BB GLU 16 35.632 48.391 36.158 1.00 0.00 -ATOM 64 SC1 GLU 16 33.074 51.396 37.368 1.00 0.00 -ATOM 65 CA GLU 16 35.632 48.391 36.158 1.00 0.00 -ATOM 66 BB LYS 17 34.377 45.897 38.115 1.00 0.00 -ATOM 67 SC1 LYS 17 36.696 45.211 40.540 1.00 0.00 -ATOM 68 SC2 LYS 17 37.219 43.033 42.464 1.00 0.00 -ATOM 69 CA LYS 17 34.377 45.897 38.115 1.00 0.00 -ATOM 70 BB HIS 18 33.440 42.938 37.408 1.00 0.00 -ATOM 71 SC1 HIS 18 33.094 42.959 34.623 1.00 0.00 -ATOM 72 SC2 HIS 18 33.269 44.979 33.289 1.00 0.00 -ATOM 73 SC3 HIS 18 33.068 43.376 32.343 1.00 0.00 -ATOM 74 CA HIS 18 33.440 42.938 37.408 1.00 0.00 -ATOM 75 BB HIS 19 31.015 40.559 39.030 1.00 0.00 -ATOM 76 SC1 HIS 19 29.879 42.414 40.203 1.00 0.00 -ATOM 77 SC2 HIS 19 28.894 44.540 39.677 1.00 0.00 -ATOM 78 SC3 HIS 19 27.877 43.003 39.222 1.00 0.00 -ATOM 79 CA HIS 19 31.015 40.559 39.030 1.00 0.00 -ATOM 80 BB SER 20 30.766 37.889 37.238 1.00 0.00 -ATOM 81 SC1 SER 20 31.272 38.948 35.070 1.00 0.00 -ATOM 82 CA SER 20 30.766 37.889 37.238 1.00 0.00 -ATOM 83 BB HIS 21 33.539 37.342 38.323 1.00 0.00 -ATOM 84 SC1 HIS 21 34.794 36.404 36.113 1.00 0.00 -ATOM 85 SC2 HIS 21 34.599 36.670 33.722 1.00 0.00 -ATOM 86 SC3 HIS 21 34.246 34.971 34.408 1.00 0.00 -ATOM 87 CA HIS 21 33.539 37.342 38.323 1.00 0.00 -ATOM 88 BB ARG 22 34.938 35.578 40.813 1.00 0.00 -ATOM 89 SC1 ARG 22 32.092 35.151 41.906 1.00 0.00 -ATOM 90 SC2 ARG 22 28.506 35.957 40.550 1.00 0.00 -ATOM 91 CA ARG 22 34.938 35.578 40.813 1.00 0.00 -ATOM 92 BB GLY 23 37.369 37.232 41.772 1.00 0.00 -ATOM 93 CA GLY 23 37.369 37.232 41.772 1.00 0.00 -ATOM 94 BB TYR 24 40.575 38.666 40.667 1.00 0.00 -ATOM 95 SC1 TYR 24 40.604 41.269 41.653 1.00 0.00 -ATOM 96 SC2 TYR 24 40.309 42.960 39.801 1.00 0.00 -ATOM 97 SC3 TYR 24 41.442 43.599 41.985 1.00 0.00 -ATOM 98 SC4 TYR 24 41.220 45.317 40.049 1.00 0.00 -ATOM 99 CA TYR 24 40.575 38.666 40.667 1.00 0.00 +ATOM 1 BB ASP 1 51.396 25.818 46.802 1.00 0.00 +ATOM 2 SC1 ASP 1 53.604 28.123 47.334 1.00 0.00 +ATOM 3 CA ASP 1 51.396 25.818 46.802 1.00 0.00 +ATOM 4 BB SER 2 47.819 26.759 47.762 1.00 0.00 +ATOM 5 SC1 SER 2 47.611 24.100 47.820 1.00 0.00 +ATOM 6 CA SER 2 47.819 26.759 47.762 1.00 0.00 +ATOM 7 BB HIS 3 48.614 29.420 49.220 1.00 0.00 +ATOM 8 SC1 HIS 3 46.454 28.529 50.783 1.00 0.00 +ATOM 9 SC2 HIS 3 44.587 26.928 50.901 1.00 0.00 +ATOM 10 SC3 HIS 3 46.291 26.213 51.317 1.00 0.00 +ATOM 11 CA HIS 3 48.614 29.420 49.220 1.00 0.00 +ATOM 12 BB ALA 4 48.291 33.050 49.571 1.00 0.00 +ATOM 13 SC1 ALA 4 50.214 32.984 48.343 1.00 0.00 +ATOM 14 CA ALA 4 48.291 33.050 49.571 1.00 0.00 +ATOM 15 BB LYS 5 48.324 36.494 51.046 1.00 0.00 +ATOM 16 SC1 LYS 5 49.794 36.274 53.690 1.00 0.00 +ATOM 17 SC2 LYS 5 51.827 36.685 56.075 1.00 0.00 +ATOM 18 CA LYS 5 48.324 36.494 51.046 1.00 0.00 +ATOM 19 BB ARG 6 48.796 37.672 48.646 1.00 0.00 +ATOM 20 SC1 ARG 6 52.144 38.851 48.900 1.00 0.00 +ATOM 21 SC2 ARG 6 55.436 38.203 47.910 1.00 0.00 +ATOM 22 CA ARG 6 48.796 37.672 48.646 1.00 0.00 +ATOM 23 BB HIS 7 47.357 39.686 45.649 1.00 0.00 +ATOM 24 SC1 HIS 7 45.874 40.804 47.328 1.00 0.00 +ATOM 25 SC2 HIS 7 44.240 40.977 49.126 1.00 0.00 +ATOM 26 SC3 HIS 7 45.973 41.084 49.689 1.00 0.00 +ATOM 27 CA HIS 7 47.357 39.686 45.649 1.00 0.00 +ATOM 28 BB HIS 8 48.832 38.121 43.409 1.00 0.00 +ATOM 29 SC1 HIS 8 51.039 39.429 43.608 1.00 0.00 +ATOM 30 SC2 HIS 8 52.655 40.548 45.072 1.00 0.00 +ATOM 31 SC3 HIS 8 51.656 41.617 43.892 1.00 0.00 +ATOM 32 CA HIS 8 48.832 38.121 43.409 1.00 0.00 +ATOM 33 BB GLY 9 46.667 37.663 40.263 1.00 0.00 +ATOM 34 CA GLY 9 46.667 37.663 40.263 1.00 0.00 +ATOM 35 BB TYR 10 44.378 39.639 41.126 1.00 0.00 +ATOM 36 SC1 TYR 10 43.524 37.734 42.743 1.00 0.00 +ATOM 37 SC2 TYR 10 45.004 36.493 44.400 1.00 0.00 +ATOM 38 SC3 TYR 10 43.704 35.245 42.661 1.00 0.00 +ATOM 39 SC4 TYR 10 45.202 33.915 44.249 1.00 0.00 +ATOM 40 CA TYR 10 44.378 39.639 41.126 1.00 0.00 +ATOM 41 BB LYS 11 42.597 41.909 39.147 1.00 0.00 +ATOM 42 SC1 LYS 11 40.804 42.674 41.693 1.00 0.00 +ATOM 43 SC2 LYS 11 38.391 43.469 43.698 1.00 0.00 +ATOM 44 CA LYS 11 42.597 41.909 39.147 1.00 0.00 +ATOM 45 BB ARG 12 43.974 42.129 36.009 1.00 0.00 +ATOM 46 SC1 ARG 12 46.464 41.297 37.500 1.00 0.00 +ATOM 47 SC2 ARG 12 48.901 42.948 36.475 1.00 0.00 +ATOM 48 CA ARG 12 43.974 42.129 36.009 1.00 0.00 +ATOM 49 BB LYS 13 41.530 42.801 34.539 1.00 0.00 +ATOM 50 SC1 LYS 13 40.364 39.677 33.530 1.00 0.00 +ATOM 51 SC2 LYS 13 39.333 36.588 33.068 1.00 0.00 +ATOM 52 CA LYS 13 41.530 42.801 34.539 1.00 0.00 +ATOM 53 BB PHE 14 39.614 45.182 32.015 1.00 0.00 +ATOM 54 SC1 PHE 14 42.274 45.354 30.975 1.00 0.00 +ATOM 55 SC2 PHE 14 44.618 46.260 31.553 1.00 0.00 +ATOM 56 SC3 PHE 14 44.629 44.365 31.070 1.00 0.00 +ATOM 57 CA PHE 14 39.614 45.182 32.015 1.00 0.00 +ATOM 58 BB HIS 15 36.967 43.773 32.799 1.00 0.00 +ATOM 59 SC1 HIS 15 36.939 43.654 29.968 1.00 0.00 +ATOM 60 SC2 HIS 15 37.946 44.302 27.829 1.00 0.00 +ATOM 61 SC3 HIS 15 38.658 42.813 28.653 1.00 0.00 +ATOM 62 CA HIS 15 36.967 43.773 32.799 1.00 0.00 +ATOM 63 BB GLU 16 33.927 42.551 33.628 1.00 0.00 +ATOM 64 SC1 GLU 16 31.369 45.556 34.838 1.00 0.00 +ATOM 65 CA GLU 16 33.927 42.551 33.628 1.00 0.00 +ATOM 66 BB LYS 17 32.672 40.057 35.585 1.00 0.00 +ATOM 67 SC1 LYS 17 34.991 39.371 38.010 1.00 0.00 +ATOM 68 SC2 LYS 17 35.514 37.193 39.934 1.00 0.00 +ATOM 69 CA LYS 17 32.672 40.057 35.585 1.00 0.00 +ATOM 70 BB HIS 18 31.735 37.098 34.878 1.00 0.00 +ATOM 71 SC1 HIS 18 31.389 37.119 32.093 1.00 0.00 +ATOM 72 SC2 HIS 18 31.564 39.139 30.759 1.00 0.00 +ATOM 73 SC3 HIS 18 31.363 37.536 29.813 1.00 0.00 +ATOM 74 CA HIS 18 31.735 37.098 34.878 1.00 0.00 +ATOM 75 BB HIS 19 29.310 34.719 36.500 1.00 0.00 +ATOM 76 SC1 HIS 19 28.174 36.574 37.673 1.00 0.00 +ATOM 77 SC2 HIS 19 27.189 38.700 37.147 1.00 0.00 +ATOM 78 SC3 HIS 19 26.172 37.163 36.692 1.00 0.00 +ATOM 79 CA HIS 19 29.310 34.719 36.500 1.00 0.00 +ATOM 80 BB SER 20 29.061 32.049 34.708 1.00 0.00 +ATOM 81 SC1 SER 20 29.567 33.108 32.540 1.00 0.00 +ATOM 82 CA SER 20 29.061 32.049 34.708 1.00 0.00 +ATOM 83 BB HIS 21 31.834 31.502 35.793 1.00 0.00 +ATOM 84 SC1 HIS 21 33.089 30.564 33.583 1.00 0.00 +ATOM 85 SC2 HIS 21 32.894 30.830 31.192 1.00 0.00 +ATOM 86 SC3 HIS 21 32.541 29.131 31.878 1.00 0.00 +ATOM 87 CA HIS 21 31.834 31.502 35.793 1.00 0.00 +ATOM 88 BB ARG 22 33.233 29.738 38.283 1.00 0.00 +ATOM 89 SC1 ARG 22 30.387 29.311 39.376 1.00 0.00 +ATOM 90 SC2 ARG 22 26.801 30.117 38.020 1.00 0.00 +ATOM 91 CA ARG 22 33.233 29.738 38.283 1.00 0.00 +ATOM 92 BB GLY 23 35.664 31.392 39.242 1.00 0.00 +ATOM 93 CA GLY 23 35.664 31.392 39.242 1.00 0.00 +ATOM 94 BB TYR 24 38.870 32.826 38.137 1.00 0.00 +ATOM 95 SC1 TYR 24 38.899 35.429 39.123 1.00 0.00 +ATOM 96 SC2 TYR 24 38.604 37.120 37.271 1.00 0.00 +ATOM 97 SC3 TYR 24 39.737 37.759 39.455 1.00 0.00 +ATOM 98 SC4 TYR 24 39.515 39.477 37.519 1.00 0.00 +ATOM 99 CA TYR 24 38.870 32.826 38.137 1.00 0.00 TER 100 TYR 24 CONECT 1 2 4 CONECT 4 5 7 diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command index 17d8e42b1..32471a0ce 100644 --- a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command @@ -6,4 +6,5 @@ martinize2 -ss C -water-bias -water-bias-eps idr:0.5 --id-regions 1:24 \ No newline at end of file +-id-regions 1:24 +-idr-tune \ No newline at end of file diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp index 74f239c42..8a6f141a0 100644 --- a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp @@ -1,6 +1,6 @@ ; This file was generated using the following command: -; /coarse/chris/python_packages/vermouth_dev/vermouth-martinize/venv/bin/martinize2 -f ../aa.pdb -ff martini3001 -o topol.top -x cg.pdb -ss C -water-bias -water-bias-eps idr:0.5 -id-regions 1:24 -; martinize with vermouth 0.0.1.dev1728 +; /coarse/chris/python_packages/vermouth_dev/vermouth-martinize/venv/bin/martinize2 -f aa.pdb -ff martini3001 -x cg.pdb -o topol.top -ss C -water-bias -water-bias-eps idr:0.5 -id-regions 1:24 -idr-tune +; martinize with vermouth 0.0.1.dev1730 ; The following sequence of secondary structure ; was used for the full system: ; CCCCCCCCCCCCCCCCCCCCCCCC @@ -300,32 +300,6 @@ molecule_0 1 83 88 92 10 127 20 88 92 94 10 127 20 -; BBS angles regular martini - 1 4 5 2 100 25 - 4 7 8 2 100 25 - 7 12 13 2 100 25 -12 15 16 2 100 25 -15 19 20 2 100 25 -19 23 24 2 100 25 -23 28 29 2 100 25 -33 35 36 2 100 25 -35 41 42 2 100 25 -41 45 46 2 100 25 -45 49 50 2 100 25 -49 53 54 2 100 25 -53 58 59 2 100 25 -58 63 64 2 100 25 -63 66 67 2 100 25 -66 70 71 2 100 25 -70 75 76 2 100 25 -75 80 81 2 100 25 -80 83 84 2 100 25 -83 88 89 2 100 25 -92 94 95 2 100 25 - -; First SBB regular martini - 2 1 4 2 100 25 - ; Side chain angles 7 8 9 2 120.000 50.0 7 8 10 2 120.000 50.0 @@ -355,6 +329,137 @@ molecule_0 1 94 95 96 2 120.000 60.0 94 95 97 2 120.000 60.0 +; idp-fix + 1 4 5 10 85 10 ; BB-BB-SC1-v1 + 4 7 8 10 85 10 ; BB-BB-SC1-v1 + 7 12 13 10 85 10 ; BB-BB-SC1-v1 +12 15 16 10 85 10 ; BB-BB-SC1-v1 +15 19 20 10 85 10 ; BB-BB-SC1-v1 +19 23 24 10 85 10 ; BB-BB-SC1-v1 +23 28 29 10 85 10 ; BB-BB-SC1-v1 +33 35 36 10 85 10 ; BB(GLY)-BB-SC1-v1 +35 41 42 10 85 10 ; BB-BB-SC1-v1 +41 45 46 10 85 10 ; BB-BB-SC1-v1 +45 49 50 10 85 10 ; BB-BB-SC1-v1 +49 53 54 10 85 10 ; BB-BB-SC1-v1 +53 58 59 10 85 10 ; BB-BB-SC1-v1 +58 63 64 10 85 10 ; BB-BB-SC1-v1 +63 66 67 10 85 10 ; BB-BB-SC1-v1 +66 70 71 10 85 10 ; BB-BB-SC1-v1 +70 75 76 10 85 10 ; BB-BB-SC1-v1 +75 80 81 10 85 10 ; BB-BB-SC1-v1 +80 83 84 10 85 10 ; BB-BB-SC1-v1 +83 88 89 10 85 10 ; BB-BB-SC1-v1 +92 94 95 10 85 10 ; BB(GLY)-BB-SC1-v1 + 2 1 4 10 85 10 ; SC1-BB-BB-v1 + 5 4 7 10 85 10 ; SC1-BB-BB-v1 + 8 7 12 10 85 10 ; SC1-BB-BB-v1 +13 12 15 10 85 10 ; SC1-BB-BB-v1 +16 15 19 10 85 10 ; SC1-BB-BB-v1 +20 19 23 10 85 10 ; SC1-BB-BB-v1 +24 23 28 10 85 10 ; SC1-BB-BB-v1 +36 35 41 10 85 10 ; SC1-BB-BB-v1 +42 41 45 10 85 10 ; SC1-BB-BB-v1 +46 45 49 10 85 10 ; SC1-BB-BB-v1 +50 49 53 10 85 10 ; SC1-BB-BB-v1 +54 53 58 10 85 10 ; SC1-BB-BB-v1 +59 58 63 10 85 10 ; SC1-BB-BB-v1 +64 63 66 10 85 10 ; SC1-BB-BB-v1 +67 66 70 10 85 10 ; SC1-BB-BB-v1 +71 70 75 10 85 10 ; SC1-BB-BB-v1 +76 75 80 10 85 10 ; SC1-BB-BB-v1 +81 80 83 10 85 10 ; SC1-BB-BB-v1 +84 83 88 10 85 10 ; SC1-BB-BB-v1 +29 28 33 10 85 10 ; SC1-BB-BB(GLY)-v1 +89 88 92 10 85 10 ; SC1-BB-BB(GLY)-v1 + +[ dihedrals ] +; idp-fix + 1 4 7 12 9 -120 -1 1 ; BB-BB-BB-BB-v1 + 1 4 7 12 9 -120 -1 2 ; BB-BB-BB-BB-v2 + 4 7 12 15 9 -120 -1 1 ; BB-BB-BB-BB-v1 + 4 7 12 15 9 -120 -1 2 ; BB-BB-BB-BB-v2 + 7 12 15 19 9 -120 -1 1 ; BB-BB-BB-BB-v1 + 7 12 15 19 9 -120 -1 2 ; BB-BB-BB-BB-v2 +12 15 19 23 9 -120 -1 1 ; BB-BB-BB-BB-v1 +12 15 19 23 9 -120 -1 2 ; BB-BB-BB-BB-v2 +15 19 23 28 9 -120 -1 1 ; BB-BB-BB-BB-v1 +15 19 23 28 9 -120 -1 2 ; BB-BB-BB-BB-v2 +19 23 28 33 9 -120 -1 1 ; BB-BB-BB-BB-v1 +19 23 28 33 9 -120 -1 2 ; BB-BB-BB-BB-v2 +23 28 33 35 9 -120 -1 1 ; BB-BB-BB-BB-v1 +23 28 33 35 9 -120 -1 2 ; BB-BB-BB-BB-v2 +28 33 35 41 9 -120 -1 1 ; BB-BB-BB-BB-v1 +28 33 35 41 9 -120 -1 2 ; BB-BB-BB-BB-v2 +33 35 41 45 9 -120 -1 1 ; BB-BB-BB-BB-v1 +33 35 41 45 9 -120 -1 2 ; BB-BB-BB-BB-v2 +35 41 45 49 9 -120 -1 1 ; BB-BB-BB-BB-v1 +35 41 45 49 9 -120 -1 2 ; BB-BB-BB-BB-v2 +41 45 49 53 9 -120 -1 1 ; BB-BB-BB-BB-v1 +41 45 49 53 9 -120 -1 2 ; BB-BB-BB-BB-v2 +45 49 53 58 9 -120 -1 1 ; BB-BB-BB-BB-v1 +45 49 53 58 9 -120 -1 2 ; BB-BB-BB-BB-v2 +49 53 58 63 9 -120 -1 1 ; BB-BB-BB-BB-v1 +49 53 58 63 9 -120 -1 2 ; BB-BB-BB-BB-v2 +53 58 63 66 9 -120 -1 1 ; BB-BB-BB-BB-v1 +53 58 63 66 9 -120 -1 2 ; BB-BB-BB-BB-v2 +58 63 66 70 9 -120 -1 1 ; BB-BB-BB-BB-v1 +58 63 66 70 9 -120 -1 2 ; BB-BB-BB-BB-v2 +63 66 70 75 9 -120 -1 1 ; BB-BB-BB-BB-v1 +63 66 70 75 9 -120 -1 2 ; BB-BB-BB-BB-v2 +66 70 75 80 9 -120 -1 1 ; BB-BB-BB-BB-v1 +66 70 75 80 9 -120 -1 2 ; BB-BB-BB-BB-v2 +70 75 80 83 9 -120 -1 1 ; BB-BB-BB-BB-v1 +70 75 80 83 9 -120 -1 2 ; BB-BB-BB-BB-v2 +75 80 83 88 9 -120 -1 1 ; BB-BB-BB-BB-v1 +75 80 83 88 9 -120 -1 2 ; BB-BB-BB-BB-v2 +80 83 88 92 9 -120 -1 1 ; BB-BB-BB-BB-v1 +80 83 88 92 9 -120 -1 2 ; BB-BB-BB-BB-v2 +83 88 92 94 9 -120 -1 1 ; BB-BB-BB-BB-v1 +83 88 92 94 9 -120 -1 2 ; BB-BB-BB-BB-v2 + 2 1 4 5 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 + 2 1 4 5 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 + 5 4 7 8 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 + 5 4 7 8 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 + 8 7 12 13 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 + 8 7 12 13 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +13 12 15 16 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +13 12 15 16 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +16 15 19 20 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +16 15 19 20 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +20 19 23 24 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +20 19 23 24 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +24 23 28 29 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +24 23 28 29 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +36 35 41 42 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +36 35 41 42 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +42 41 45 46 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +42 41 45 46 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +46 45 49 50 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +46 45 49 50 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +50 49 53 54 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +50 49 53 54 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +54 53 58 59 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +54 53 58 59 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +59 58 63 64 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +59 58 63 64 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +64 63 66 67 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +64 63 66 67 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +67 66 70 71 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +67 66 70 71 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +71 70 75 76 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +71 70 75 76 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +76 75 80 81 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +76 75 80 81 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +81 80 83 84 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +81 80 83 84 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +84 83 88 89 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +84 83 88 89 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +29 28 33 35 1 115 -4.5 1 ; SC1-BB-BB(GLY)-BB-v1 +28 33 35 36 1 0 -2.0 1 ; BB-BB(GLY)-BB-SC1-v1 +89 88 92 94 1 115 -4.5 1 ; SC1-BB-BB(GLY)-BB-v1 +88 92 94 95 1 0 -2.0 1 ; BB-BB(GLY)-BB-SC1-v1 + [ exclusions ] 7 8 9 10 8 9 10 diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp index 104a9ff9d..cb8f07095 100644 --- a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/virtual_sites_nonbond_params.itp @@ -1,25 +1,25 @@ [ nonbond_params ] -W molecule_0_1 1 0.47000000 0.50000000 ;water bias C -W molecule_0_2 1 0.47000000 0.50000000 ;water bias C -W molecule_0_3 1 0.47000000 0.50000000 ;water bias C -W molecule_0_4 1 0.41000000 0.50000000 ;water bias C -W molecule_0_5 1 0.47000000 0.50000000 ;water bias C -W molecule_0_6 1 0.47000000 0.50000000 ;water bias C -W molecule_0_7 1 0.47000000 0.50000000 ;water bias C -W molecule_0_8 1 0.47000000 0.50000000 ;water bias C -W molecule_0_9 1 0.41000000 0.50000000 ;water bias C -W molecule_0_10 1 0.47000000 0.50000000 ;water bias C -W molecule_0_11 1 0.47000000 0.50000000 ;water bias C -W molecule_0_12 1 0.47000000 0.50000000 ;water bias C -W molecule_0_13 1 0.47000000 0.50000000 ;water bias C -W molecule_0_14 1 0.47000000 0.50000000 ;water bias C -W molecule_0_15 1 0.47000000 0.50000000 ;water bias C -W molecule_0_16 1 0.47000000 0.50000000 ;water bias C -W molecule_0_17 1 0.47000000 0.50000000 ;water bias C -W molecule_0_18 1 0.47000000 0.50000000 ;water bias C -W molecule_0_19 1 0.47000000 0.50000000 ;water bias C -W molecule_0_20 1 0.47000000 0.50000000 ;water bias C -W molecule_0_21 1 0.47000000 0.50000000 ;water bias C -W molecule_0_22 1 0.47000000 0.50000000 ;water bias C -W molecule_0_23 1 0.41000000 0.50000000 ;water bias C -W molecule_0_24 1 0.47000000 0.50000000 ;water bias C +W molecule_0_1 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_2 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_3 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_4 1 0.41000000 0.50000000 ;water bias idr +W molecule_0_5 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_6 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_7 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_8 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_9 1 0.41000000 0.50000000 ;water bias idr +W molecule_0_10 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_11 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_12 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_13 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_14 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_15 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_16 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_17 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_18 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_19 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_20 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_21 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_22 1 0.47000000 0.50000000 ;water bias idr +W molecule_0_23 1 0.41000000 0.50000000 ;water bias idr +W molecule_0_24 1 0.47000000 0.50000000 ;water bias idr diff --git a/vermouth/tests/integration_tests/test_integration.py b/vermouth/tests/integration_tests/test_integration.py index 2d73a0b3b..bab370d5c 100644 --- a/vermouth/tests/integration_tests/test_integration.py +++ b/vermouth/tests/integration_tests/test_integration.py @@ -171,6 +171,7 @@ def _interaction_equal(interaction1, interaction2): ['tier-1', '1mj5-charmm'], ['tier-1', 'EN_chain'], ['tier-1', 'EN_region'], + ['tier-1', 'hst5'] # ['tier-2', 'barnase_barstar'], # ['tier-2', 'dna'], # ['tier-2', 'gpa_dimer'], From 633c407e91e6d130fc0ccef039e173da28e70794 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 2 May 2024 13:14:00 +0200 Subject: [PATCH 07/20] Changed approach for adding extra IDR potentials - processors/tune_idp_bonds.py now annotates residues which are disordered so that they can have their links added afterwards. Uses existing function from dssp for this purpose. - martinize2 edited to reflect new pipeline - removed now not needed function from rcsu/go_utils.py - addressed other comments --- bin/martinize2 | 15 +- vermouth/dssp/__init__.py | 1 + vermouth/processors/tune_idp_bonds.py | 230 ++++---------------------- vermouth/rcsu/go_utils.py | 22 --- 4 files changed, 37 insertions(+), 231 deletions(-) diff --git a/bin/martinize2 b/bin/martinize2 index c64a0d0e7..7bccce0c3 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -929,6 +929,8 @@ def entry(): ) vermouth.SetMoleculeMeta(scfix=args.scfix).run_system(system) + vermouth.SetMoleculeMeta(idr=args.idr_tune).run_system(system) + ss_sequence = list( itertools.chain( *( @@ -1067,13 +1069,12 @@ def entry(): # apply idr specific bonded potentials if required if args.idr_tune: - if args.to_ff == 'martini3001': - vermouth.processors.IDRBonds([(int(start), int(stop)) for start, stop in args.water_idrs] - ).run_system(system) - else: - raise argparse.ArgumentError(idr_tuning, - message=("You are trying to apply IDR biasing to a force field which " - "isn't martini3001, which this is not designed for.")) + vermouth.IDRBonds(idr_regions = [(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) + vermouth.DoLinks().run_system(system) + if not target_ff.has_feature("idr"): + LOGGER.warning('Improved IDR potentials are not implemented ' + 'for this force field', + type="missing-feature") # Here we need to add the resids from the PDB back if that is needed if args.resid_handling == "input": diff --git a/vermouth/dssp/__init__.py b/vermouth/dssp/__init__.py index 8402e16c7..50fdff102 100644 --- a/vermouth/dssp/__init__.py +++ b/vermouth/dssp/__init__.py @@ -11,3 +11,4 @@ # 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. +from .dssp import annotate_residues_from_sequence \ No newline at end of file diff --git a/vermouth/processors/tune_idp_bonds.py b/vermouth/processors/tune_idp_bonds.py index ccc663504..e7ddec96a 100644 --- a/vermouth/processors/tune_idp_bonds.py +++ b/vermouth/processors/tune_idp_bonds.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2018 University of Groningen +# Copyright 2024 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. @@ -21,14 +21,34 @@ from .processor import Processor from ..graph_utils import make_residue_graph -from ..rcsu.go_utils import get_go_type_from_attributes, _get_resid_region, _in_resid_region +from ..rcsu.go_utils import get_go_type_from_attributes, _in_resid_region import numpy as np -from vermouth import selectors +from ..selectors import select_backbone from ..log_helpers import StyleAdapter, get_logger - +from ..dssp import annotate_residues_from_sequence LOGGER = StyleAdapter(get_logger(__name__)) +def make_disorder_string(molecule, idr_regions): + """ + make a string for annotating order and disorder along a molecule + """ + + order_disorder_seq = [] + + for key, node in molecule.nodes.items(): + if select_backbone(node): + _old_resid = node['_old_resid'] + if _in_resid_region(_old_resid, idr_regions): + order_disorder_seq.append("D") # D for disordered + else: + order_disorder_seq.append("F") # F for folded + + order_disorder = ''.join(order_disorder_seq) + + return order_disorder + + class IDRBonds(Processor): """ Processor which adds additional bonded potentials, and removes @@ -76,204 +96,10 @@ def remove_cross_nb_interactions(self, molecule, res_graph): all_cross_pairs = np.unique([x for xs in all_cross_pairs for x in xs]) # delete the folded-disordered Go interactions from the list going backwards. # otherwise list order gets messed up. - for i in all_cross_pairs[::-1]: + for i in reversed(all_cross_pairs): del self.system.gmx_topology_params["nonbond_params"][i] - def get_idr_keys(self, molecule): - """ - get the keys of BB and SC1 beads in IDR regions - """ - - BB = [] - SC1 = [] - - for key, node in molecule.nodes.items(): - _old_resid = node['_old_resid'] - if _in_resid_region(_old_resid, self.idr_regions): - region = _get_resid_region(_old_resid, self.idr_regions) - if selectors.select_backbone(node): - BB.append(np.array([region, key])) - #if the residue is a GLY and doesn't have a sidechain we need to note it - if node.get('resname') == 'GLY': - SC1.append(np.array([region, np.nan])) - if node.get('atomname') == 'SC1': - SC1.append(np.array([region, key])) - return BB, SC1 - - def add_idr_angles(self, molecule, BB, SC1): - """ - add idr specific angles to the idr region - """ - #find how many disordered regions we've been given - regions = list(set([i[0] for i in BB])) - - # BB-BB-SC1 angles - for region in regions: - BB_keys = [i[1] for i in BB if i[0] == region] - SC_keys = [i[1] for i in SC1 if i[0] == region] - - window = 2 - for i in range(len(BB_keys) - window + 1): - BB_atoms = BB_keys[i: i + window] - SC_atoms = SC_keys[i: i + window] - #ie. if we don't have any residues without sidechains - if all(~np.isnan(np.array(SC_atoms))): - bbs_atomlist = [BB_atoms[0], BB_atoms[1], SC_atoms[1]] - sbb_atomlist = [SC_atoms[0], BB_atoms[0], BB_atoms[1]] - - molecule.add_or_replace_interaction('angles', - atoms=bbs_atomlist, - parameters=['10', '85', '10'], - meta={"group": "idp-fix", "comment": "BB-BB-SC1-v1", - "version": 1} - ) - - molecule.add_or_replace_interaction('angles', - atoms=sbb_atomlist, - parameters=['10', '85', '10'], - meta={"group": "idp-fix", "comment": "SC1-BB-BB-v1", - "version": 1} - ) - #SC1-BB-BB(GLY)-BB and BB-BB(GLY)-BB-SC1 dihedrals - for region in regions: - BB_keys = [i[1] for i in BB if i[0] == region] - SC_keys = [i[1] for i in SC1 if i[0] == region] - - inds = np.where(np.isnan(SC_keys) == True)[0] - - for i in inds: - sbb_atomlist = [SC_keys[i-1], - BB_keys[i-1], - BB_keys[i]] - - bbs_atomlist = [BB_keys[i], - BB_keys[i+1], - SC_keys[i+1]] - try: - molecule.remove_interaction('angles', - atoms=sbb_atomlist) - except KeyError: - pass - try: - molecule.remove_interaction('angles', - atoms=bbs_atomlist) - except KeyError: - pass - molecule.add_or_replace_interaction('angles', - atoms=bbs_atomlist, - parameters=['10', '85', '10', ], - meta={"group": "idp-fix", "comment": "BB(GLY)-BB-SC1-v1", - "version": 1} - ) - - molecule.add_or_replace_interaction('angles', - atoms=sbb_atomlist, - parameters=['10', '85', '10', ], - meta={"group": "idp-fix", "comment": "SC1-BB-BB(GLY)-v1", - "version": 1} - ) - - def add_idr_dih(self, molecule, BB, SC1): - """ - add idr specific dihedrals to the idr region - """ - - #find how many disordered regions we've been given - regions = list(set([i[0] for i in BB])) - - # BB-BB-BB-BB dihedrals - #make sure we're only applying interactions within regions - for region in regions: - keys = [i[1] for i in BB if i[0] == region] - window = 4 - for i in range(len(keys) - window + 1): - atoms = keys[i: i + window] - try: - molecule.remove_interaction('dihedrals', - atoms=atoms) - except KeyError: - pass - molecule.add_or_replace_interaction('dihedrals', - atoms = atoms, - parameters = ['9', '-120', '-1', '1'], - meta = {"group": "idp-fix", "comment": "BB-BB-BB-BB-v1", "version":1} - ) - molecule.add_or_replace_interaction('dihedrals', - atoms = atoms, - parameters = ['9', '-120', '-1', '2'], - meta={"group": "idp-fix", "comment": "BB-BB-BB-BB-v2", "version": 2} - ) - - # SC1-BB-BB-SC1 dihedrals - for region in regions: - BB_keys = [i[1] for i in BB if i[0] == region] - SC_keys = [i[1] for i in SC1 if i[0] == region] - - window = 2 - for i in range(len(BB_keys) - window + 1): - BB_atoms = BB_keys[i: i + window] - SC_atoms = SC_keys[i: i + window] - #ie. if we don't have any residues without sidechains - if all(~np.isnan(np.array(SC_atoms))): - atomlist = [SC_atoms[0], BB_atoms[0], BB_atoms[1], SC_atoms[1]] - try: - molecule.remove_interaction('dihedrals', - atoms=atomlist) - except KeyError: - pass - - molecule.add_or_replace_interaction('dihedrals', - atoms=atomlist, - parameters=['9', '-130', '-1.5', '1'], - meta={"group": "idp-fix", "comment": "SC1-BB-BB-SC1-v1", - "version": 1} - ) - molecule.add_or_replace_interaction('dihedrals', - atoms=atomlist, - parameters=['9', '100', '-1.5', '2'], - meta={"group": "idp-fix", "comment": "SC1-BB-BB-SC1-v2", - "version": 2} - ) - #SC1-BB-BB(GLY)-BB and BB-BB(GLY)-BB-SC1 dihedrals - for region in regions: - BB_keys = [i[1] for i in BB if i[0] == region] - SC_keys = [i[1] for i in SC1 if i[0] == region] - - inds = np.where(np.isnan(SC_keys) == True)[0] - - for i in inds: - sbbb_atomlist = [SC_keys[i-1], - BB_keys[i-1], - BB_keys[i], - BB_keys[i+1]] - - bbbs_atomlist = [BB_keys[i-1], - BB_keys[i], - BB_keys[i+1], - SC_keys[i+1]] - try: - molecule.remove_interaction('dihedrals', - atoms=sbbb_atomlist) - except KeyError: - pass - try: - molecule.remove_interaction('dihedrals', - atoms=bbbs_atomlist) - except KeyError: - pass - molecule.add_or_replace_interaction('dihedrals', - atoms=sbbb_atomlist, - parameters=['1', '115', '-4.5', '1'], - meta={"group": "idp-fix", "comment": "SC1-BB-BB(GLY)-BB-v1", - "version": 1} - ) - molecule.add_or_replace_interaction('dihedrals', - atoms=bbbs_atomlist, - parameters=['1', '0', '-2.0', '1'], - meta={"group": "idp-fix", "comment": "BB-BB(GLY)-BB-SC1-v1", - "version": 1} - ) def run_molecule(self, molecule): """ @@ -289,12 +115,12 @@ def run_molecule(self, molecule): res_graph = molecule.res_graph else: res_graph = make_residue_graph(molecule) + molecule.res_graph = res_graph self.remove_cross_nb_interactions(molecule, res_graph) - BB, SC1 = self.get_idr_keys(molecule) - self.add_idr_dih(molecule, BB, SC1) - self.add_idr_angles(molecule, BB, SC1) + order_disorder = make_disorder_string(molecule, self.idr_regions) + annotate_residues_from_sequence(molecule, "cgidr", order_disorder) return molecule diff --git a/vermouth/rcsu/go_utils.py b/vermouth/rcsu/go_utils.py index 160e0f18a..01646617a 100644 --- a/vermouth/rcsu/go_utils.py +++ b/vermouth/rcsu/go_utils.py @@ -71,28 +71,6 @@ def _in_resid_region(resid, regions): return True return False -def _get_resid_region(resid, regions): - """ - Check if resid falls in regions interval. - - Parameters - ---------- - resid: int - the resid of a molecule - regions: list[tuple(int, int)] - a list of the intervals - - Returns - ------- - bool - """ - for region_index, limits in enumerate(regions): - # perhaps someone gives them as reversed - low, up = sorted(limits) - if low <= resid <= up: - return region_index - return False - def _get_bead_size(atype): if atype.startswith("S"): bead_size = "small" From 4399d7e8911ccc5adc5217ddf0ff1400e827a034 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 2 May 2024 13:17:40 +0200 Subject: [PATCH 08/20] added IDR links to force field --- .../force_fields/martini3001/aminoacids.ff | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/vermouth/data/force_fields/martini3001/aminoacids.ff b/vermouth/data/force_fields/martini3001/aminoacids.ff index a6c3e9848..df032d3f4 100644 --- a/vermouth/data/force_fields/martini3001/aminoacids.ff +++ b/vermouth/data/force_fields/martini3001/aminoacids.ff @@ -962,6 +962,73 @@ scfix true [ angles ] BB +BB +SC1 10 100 15 {"group": "SC-BB-BB and BB-BB-SC scFix", "comment": "BB-BB-SC"} +;;; IDR specific links +[ link ] +resname $protein_resnames +cgidr "D" +[ features ] +idr +[ molmeta ] +idr true +[ angles ] +BB +BB +SC1 10 85 10 {"group": "idp-fix"} + +[ link ] +resname $protein_resnames +cgidr "D" +[ features ] +idr +[ molmeta ] +idr true +[ angles ] +-SC1 -BB BB 10 85 10 {"group": "idp-fix"} + +[ link ] +resname $protein_resnames +cgidr "D" +[ features ] +idr +[ molmeta ] +idr true +[ dihedrals ] +BB +BB ++BB +++BB 9 -120 -1 1 {"group": "idp-fix", "comment": "BB-BB-BB-BB-v1", "version":1} +BB +BB ++BB +++BB 9 -120 -1 2 {"group": "idp-fix", "comment": "BB-BB-BB-BB-v2", "version":2} + +[ link ] +resname $protein_resnames +cgidr "D" +[ features ] +idr +[ molmeta ] +idr true +[ dihedrals ] +SC1 BB +BB +SC1 9 -130 -1.5 1 {"group": "idp-fix", "version": 1, "comment": "SC1-BB-BB-SC1-v1"} +SC1 BB +BB +SC1 9 100 -1.5 2 {"group": "idp-fix", "version": 2, "comment": "SC1-BB-BB-SC1-v2"} + +[ link ] +resname $protein_resnames +cgidr "D" +[ features ] +idr +[ molmeta ] +idr true +[ dihedrals ] +-SC1 -BB BB +BB 1 115 -4.5 1 {"group": "idp-fix", "comment": "SC1-BB-BB(GLY)-BB"} +[ non-edges ] +BB SC1 + +[ link ] +resname $protein_resnames +cgidr "D" +[ features ] +idr +[ molmeta ] +idr true +[ dihedrals ] +-BB BB +BB +SC1 1 0 -2.0 1 {"group": "idp-fix", "comment": "BB-BB(GLY)-BB-SC1"} +[ non-edges ] +BB SC1 + [ link ] resname $protein_resnames [ angles ] From d629b7b1734bbcb6291516e8e73a8ec19d6a6f7f Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 2 May 2024 13:25:38 +0200 Subject: [PATCH 09/20] updated tests with new bonded potentials --- .../data/integration_tests/tier-1/hst5/README | 1 + .../tier-1/hst5/martinize2/command | 1 + .../tier-1/hst5/martinize2/molecule_0.itp | 135 +++++++++++++++++- 3 files changed, 135 insertions(+), 2 deletions(-) diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/README b/vermouth/tests/data/integration_tests/tier-1/hst5/README index 930cd9ff6..1f4c3a0d7 100644 --- a/vermouth/tests/data/integration_tests/tier-1/hst5/README +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/README @@ -6,3 +6,4 @@ # -ff martini 3001 # BB-W bias for idr +# add extra IDR potentials diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command index d2340e3ac..3425fb3de 100644 --- a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/command @@ -7,3 +7,4 @@ martinize2 -water-bias -water-bias-eps idr:0.5 -id-regions 1:24 +-idr-tune diff --git a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp index 1c7b4bf95..c3abd1685 100644 --- a/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp +++ b/vermouth/tests/data/integration_tests/tier-1/hst5/martinize2/molecule_0.itp @@ -1,6 +1,6 @@ ; This file was generated using the following command: -; /coarse/chris/python_packages/vermouth_dev/vermouth-martinize/venv/bin/martinize2 -f aa.pdb -ff martini3001 -x cg.pdb -o topol.top -ss C -water-bias -water-bias-eps idr:0.5 -id-regions 1:24 -; martinize with vermouth 0.0.1.dev1730 +; /coarse/chris/python_packages/vermouth_dev/vermouth-martinize/venv/bin/martinize2 -f aa.pdb -ff martini3001 -x cg.pdb -o topol.top -ss C -water-bias -water-bias-eps idr:0.5 -id-regions 1:24 -idr-tune +; martinize with vermouth 0.0.1.dev1747 ; The following sequence of secondary structure ; was used for the full system: ; CCCCCCCCCCCCCCCCCCCCCCCC @@ -355,6 +355,137 @@ molecule_0 1 94 95 96 2 120.000 60.0 94 95 97 2 120.000 60.0 +; idp-fix + 1 4 5 10 85 10 + 4 7 8 10 85 10 + 7 12 13 10 85 10 +12 15 16 10 85 10 +15 19 20 10 85 10 +19 23 24 10 85 10 +23 28 29 10 85 10 +33 35 36 10 85 10 +35 41 42 10 85 10 +41 45 46 10 85 10 +45 49 50 10 85 10 +49 53 54 10 85 10 +53 58 59 10 85 10 +58 63 64 10 85 10 +63 66 67 10 85 10 +66 70 71 10 85 10 +70 75 76 10 85 10 +75 80 81 10 85 10 +80 83 84 10 85 10 +83 88 89 10 85 10 +92 94 95 10 85 10 + 2 1 4 10 85 10 + 5 4 7 10 85 10 + 8 7 12 10 85 10 +13 12 15 10 85 10 +16 15 19 10 85 10 +20 19 23 10 85 10 +24 23 28 10 85 10 +29 28 33 10 85 10 +36 35 41 10 85 10 +42 41 45 10 85 10 +46 45 49 10 85 10 +50 49 53 10 85 10 +54 53 58 10 85 10 +59 58 63 10 85 10 +64 63 66 10 85 10 +67 66 70 10 85 10 +71 70 75 10 85 10 +76 75 80 10 85 10 +81 80 83 10 85 10 +84 83 88 10 85 10 +89 88 92 10 85 10 + +[ dihedrals ] +; idp-fix + 1 4 7 12 9 -120 -1 1 ; BB-BB-BB-BB-v1 + 1 4 7 12 9 -120 -1 2 ; BB-BB-BB-BB-v2 + 4 7 12 15 9 -120 -1 1 ; BB-BB-BB-BB-v1 + 4 7 12 15 9 -120 -1 2 ; BB-BB-BB-BB-v2 + 7 12 15 19 9 -120 -1 1 ; BB-BB-BB-BB-v1 + 7 12 15 19 9 -120 -1 2 ; BB-BB-BB-BB-v2 +12 15 19 23 9 -120 -1 1 ; BB-BB-BB-BB-v1 +12 15 19 23 9 -120 -1 2 ; BB-BB-BB-BB-v2 +15 19 23 28 9 -120 -1 1 ; BB-BB-BB-BB-v1 +15 19 23 28 9 -120 -1 2 ; BB-BB-BB-BB-v2 +19 23 28 33 9 -120 -1 1 ; BB-BB-BB-BB-v1 +19 23 28 33 9 -120 -1 2 ; BB-BB-BB-BB-v2 +23 28 33 35 9 -120 -1 1 ; BB-BB-BB-BB-v1 +23 28 33 35 9 -120 -1 2 ; BB-BB-BB-BB-v2 +28 33 35 41 9 -120 -1 1 ; BB-BB-BB-BB-v1 +28 33 35 41 9 -120 -1 2 ; BB-BB-BB-BB-v2 +33 35 41 45 9 -120 -1 1 ; BB-BB-BB-BB-v1 +33 35 41 45 9 -120 -1 2 ; BB-BB-BB-BB-v2 +35 41 45 49 9 -120 -1 1 ; BB-BB-BB-BB-v1 +35 41 45 49 9 -120 -1 2 ; BB-BB-BB-BB-v2 +41 45 49 53 9 -120 -1 1 ; BB-BB-BB-BB-v1 +41 45 49 53 9 -120 -1 2 ; BB-BB-BB-BB-v2 +45 49 53 58 9 -120 -1 1 ; BB-BB-BB-BB-v1 +45 49 53 58 9 -120 -1 2 ; BB-BB-BB-BB-v2 +49 53 58 63 9 -120 -1 1 ; BB-BB-BB-BB-v1 +49 53 58 63 9 -120 -1 2 ; BB-BB-BB-BB-v2 +53 58 63 66 9 -120 -1 1 ; BB-BB-BB-BB-v1 +53 58 63 66 9 -120 -1 2 ; BB-BB-BB-BB-v2 +58 63 66 70 9 -120 -1 1 ; BB-BB-BB-BB-v1 +58 63 66 70 9 -120 -1 2 ; BB-BB-BB-BB-v2 +63 66 70 75 9 -120 -1 1 ; BB-BB-BB-BB-v1 +63 66 70 75 9 -120 -1 2 ; BB-BB-BB-BB-v2 +66 70 75 80 9 -120 -1 1 ; BB-BB-BB-BB-v1 +66 70 75 80 9 -120 -1 2 ; BB-BB-BB-BB-v2 +70 75 80 83 9 -120 -1 1 ; BB-BB-BB-BB-v1 +70 75 80 83 9 -120 -1 2 ; BB-BB-BB-BB-v2 +75 80 83 88 9 -120 -1 1 ; BB-BB-BB-BB-v1 +75 80 83 88 9 -120 -1 2 ; BB-BB-BB-BB-v2 +80 83 88 92 9 -120 -1 1 ; BB-BB-BB-BB-v1 +80 83 88 92 9 -120 -1 2 ; BB-BB-BB-BB-v2 +83 88 92 94 9 -120 -1 1 ; BB-BB-BB-BB-v1 +83 88 92 94 9 -120 -1 2 ; BB-BB-BB-BB-v2 + 2 1 4 5 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 + 2 1 4 5 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 + 5 4 7 8 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 + 5 4 7 8 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 + 8 7 12 13 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 + 8 7 12 13 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +13 12 15 16 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +13 12 15 16 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +16 15 19 20 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +16 15 19 20 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +20 19 23 24 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +20 19 23 24 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +24 23 28 29 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +24 23 28 29 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +36 35 41 42 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +36 35 41 42 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +42 41 45 46 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +42 41 45 46 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +46 45 49 50 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +46 45 49 50 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +50 49 53 54 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +50 49 53 54 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +54 53 58 59 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +54 53 58 59 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +59 58 63 64 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +59 58 63 64 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +64 63 66 67 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +64 63 66 67 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +67 66 70 71 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +67 66 70 71 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +71 70 75 76 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +71 70 75 76 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +76 75 80 81 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +76 75 80 81 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +81 80 83 84 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +81 80 83 84 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +84 83 88 89 9 -130 -1.5 1 ; SC1-BB-BB-SC1-v1 +84 83 88 89 9 100 -1.5 2 ; SC1-BB-BB-SC1-v2 +29 28 33 35 1 115 -4.5 1 ; SC1-BB-BB(GLY)-BB +89 88 92 94 1 115 -4.5 1 ; SC1-BB-BB(GLY)-BB +28 33 35 36 1 0 -2.0 1 ; BB-BB(GLY)-BB-SC1 +88 92 94 95 1 0 -2.0 1 ; BB-BB(GLY)-BB-SC1 + [ exclusions ] 7 8 9 10 8 9 10 From 735accb35b482cde1dc43e8a73dfca4d83d61c9c Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Thu, 2 May 2024 13:42:49 +0200 Subject: [PATCH 10/20] improved error handling if no idp-tune --- bin/martinize2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/martinize2 b/bin/martinize2 index 7bccce0c3..555b11fe1 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -1069,12 +1069,13 @@ def entry(): # apply idr specific bonded potentials if required if args.idr_tune: - vermouth.IDRBonds(idr_regions = [(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) - vermouth.DoLinks().run_system(system) if not target_ff.has_feature("idr"): LOGGER.warning('Improved IDR potentials are not implemented ' 'for this force field', type="missing-feature") + else: + vermouth.IDRBonds(idr_regions = [(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) + vermouth.DoLinks().run_system(system) # Here we need to add the resids from the PDB back if that is needed if args.resid_handling == "input": From eb498c767f715e5c8e05b247976c7683252404a0 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Mon, 6 May 2024 17:06:47 +0200 Subject: [PATCH 11/20] Addressed comments and cleaned up. - changed processor function to annotate IDRs first before applying links in martinize. - moved cross go potential removal to water_bias.py - changed aminoacids.ff to reflect new naming - removed no longer needed import in dssp/__init__.py - changed name of import in processors/__init__.py --- bin/martinize2 | 32 ++-- .../force_fields/martini3001/aminoacids.ff | 12 +- vermouth/dssp/__init__.py | 1 - vermouth/processors/__init__.py | 2 +- vermouth/processors/annotate_idrs.py | 81 ++++++++++ vermouth/processors/tune_idp_bonds.py | 141 ------------------ vermouth/processors/water_bias.py | 37 +++++ 7 files changed, 146 insertions(+), 160 deletions(-) create mode 100644 vermouth/processors/annotate_idrs.py delete mode 100644 vermouth/processors/tune_idp_bonds.py diff --git a/bin/martinize2 b/bin/martinize2 index 555b11fe1..c247a19c0 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -170,7 +170,7 @@ def pdb_to_universal( return canonicalized -def martinize(system, mappings, to_ff, delete_unknown=False): +def martinize(system, mappings, to_ff, delete_unknown=False, idrs=False, disordered_regions = []): """ Convert a system from one force field to an other at lower resolution. """ @@ -185,6 +185,9 @@ def martinize(system, mappings, to_ff, delete_unknown=False): ).run_system(system) LOGGER.info("Averaging the coordinates.", type="step") vermouth.DoAverageBead(ignore_missing_graphs=True).run_system(system) + if idrs: + LOGGER.info("Annotating IDRs.", type="step") + vermouth.AnnotateIDRs(idr_regions=[(int(start), int(stop)) for start, stop in disordered_regions]).run_system(system) LOGGER.info("Applying the links.", type="step") vermouth.DoLinks().run_system(system) LOGGER.info("Placing the charge dummies.", type="step") @@ -930,6 +933,11 @@ def entry(): vermouth.SetMoleculeMeta(scfix=args.scfix).run_system(system) vermouth.SetMoleculeMeta(idr=args.idr_tune).run_system(system) + if args.idr_tune: + if not target_ff.has_feature("idr"): + LOGGER.warning('Improved IDR potentials are not implemented ' + 'for this force field', + type="missing-feature") ss_sequence = list( itertools.chain( @@ -952,6 +960,8 @@ def entry(): mappings=known_mappings, to_ff=known_force_fields[args.to_ff], delete_unknown=True, + idrs=args.idr_tune, + disordered_regions=args.water_idrs ) # Apply position restraints if required. @@ -1066,16 +1076,16 @@ def entry(): { s:float(eps) for s, eps in args.water_bias_eps}, [(int(start), int(stop)) for start, stop in args.water_idrs], ).run_system(system) - - # apply idr specific bonded potentials if required - if args.idr_tune: - if not target_ff.has_feature("idr"): - LOGGER.warning('Improved IDR potentials are not implemented ' - 'for this force field', - type="missing-feature") - else: - vermouth.IDRBonds(idr_regions = [(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) - vermouth.DoLinks().run_system(system) + # + # # apply idr specific bonded potentials if required + # if args.idr_tune: + # if not target_ff.has_feature("idr"): + # LOGGER.warning('Improved IDR potentials are not implemented ' + # 'for this force field', + # type="missing-feature") + # else: + # vermouth.IDRBonds(idr_regions=[(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) + # vermouth.DoLinks().run_system(system) # Here we need to add the resids from the PDB back if that is needed if args.resid_handling == "input": diff --git a/vermouth/data/force_fields/martini3001/aminoacids.ff b/vermouth/data/force_fields/martini3001/aminoacids.ff index df032d3f4..fac831b52 100644 --- a/vermouth/data/force_fields/martini3001/aminoacids.ff +++ b/vermouth/data/force_fields/martini3001/aminoacids.ff @@ -965,7 +965,7 @@ BB +BB +SC1 10 100 15 {"group": "SC-BB-BB and BB-BB-SC scFix", "comment": "BB-BB ;;; IDR specific links [ link ] resname $protein_resnames -cgidr "D" +cgidr true [ features ] idr [ molmeta ] @@ -975,7 +975,7 @@ BB +BB +SC1 10 85 10 {"group": "idp-fix"} [ link ] resname $protein_resnames -cgidr "D" +cgidr true [ features ] idr [ molmeta ] @@ -985,7 +985,7 @@ idr true [ link ] resname $protein_resnames -cgidr "D" +cgidr true [ features ] idr [ molmeta ] @@ -996,7 +996,7 @@ BB +BB ++BB +++BB 9 -120 -1 2 {"group": "idp-fix", "comment": "BB-BB-BB-BB-v2", [ link ] resname $protein_resnames -cgidr "D" +cgidr true [ features ] idr [ molmeta ] @@ -1007,7 +1007,7 @@ SC1 BB +BB +SC1 9 100 -1.5 2 {"group": "idp-fix", "version": 2, "comment": "SC1 [ link ] resname $protein_resnames -cgidr "D" +cgidr true [ features ] idr [ molmeta ] @@ -1019,7 +1019,7 @@ BB SC1 [ link ] resname $protein_resnames -cgidr "D" +cgidr true [ features ] idr [ molmeta ] diff --git a/vermouth/dssp/__init__.py b/vermouth/dssp/__init__.py index 50fdff102..8402e16c7 100644 --- a/vermouth/dssp/__init__.py +++ b/vermouth/dssp/__init__.py @@ -11,4 +11,3 @@ # 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. -from .dssp import annotate_residues_from_sequence \ No newline at end of file diff --git a/vermouth/processors/__init__.py b/vermouth/processors/__init__.py index a314521bc..f5a5d8aca 100644 --- a/vermouth/processors/__init__.py +++ b/vermouth/processors/__init__.py @@ -44,4 +44,4 @@ from .merge_all_molecules import MergeAllMolecules from .annotate_mut_mod import AnnotateMutMod from .water_bias import ComputeWaterBias -from .tune_idp_bonds import IDRBonds +from .annotate_idrs import AnnotateIDRs diff --git a/vermouth/processors/annotate_idrs.py b/vermouth/processors/annotate_idrs.py new file mode 100644 index 000000000..98486505b --- /dev/null +++ b/vermouth/processors/annotate_idrs.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 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. +""" +Provides processors that can add and remove IDR specific bonds +""" + +import functools + +from .processor import Processor +from ..graph_utils import make_residue_graph +from ..rcsu.go_utils import _in_resid_region +from ..log_helpers import StyleAdapter, get_logger +LOGGER = StyleAdapter(get_logger(__name__)) + + +def annotate_disorder(molecule, idr_regions): + """ + annotate the disordered regions of the molecule + """ + + for key, node in molecule.nodes.items(): + _old_resid = node['_old_resid'] + if _in_resid_region(_old_resid, idr_regions): + molecule.nodes[key]["cgidr"] = True + +class AnnotateIDRs(Processor): + """ + Processor to annotate intrinsically disordered regions of a molecule. + + This processor is designed primarily for the work described in the reference + M3_GO, but is generally applicable for such circumstances where extra + addition/removals are necessary. + + """ + + def __init__(self, idr_regions = None): + """ + Parameters + ---------- + idr_regions: + regions defining the IDRs + """ + self.idr_regions = idr_regions + + def run_molecule(self, molecule): + """ + Assign disordered regions for a single molecule + """ + + annotate_disorder(molecule, self.idr_regions) + + return molecule + + def run_system(self, system): + """ + Assign the water bias of the Go model to file. Biasing + is always molecule specific i.e. no two different + vermouth molecules can have the same bias. + + Parameters + ---------- + system: :class:`vermouth.system.System` + """ + if not self.idr_regions: + return system + self.system = system + LOGGER.info("Annotating disordered regions", type="step") + super().run_system(system) diff --git a/vermouth/processors/tune_idp_bonds.py b/vermouth/processors/tune_idp_bonds.py deleted file mode 100644 index e7ddec96a..000000000 --- a/vermouth/processors/tune_idp_bonds.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 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. -""" -Provides processors that can add and remove IDR specific bonds -""" - -import functools - -from .processor import Processor -from ..graph_utils import make_residue_graph -from ..rcsu.go_utils import get_go_type_from_attributes, _in_resid_region -import numpy as np -from ..selectors import select_backbone -from ..log_helpers import StyleAdapter, get_logger -from ..dssp import annotate_residues_from_sequence -LOGGER = StyleAdapter(get_logger(__name__)) - - -def make_disorder_string(molecule, idr_regions): - """ - make a string for annotating order and disorder along a molecule - """ - - order_disorder_seq = [] - - for key, node in molecule.nodes.items(): - if select_backbone(node): - _old_resid = node['_old_resid'] - if _in_resid_region(_old_resid, idr_regions): - order_disorder_seq.append("D") # D for disordered - else: - order_disorder_seq.append("F") # F for folded - - order_disorder = ''.join(order_disorder_seq) - - return order_disorder - - -class IDRBonds(Processor): - """ - Processor which adds additional bonded potentials, and removes - unnecessary present ones to IDR regions in the protein. - - This processor is designed for the work described in the reference - M3_GO, but is generally applicable for such circumstances where extra - addition/removals are necessary. - - """ - - def __init__(self, idr_regions = None): - """ - Parameters - ---------- - - idr_regions: - regions defining the IDRs - """ - self.idr_regions = idr_regions - - def remove_cross_nb_interactions(self, molecule, res_graph): - """ - Remove existing bonded interactions in idr region - """ - - #list of all the Go pairs in the molecule - all_go_pairs = np.array([list(i.atoms) for i in self.system.gmx_topology_params["nonbond_params"] if 'W' not in list(i.atoms)]) - # list to record which items we don't want. cross = go potential between folded and disordered domain. - all_cross_pairs = [] - - for res_node in res_graph.nodes: - resid = res_graph.nodes[res_node]['resid'] - _old_resid = res_graph.nodes[res_node]['_old_resid'] - chain = res_graph.nodes[res_node]['chain'] - - if _in_resid_region(_old_resid, self.idr_regions): - vs_go_node = next(get_go_type_from_attributes(res_graph.nodes[res_node]['graph'], - resid=resid, - chain=chain, - prefix=molecule.meta.get('moltype'))) - all_cross_pairs.append(np.where(all_go_pairs == vs_go_node)[0]) #just need the first one - - # make sure we only have one entry in case a site has more than one interaction - all_cross_pairs = np.unique([x for xs in all_cross_pairs for x in xs]) - # delete the folded-disordered Go interactions from the list going backwards. - # otherwise list order gets messed up. - for i in reversed(all_cross_pairs): - del self.system.gmx_topology_params["nonbond_params"][i] - - - - def run_molecule(self, molecule): - """ - Assign water bias for a single molecule - """ - if not self.system: - raise IOError('This processor requires a system.') - - if not molecule.meta.get('moltype'): - raise ValueError('The molecule does not have a moltype name.') - - if hasattr(molecule, 'res_graph'): - res_graph = molecule.res_graph - else: - res_graph = make_residue_graph(molecule) - molecule.res_graph = res_graph - - self.remove_cross_nb_interactions(molecule, res_graph) - - order_disorder = make_disorder_string(molecule, self.idr_regions) - annotate_residues_from_sequence(molecule, "cgidr", order_disorder) - - return molecule - - def run_system(self, system): - """ - Assign the water bias of the Go model to file. Biasing - is always molecule specific i.e. no two different - vermouth molecules can have the same bias. - - Parameters - ---------- - system: :class:`vermouth.system.System` - """ - if not self.idr_regions: - return system - self.system = system - LOGGER.info("Applying extra bonded potentials to IDRs", type="step") - super().run_system(system) diff --git a/vermouth/processors/water_bias.py b/vermouth/processors/water_bias.py index eb112f155..ff69e03f0 100644 --- a/vermouth/processors/water_bias.py +++ b/vermouth/processors/water_bias.py @@ -16,6 +16,7 @@ from ..graph_utils import make_residue_graph from ..rcsu.go_utils import get_go_type_from_attributes, _get_bead_size, _in_resid_region from ..gmx.topology import NonbondParam +import numpy as np class ComputeWaterBias(Processor): """ @@ -118,6 +119,41 @@ def assign_residue_water_bias(self, molecule, res_graph): meta={"comment": ["water bias", sec_struc]}) self.system.gmx_topology_params["nonbond_params"].append(water_bias) + def remove_cross_nb_interactions(self, molecule, res_graph): + """ + Remove Go bonds between folded and disordered regions of a molecule + + Parameters + ---------- + molecule: :class:`vermouth.molecule.Molecule` + the molecule + res_graph: :class:`vermouth.molecule.Molecule` + the residue graph of the molecule + """ + #list of all the Go pairs in the molecule + all_go_pairs = np.array([list(i.atoms) for i in self.system.gmx_topology_params["nonbond_params"] if 'W' not in list(i.atoms)]) + # list to record which items we don't want. cross = go potential between folded and disordered domain. + all_cross_pairs = [] + + for res_node in res_graph.nodes: + resid = res_graph.nodes[res_node]['resid'] + _old_resid = res_graph.nodes[res_node]['_old_resid'] + chain = res_graph.nodes[res_node]['chain'] + + if _in_resid_region(_old_resid, self.idr_regions): + vs_go_node = next(get_go_type_from_attributes(res_graph.nodes[res_node]['graph'], + resid=resid, + chain=chain, + prefix=molecule.meta.get('moltype'))) + all_cross_pairs.append(np.where(all_go_pairs == vs_go_node)[0]) #just need the first one + + # make sure we only have one entry in case a site has more than one interaction + all_cross_pairs = np.unique([x for xs in all_cross_pairs for x in xs]) + # delete the folded-disordered Go interactions from the list going backwards. + # otherwise list order gets messed up. + for i in reversed(all_cross_pairs): + del self.system.gmx_topology_params["nonbond_params"][i] + def run_molecule(self, molecule): """ Assign water bias for a single molecule @@ -134,6 +170,7 @@ def run_molecule(self, molecule): res_graph = make_residue_graph(molecule) self.assign_residue_water_bias(molecule, res_graph) + self.remove_cross_nb_interactions(molecule, res_graph) return molecule From 9b646d180f2873b8c18f74da07bcb9cfb2fbb50f Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Mon, 6 May 2024 17:06:47 +0200 Subject: [PATCH 12/20] removed old commented code --- bin/martinize2 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bin/martinize2 b/bin/martinize2 index c247a19c0..825ba5d09 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -1076,16 +1076,6 @@ def entry(): { s:float(eps) for s, eps in args.water_bias_eps}, [(int(start), int(stop)) for start, stop in args.water_idrs], ).run_system(system) - # - # # apply idr specific bonded potentials if required - # if args.idr_tune: - # if not target_ff.has_feature("idr"): - # LOGGER.warning('Improved IDR potentials are not implemented ' - # 'for this force field', - # type="missing-feature") - # else: - # vermouth.IDRBonds(idr_regions=[(int(start), int(stop)) for start, stop in args.water_idrs]).run_system(system) - # vermouth.DoLinks().run_system(system) # Here we need to add the resids from the PDB back if that is needed if args.resid_handling == "input": From b62c3b2392e2399f58249762f0a227c71c338802 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Tue, 7 May 2024 10:46:59 +0200 Subject: [PATCH 13/20] removed unnecessary imports, added test for idr annotation --- vermouth/processors/annotate_idrs.py | 3 -- vermouth/tests/test_annotate_idrs.py | 61 ++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 vermouth/tests/test_annotate_idrs.py diff --git a/vermouth/processors/annotate_idrs.py b/vermouth/processors/annotate_idrs.py index 98486505b..4ed73f57c 100644 --- a/vermouth/processors/annotate_idrs.py +++ b/vermouth/processors/annotate_idrs.py @@ -17,10 +17,7 @@ Provides processors that can add and remove IDR specific bonds """ -import functools - from .processor import Processor -from ..graph_utils import make_residue_graph from ..rcsu.go_utils import _in_resid_region from ..log_helpers import StyleAdapter, get_logger LOGGER = StyleAdapter(get_logger(__name__)) diff --git a/vermouth/tests/test_annotate_idrs.py b/vermouth/tests/test_annotate_idrs.py new file mode 100644 index 000000000..b39e4a454 --- /dev/null +++ b/vermouth/tests/test_annotate_idrs.py @@ -0,0 +1,61 @@ +# Copyright 2022 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 for the tune idp bonds processor. +""" +import pytest +from vermouth.processors.annotate_idrs import AnnotateIDRs +from .datafiles import PDB_ALA5_CG +from vermouth.pdb.pdb import read_pdb +import networkx as nx + +def protein(): + """ + Read a PDB file describing a protein at CG resolution. + Embed the content of the PDB in a :class:`vermouth.system.System`. + """ + molecules = read_pdb(PDB_ALA5_CG) + assert len(molecules) == 1 + molecule = molecules[0] + molecule.remove_edges_from(list(molecule.edges)) + _resids = nx.get_node_attributes(molecule, "resid") + nx.set_node_attributes(molecule, _resids, "_old_resid") + return molecule + +@pytest.mark.parametrize('idr_regions, expected', [ + ( + [(1,3)], + [True, True, True, True, True, True, False, False, False, False] + ), + ( + [(1,2),(4,5)], + [True, True, True, True, False, False, True, True, True, True] + ), + ( + [], + [False, False, False, False, False, False, False, False, False, False] + ) +]) +def test_make_disorder_string(idr_regions, expected): + molecule = protein() + AnnotateIDRs(idr_regions=idr_regions).run_molecule(molecule) + result = [] + for key, node in molecule.nodes.items(): + if molecule.nodes[key].get("cgidr"): + result.append(True) + else: + result.append(False) + assert result == expected + From 8d75c3c894557eb5dbbe2ff2d1ff6099bb8f456c Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Tue, 7 May 2024 11:26:43 +0200 Subject: [PATCH 14/20] addressed comments - changed default argument in martinize - renamed 'idr_regions' to 'id_regions' throughout - exposed the name of the extra annotation in annotate_disorder with default argument "cgidr" --- bin/martinize2 | 4 ++-- vermouth/processors/annotate_idrs.py | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/bin/martinize2 b/bin/martinize2 index 825ba5d09..38612bb50 100755 --- a/bin/martinize2 +++ b/bin/martinize2 @@ -170,7 +170,7 @@ def pdb_to_universal( return canonicalized -def martinize(system, mappings, to_ff, delete_unknown=False, idrs=False, disordered_regions = []): +def martinize(system, mappings, to_ff, delete_unknown=False, idrs=False, disordered_regions=None): """ Convert a system from one force field to an other at lower resolution. """ @@ -187,7 +187,7 @@ def martinize(system, mappings, to_ff, delete_unknown=False, idrs=False, disorde vermouth.DoAverageBead(ignore_missing_graphs=True).run_system(system) if idrs: LOGGER.info("Annotating IDRs.", type="step") - vermouth.AnnotateIDRs(idr_regions=[(int(start), int(stop)) for start, stop in disordered_regions]).run_system(system) + vermouth.AnnotateIDRs(id_regions=[(int(start), int(stop)) for start, stop in disordered_regions]).run_system(system) LOGGER.info("Applying the links.", type="step") vermouth.DoLinks().run_system(system) LOGGER.info("Placing the charge dummies.", type="step") diff --git a/vermouth/processors/annotate_idrs.py b/vermouth/processors/annotate_idrs.py index 4ed73f57c..504596793 100644 --- a/vermouth/processors/annotate_idrs.py +++ b/vermouth/processors/annotate_idrs.py @@ -23,15 +23,22 @@ LOGGER = StyleAdapter(get_logger(__name__)) -def annotate_disorder(molecule, idr_regions): +def annotate_disorder(molecule, id_regions, annotation="cgidr"): """ - annotate the disordered regions of the molecule + Annotate the disordered regions of the molecule + + molecule: :class:`vermouth.molecule.Molecule` + the molecule + idr_regions: list + list of tuples defining the resids of the idrs in the molecule + annotation: str + name of the annotation in the node """ for key, node in molecule.nodes.items(): _old_resid = node['_old_resid'] - if _in_resid_region(_old_resid, idr_regions): - molecule.nodes[key]["cgidr"] = True + if _in_resid_region(_old_resid, id_regions): + molecule.nodes[key][annotation] = True class AnnotateIDRs(Processor): """ @@ -43,21 +50,21 @@ class AnnotateIDRs(Processor): """ - def __init__(self, idr_regions = None): + def __init__(self, id_regions=None): """ Parameters ---------- - idr_regions: + id_regions: regions defining the IDRs """ - self.idr_regions = idr_regions + self.id_regions = id_regions def run_molecule(self, molecule): """ Assign disordered regions for a single molecule """ - annotate_disorder(molecule, self.idr_regions) + annotate_disorder(molecule, self.id_regions) return molecule @@ -71,8 +78,7 @@ def run_system(self, system): ---------- system: :class:`vermouth.system.System` """ - if not self.idr_regions: + if not self.id_regions: return system - self.system = system LOGGER.info("Annotating disordered regions", type="step") super().run_system(system) From b3179b4f156b0de05dcdaf54aa8f86e415e3880a Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Tue, 7 May 2024 11:33:08 +0200 Subject: [PATCH 15/20] corrected to new argument name in test_annotate_idrs.py --- vermouth/tests/test_annotate_idrs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vermouth/tests/test_annotate_idrs.py b/vermouth/tests/test_annotate_idrs.py index b39e4a454..6721b0375 100644 --- a/vermouth/tests/test_annotate_idrs.py +++ b/vermouth/tests/test_annotate_idrs.py @@ -50,7 +50,7 @@ def protein(): ]) def test_make_disorder_string(idr_regions, expected): molecule = protein() - AnnotateIDRs(idr_regions=idr_regions).run_molecule(molecule) + AnnotateIDRs(id_regions=idr_regions).run_molecule(molecule) result = [] for key, node in molecule.nodes.items(): if molecule.nodes[key].get("cgidr"): From 72b9d4e0ac2c6640767918f952e1bffac3568757 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 22 May 2024 11:41:42 +0200 Subject: [PATCH 16/20] fixed test for assigning residue water bias --- vermouth/tests/test_water_bias.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vermouth/tests/test_water_bias.py b/vermouth/tests/test_water_bias.py index 1064c74a8..7c791a7c0 100644 --- a/vermouth/tests/test_water_bias.py +++ b/vermouth/tests/test_water_bias.py @@ -33,7 +33,7 @@ ({1: None, 2: "H", 3: "H", 4: "H"}, {"H": 2.1}, [], - {5: "H", 6: "H"} + {3: "H", 5: "H", 6: "H"} ), # only auto-bias two sec struct ({1: "H", 2: "H", 3: "C", 4: "C"}, @@ -45,13 +45,13 @@ ({1: "H", 2: "H", 3: "C", 4: "C"}, {"idr": 2.1}, [(2, 3)], - {2: "idr", 3: "idr"} + {3: "idr", 5: "idr"} ), # idp and sec struc bias ({1: "H", 2: "H", 3: "C", 4: "C"}, {"idr": 1.1, "C": 3.1, "H": 2.1}, [(2, 3)], - {0: "H", 2: "idr", 3: "idr", 4: "C"} + {0: "H", 3: "idr", 5: "idr", 6: "C"} ) )) def test_assign_residue_water_bias(test_molecule, @@ -88,7 +88,10 @@ def test_assign_residue_water_bias(test_molecule, processor.run_system(system) for nb_params in system.gmx_topology_params['nonbond_params']: assert nb_params.atoms[0] == "W" - vs_node = nb_params.atoms[1] + vs_node_atype = nb_params.atoms[1] + for atom in system.molecules[0].atoms: + if atom[1]['atype'] == vs_node_atype: + vs_node = atom[0] for vs in system.molecules[0].interactions['virtual_sitesn']: if vs.atoms[0] == vs_node: bb_node = vs.atoms[1] From a801775c2ffb365f870e178c3a76ba3371800073 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 22 May 2024 14:15:34 +0200 Subject: [PATCH 17/20] added test to check folded-disordered go bond removal --- vermouth/tests/test_water_bias.py | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/vermouth/tests/test_water_bias.py b/vermouth/tests/test_water_bias.py index 7c791a7c0..491ea2612 100644 --- a/vermouth/tests/test_water_bias.py +++ b/vermouth/tests/test_water_bias.py @@ -20,6 +20,7 @@ from vermouth.rcsu.go_vs_includes import VirtualSiteCreator from vermouth.processors.water_bias import ComputeWaterBias from vermouth.tests.helper_functions import create_sys_all_attrs, test_molecule +from vermouth.gmx.topology import NonbondParam @pytest.mark.parametrize('secstruc, water_bias, idr_regions, expected', (( @@ -100,6 +101,77 @@ def test_assign_residue_water_bias(test_molecule, assert water_eps == nb_params.epsilon assert water_sig == nb_params.sigma +@pytest.mark.parametrize('idr_regions, water_bias, go_bonds, expected', + ( + (#no idrs to remove + [], + {"idr": 1.1, "C": 3.1, "H": 2.1}, + [[1, 3], [2, 4]], + [[1, 3], [2, 4]] + ), + (#central idr to remove bonds from + [(2, 3)], + {"idr": 1.1, "C": 3.1, "H": 2.1}, + [[1, 3], [2, 4]], + []) + )) +def test_cross_go_bond_removal(test_molecule, + idr_regions, + water_bias, + go_bonds, + expected): + # bead sizes + sizes = {0: 0.47, 3: 0.41, 5: 0.38, 6: 0.47} + # the molecule atomtypes + atypes = {0: "P1", 1: "SN4a", 2: "SN4a", + 3: "SP1", 4: "C1", + 5: "TP1", + 6: "P1", 7: "SN3a", 8: "SP4"} + # the molecule resnames + resnames = {0: "A", 1: "A", 2: "A", + 3: "B", 4: "B", + 5: "C", + 6: "D", 7: "D", 8: "D"} + secstruc = {1: "H", 2: "H", 3: "H", 4: "H"} + + system = create_sys_all_attrs(test_molecule, + moltype="molecule_0", + secstruc=secstruc, + defaults={"chain": "A"}, + attrs={"resname": resnames, + "atype": atypes}) + + # generate the virtual sites + VirtualSiteCreator().run_system(system) + + #add the go bonds between residues + for go_bond in go_bonds: + atypes = [] + for index in go_bond: + for atom in [i for i in system.molecules[0].atoms]: + if (atom[1]['resid'] == index) and (atom[1]['atomname'] == 'CA'): + atypes.append(atom[1]['atype']) + contact_bias = NonbondParam(atoms=(atypes[0], atypes[1]), + sigma=0.5, #these values don't matter + epsilon=0.5, + meta={"comment": ["go bond"]}) + system.gmx_topology_params["nonbond_params"].append(contact_bias) + + #apply water bias and remove folded-disordered domain bonds + processor = ComputeWaterBias(water_bias=water_bias, + auto_bias=True, + idr_regions=idr_regions) + processor.run_system(system) + + #find the go bonds which remain after removal, and don't involve water + remaining = [list(i.atoms) for i in system.gmx_topology_params["nonbond_params"] if 'W' not in list(i.atoms)] + + assert len(remaining) == len(expected) + for i in expected: + expected_names = [f"molecule_0_{j}" for j in i] + + assert expected_names in remaining + def test_no_moltype_error(test_molecule): """ Test that various high level errors are From 635c4a2449b46ba068ca5b7b73196fc3649c9161 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 22 May 2024 14:23:12 +0200 Subject: [PATCH 18/20] cleaned up test --- vermouth/tests/test_water_bias.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vermouth/tests/test_water_bias.py b/vermouth/tests/test_water_bias.py index 491ea2612..53e4d76b2 100644 --- a/vermouth/tests/test_water_bias.py +++ b/vermouth/tests/test_water_bias.py @@ -101,23 +101,20 @@ def test_assign_residue_water_bias(test_molecule, assert water_eps == nb_params.epsilon assert water_sig == nb_params.sigma -@pytest.mark.parametrize('idr_regions, water_bias, go_bonds, expected', +@pytest.mark.parametrize('idr_regions, go_bonds, expected', ( (#no idrs to remove [], - {"idr": 1.1, "C": 3.1, "H": 2.1}, [[1, 3], [2, 4]], [[1, 3], [2, 4]] ), (#central idr to remove bonds from [(2, 3)], - {"idr": 1.1, "C": 3.1, "H": 2.1}, [[1, 3], [2, 4]], []) )) def test_cross_go_bond_removal(test_molecule, idr_regions, - water_bias, go_bonds, expected): # bead sizes @@ -158,7 +155,7 @@ def test_cross_go_bond_removal(test_molecule, system.gmx_topology_params["nonbond_params"].append(contact_bias) #apply water bias and remove folded-disordered domain bonds - processor = ComputeWaterBias(water_bias=water_bias, + processor = ComputeWaterBias(water_bias={"idr": 1.1, "C": 3.1, "H": 2.1}, # doesn't matter auto_bias=True, idr_regions=idr_regions) processor.run_system(system) From cd0d5bd299903d8163c43687a3c0e018efec7480 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 22 May 2024 14:46:19 +0200 Subject: [PATCH 19/20] changed test_annotate_idrs.py to test system not molecule --- vermouth/tests/test_annotate_idrs.py | 57 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/vermouth/tests/test_annotate_idrs.py b/vermouth/tests/test_annotate_idrs.py index 6721b0375..e7915023c 100644 --- a/vermouth/tests/test_annotate_idrs.py +++ b/vermouth/tests/test_annotate_idrs.py @@ -17,45 +17,44 @@ """ import pytest from vermouth.processors.annotate_idrs import AnnotateIDRs -from .datafiles import PDB_ALA5_CG -from vermouth.pdb.pdb import read_pdb -import networkx as nx - -def protein(): - """ - Read a PDB file describing a protein at CG resolution. - Embed the content of the PDB in a :class:`vermouth.system.System`. - """ - molecules = read_pdb(PDB_ALA5_CG) - assert len(molecules) == 1 - molecule = molecules[0] - molecule.remove_edges_from(list(molecule.edges)) - _resids = nx.get_node_attributes(molecule, "resid") - nx.set_node_attributes(molecule, _resids, "_old_resid") - return molecule +from vermouth.tests.helper_functions import create_sys_all_attrs, test_molecule @pytest.mark.parametrize('idr_regions, expected', [ ( - [(1,3)], - [True, True, True, True, True, True, False, False, False, False] - ), - ( - [(1,2),(4,5)], - [True, True, True, True, False, False, True, True, True, True] + [(1,2)], + [True, True, True, True, True, False, False, False, False] ), ( [], - [False, False, False, False, False, False, False, False, False, False] + [False, False, False, False, False, False, False, False, False] ) ]) -def test_make_disorder_string(idr_regions, expected): - molecule = protein() - AnnotateIDRs(id_regions=idr_regions).run_molecule(molecule) +def test_make_disorder_string(test_molecule, + idr_regions, + expected): + atypes = {0: "P1", 1: "SN4a", 2: "SN4a", + 3: "SP1", 4: "C1", + 5: "TP1", + 6: "P1", 7: "SN3a", 8: "SP4"} + # the molecule resnames + resnames = {0: "A", 1: "A", 2: "A", + 3: "B", 4: "B", + 5: "C", + 6: "D", 7: "D", 8: "D"} + secstruc = {1: "H", 2: "H", 3: "H", 4: "H"} + + system = create_sys_all_attrs(test_molecule, + moltype="molecule_0", + secstruc=secstruc, + defaults={"chain": "A"}, + attrs={"resname": resnames, + "atype": atypes}) + + AnnotateIDRs(id_regions=idr_regions).run_system(system) result = [] - for key, node in molecule.nodes.items(): - if molecule.nodes[key].get("cgidr"): + for key, node in system.molecules[0].nodes.items(): + if system.molecules[0].nodes[key].get("cgidr"): result.append(True) else: result.append(False) assert result == expected - From 5fd9e108cd32fa65dca4d85cf556c61198411234 Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Wed, 22 May 2024 16:37:54 +0200 Subject: [PATCH 20/20] added more tests to test_w - remove all bonds - remove some --- vermouth/processors/water_bias.py | 4 ++-- vermouth/tests/test_water_bias.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/vermouth/processors/water_bias.py b/vermouth/processors/water_bias.py index ff69e03f0..27e05d5d8 100644 --- a/vermouth/processors/water_bias.py +++ b/vermouth/processors/water_bias.py @@ -55,8 +55,8 @@ def __init__(self, water_bias: dict[str, float] a dict of secondary structure codes and epsilon value for the water bias in kJ/mol - idr_regions: - regions defining the IDRs + idr_regions: list + list of tuples of residue regions defining the IDRs prefix: str prefix of the Go virtual-site atomtypes system: vermouth.system.System diff --git a/vermouth/tests/test_water_bias.py b/vermouth/tests/test_water_bias.py index 53e4d76b2..698305d79 100644 --- a/vermouth/tests/test_water_bias.py +++ b/vermouth/tests/test_water_bias.py @@ -110,8 +110,14 @@ def test_assign_residue_water_bias(test_molecule, ), (#central idr to remove bonds from [(2, 3)], - [[1, 3], [2, 4]], - []) + [[1, 3], [2, 4], [1, 4]], + [[1, 4]] + ), + (#remove all bonds within a region + [(1, 4)], + [[1, 2], [2, 3], [3, 4], [1, 4]], + [] + ) )) def test_cross_go_bond_removal(test_molecule, idr_regions,