phbuilder 1.2.5__tar.gz → 1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {phbuilder-1.2.5 → phbuilder-1.5}/PKG-INFO +162 -155
- {phbuilder-1.2.5 → phbuilder-1.5}/README.md +151 -151
- phbuilder-1.5/phbuilder/__init__.py +25 -0
- phbuilder-1.5/phbuilder/calibration.py +69 -0
- phbuilder-1.5/phbuilder/ffield/README.md +13 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb-lambdagrouptypes.dat +73 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb-residuetypes.dat +217 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/aminoacids.c.tdb +1 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/aminoacids.hdb +566 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/aminoacids.n.tdb +1 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/aminoacids.r2b +32 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/aminoacids.rtp +3988 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/atomtypes.atp +376 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/ffbonded.itp +1404 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/ffnonbonded.itp +380 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/forcefield.doc +16 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/forcefield.itp +23 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/ions.itp +572 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/tip3p.itp +34 -0
- phbuilder-1.5/phbuilder/ffield/amber14sb_mod.ff/watermodels.dat +1 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.c.tdb +1 -1
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.hdb +5 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.rtp +31 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/lambdagrouptypes.dat +8 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/residuetypes.dat +1 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/mdp.py +52 -26
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/parsecmdline.py +58 -31
- phbuilder-1.5/phbuilder/phbuilder.py +1072 -0
- phbuilder-1.5/phbuilder/pka.py +31 -0
- phbuilder-1.5/phbuilder/sanitize.py +191 -0
- phbuilder-1.5/phbuilder/structure.py +402 -0
- phbuilder-1.5/phbuilder/termini.py +22 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/user.py +41 -31
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder.egg-info/PKG-INFO +162 -155
- phbuilder-1.5/phbuilder.egg-info/SOURCES.txt +122 -0
- phbuilder-1.5/phbuilder.egg-info/requires.txt +12 -0
- phbuilder-1.5/pyproject.toml +14 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/setup.cfg +13 -4
- phbuilder-1.5/tests/test_configuration.py +74 -0
- phbuilder-1.5/tests/test_genparams.py +89 -0
- phbuilder-1.5/tests/test_gentopol.py +50 -0
- phbuilder-1.5/tests/test_neutralize.py +102 -0
- phbuilder-1.5/tests/test_sanitize.py +44 -0
- phbuilder-1.5/tests/test_scripts.py +244 -0
- phbuilder-1.5/tests/test_solvent_cleanup.py +36 -0
- phbuilder-1.5/tests/test_structure.py +90 -0
- phbuilder-1.5/tests/test_termini.py +51 -0
- phbuilder-1.5/tests/test_workflow.py +139 -0
- phbuilder-1.2.5/phbuilder/__init__.py +0 -16
- phbuilder-1.2.5/phbuilder/ffield/README.md +0 -14
- phbuilder-1.2.5/phbuilder/phbuilder.py +0 -1453
- phbuilder-1.2.5/phbuilder/sanitize.py +0 -217
- phbuilder-1.2.5/phbuilder/structure.py +0 -333
- phbuilder-1.2.5/phbuilder.egg-info/SOURCES.txt +0 -43
- phbuilder-1.2.5/phbuilder.egg-info/requires.txt +0 -4
- phbuilder-1.2.5/pyproject.toml +0 -8
- {phbuilder-1.2.5 → phbuilder-1.5}/LICENSE +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/atomtypes.atp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/cmap.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/ffbonded.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/ffnonbonded.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/forcefield.doc +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/forcefield.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/gb.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/ions.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.arn +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.n.tdb +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.r2b +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.vsd +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/nbfix.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/old_c36_cmap.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/popc.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/spc.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/spce.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/tip3p.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/tip4p.itp +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/watermodels.dat +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder.egg-info/dependency_links.txt +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder.egg-info/entry_points.txt +0 -0
- {phbuilder-1.2.5 → phbuilder-1.5}/phbuilder.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: phbuilder
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5
|
|
4
4
|
Summary: System builder for constant-pH simulations in GROMACS.
|
|
5
5
|
Home-page: https://gitlab.com/gromacs-constantph/phbuilder
|
|
6
6
|
Author: Anton Jansen
|
|
@@ -17,9 +17,16 @@ Requires-Python: >=3.8
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: argcomplete>=3.1.1
|
|
20
|
-
Requires-Dist: configparser>=6.0.0
|
|
21
|
-
Requires-Dist: sympy>=1.12
|
|
22
20
|
Requires-Dist: numpy
|
|
21
|
+
Provides-Extra: analysis
|
|
22
|
+
Requires-Dist: matplotlib; extra == "analysis"
|
|
23
|
+
Requires-Dist: MDAnalysis; extra == "analysis"
|
|
24
|
+
Provides-Extra: test
|
|
25
|
+
Requires-Dist: pytest; extra == "test"
|
|
26
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
27
|
+
Requires-Dist: matplotlib; extra == "test"
|
|
28
|
+
Requires-Dist: MDAnalysis; extra == "test"
|
|
29
|
+
Dynamic: license-file
|
|
23
30
|
|
|
24
31
|
<div style="width: 830px">
|
|
25
32
|
|
|
@@ -43,6 +50,9 @@ For the publication associated with phbuilder, please see:
|
|
|
43
50
|
* [phbuilder: A Tool for Efficiently Setting up Constant pH Molecular Dynamics Simulations in GROMACS](https://pubs.acs.org/doi/full/10.1021/acs.jcim.3c01313).
|
|
44
51
|
* For examples of CpHMD simulation set up with phbuilder, have a look at the publication's [simulation input files](https://zenodo.org/doi/10.5281/zenodo.10468944).
|
|
45
52
|
|
|
53
|
+
For the cysteine implementation, please see:
|
|
54
|
+
* [Implementation and Validation of Titratable Cysteine in GROMACS-Based Constant-pH Molecular Dynamics](https://pubs.acs.org/doi/full/10.1021/acs.jctc.6c00640).
|
|
55
|
+
|
|
46
56
|
# Table of contents
|
|
47
57
|
|
|
48
58
|
1. [Installation](#installation)
|
|
@@ -51,52 +61,33 @@ For the publication associated with phbuilder, please see:
|
|
|
51
61
|
4. [Performing Titrations](#performing-titrations)
|
|
52
62
|
5. [Performing Parameterizations](#performing-parameterizations)
|
|
53
63
|
6. [Running CpHMD simulations on HPC resources](#running-cphmd-simulations-on-hpc-resources)
|
|
54
|
-
7. [
|
|
55
|
-
8. [
|
|
56
|
-
9. [
|
|
57
|
-
10. [Tips, Tricks, and FAQ](#tips-tricks-and-faq)
|
|
64
|
+
7. [Command-line reference](#command-line-reference)
|
|
65
|
+
8. [Troubleshooting and analysis](#troubleshooting-and-analysis)
|
|
66
|
+
9. [Testing](#testing)
|
|
58
67
|
|
|
59
68
|
# Installation
|
|
60
69
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
2. Download the [gromacs-constantph](https://gitlab.com/gromacs-constantph/constantph/) beta.
|
|
64
|
-
|
|
65
|
-
3. Build and install using the instructions [here](https://manual.gromacs.org/current/install-guide/index.html). Suggested CMake command:
|
|
66
|
-
```
|
|
67
|
-
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=CUDA -DGMX_USE_RDTSCP=ON -DCMAKE_INSTALL_PREFIX=/usr/local/gromacs_constantph
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
NOTE: if you run into compilation issues, GCC 10.2 and CUDA 11.2.1 have been proven to work.
|
|
70
|
+
Build the [constant-pH GROMACS fork](https://gitlab.com/gromacs-constantph/constantph/) using its source tree. The commands below build a CPU-only installation for setup and small simulations.
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```
|
|
72
|
+
```sh
|
|
73
|
+
cmake -S gromacs-constantph -B build -DGMX_GPU=OFF -DGMX_BUILD_OWN_FFTW=ON
|
|
74
|
+
cmake --build build --parallel
|
|
75
|
+
cmake --install build --prefix "$HOME/.local/opt/gromacs-constantph"
|
|
76
|
+
source "$HOME/.local/opt/gromacs-constantph/bin/GMXRC"
|
|
77
|
+
gmx cphmd -h
|
|
78
|
+
```
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
For an Apple Silicon CPU build without an OpenMP toolchain, configure with `-DGMX_OPENMP=OFF`. Use the [fork manual](https://gitlab.com/gromacs-constantph/constantph/-/tree/main/manual) for engine-specific settings. Keep the fork on `PATH` when running `neutralize` and when preprocessing or running CpHMD.
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
activate-global-python-argcomplete --user
|
|
86
|
-
```
|
|
87
|
-
once and reload your terminal.
|
|
82
|
+
Install the released package with `python -m pip install phbuilder`. To work from this checkout, run `python -m pip install -e '.[analysis]'` from the repository root. The core CLI requires Python 3.8 or later. The analysis extra installs MDAnalysis and Matplotlib for the repository scripts. For optional shell completion, run `activate-global-python-argcomplete --user` and restart your shell.
|
|
88
83
|
|
|
89
84
|
# Description
|
|
90
85
|
|
|
91
86
|
phbuilder is a command line tool that automates setting up constant-pH (CpHMD) simulations in [GROMACS](https://www.gromacs.org/). phbuilder consists of three (sub)tools: `gentopol`, `neutralize`, and `genparams`. Each tool fulfills a specific function in the setup process. `gentopol` allows you to select which residues to make titratable and which initial lambda (protonation) state they should have. `gentopol` also (re)generates the system topology using the modified CHARMM36m CpHMD force field ([why?](https://pubs.acs.org/doi/full/10.1021/acs.jctc.2c00517)). `neutralize` adds the appropriate number of ions and buffer particles to ensure a net-neutral simulation, and `genparams` generates the CpHMD-specific `.mdp` and `.ndx` files. Functionality for setting up titration and parameterization is also provided with the help of included stand-alone Python scripts.
|
|
92
87
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
/path/to/python3.xx/site-packages/phbuilder/ffield/
|
|
97
|
-
```
|
|
88
|
+
The default CHARMM36m profile supports Asp, Glu, Arg, Lys, His and selected Cys residues. The optional AMBER ff14SB profile covers Asp, Glu, His, Lys, Tyr and selected Cys with TIP3P water. Add `--force-field amber14sb` to **each** of `gentopol`, `neutralize` and `genparams` in the same system directory. The Amber profile uses the benchmark nonbonded settings for freshly generated MDPs. Use a separate working directory for each force field. [Parameter provenance](phbuilder/ffield/README.md) · [ff14SB benchmark](https://doi.org/10.1021/acs.jctc.6c00678) · [GitLab #39](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/39)
|
|
98
89
|
|
|
99
|
-
|
|
90
|
+
For a custom force field, pass `--lambda-types /path/to/lambdagrouptypes.dat` to all three commands, or put `lambdagrouptypes.dat` in the command's working directory. Each command prints the resolved parameter-file path, force field and water model. Set the force field `name` and `water` in `[ FORCEFIELD ]`. Put the matching `.ff` directory and `residuetypes.dat` in the working directory or specify their paths in the config. For each titratable group, list atoms in the **same order** as every charge array. An optional `[ MDP ]` section sets standard GROMACS defaults for newly generated MDPs. [GitLab #38](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/38)
|
|
100
91
|
|
|
101
92
|
# Basic Workflow
|
|
102
93
|
|
|
@@ -106,13 +97,14 @@ This is an important step, and it applies especially to structures that are stra
|
|
|
106
97
|
* Make sure your structure adheres to the proper [PDB format](https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/pdbintro.html), only contains one MODEL, does not contain alternate location indicators, does not miss atoms or residues, etc.
|
|
107
98
|
* Basically, if you cannot use your structure to successfully set up normal MD simulations with GROMACS, you should first make sure this works before continuing.
|
|
108
99
|
* It is also important that your molecules(s) containing the titratable groups are *at the top* of the structure file. So first the titratable protein(s), and only then solvent, ions, lipids, etc.
|
|
109
|
-
*
|
|
100
|
+
* Give each peptide chain a one-character PDB ID in column 22 and put a `TER` record after each chain. For large assemblies, nonconsecutive chains can reuse IDs with explicit `TER` boundaries. A two-character ID shifts the residue-number columns and causes a format error. Keep the chain order when editing coordinates and `phrecord.dat`. [GitLab #49](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/49)
|
|
101
|
+
* Use the residue name `CYST` for titratable cysteine. [cysteine_preparation.py](scripts/cysteine_preparation.py) renames selected residues and can exclude pairs close enough to form a disulfide. With `--all`, the script keeps detected pairs as ordinary cysteines.
|
|
110
102
|
|
|
111
103
|
### 2. Make sure that topologies are available for all moleculetypes present in your structure file.
|
|
112
104
|
|
|
113
105
|
phbuilder cannot provide topology information for non-standard residue types (those not present in `residuetypes.dat`). In such cases, the user has two options:
|
|
114
106
|
|
|
115
|
-
1. **Make sure you have a separate `.itp` file.** If `gentopol` detects any non-standard residue types, it will ask the user to provide a path to the corresponding `.itp` file(s).
|
|
107
|
+
1. **Make sure you have a separate `.itp` file.** If `gentopol` detects any non-standard residue types, it will ask the user to provide a path to the corresponding `.itp` file(s). phbuilder runs `gmx pdb2gmx` on the standard residues and appends the remaining molecules with their supplied topology. PDB ligands can use `HETATM` records. Include all ligand atoms, including hydrogens, in topology order. Note that despite providing a separate `.itp` file, you might still have to make additions to the force field. This possibly includes new atom, bond, pair, angle, and dihedral types not present in the standard force field, but present in the provided topology.
|
|
116
108
|
|
|
117
109
|
2. **Add the non-standard residue type to the force field.** This will require making additions in the `residuetypes.dat`, `merged.rtp`, and possibly `merged.hdb` files. This will likely be more involved compared to the first option, but the advantage is that `gmx pdb2gmx` will be able to process your full structure.
|
|
118
110
|
|
|
@@ -128,14 +120,20 @@ Manually choose which residues to make titratable and in which initial state, an
|
|
|
128
120
|
|
|
129
121
|
```
|
|
130
122
|
phbuilder gentopol -f input.pdb
|
|
131
|
-
```
|
|
123
|
+
```
|
|
132
124
|
|
|
133
|
-
|
|
125
|
+
Use `-ph` to choose starting states from the configured reference pKa values. For single-site groups, state 0 is protonated and state 1 is deprotonated. Use `-groups "ASPT GLUT"` to restrict which residue types are made titratable. The command below overrides one residue and chooses the other initial states automatically.
|
|
134
126
|
|
|
135
|
-
```
|
|
136
|
-
phbuilder gentopol -f input.pdb -ph
|
|
127
|
+
```sh
|
|
128
|
+
phbuilder gentopol -f input.pdb -ph 7.4 --state 'A:42=3'
|
|
137
129
|
```
|
|
138
130
|
|
|
131
|
+
Use `_:42` for a blank chain, `A:42B` for insertion code B, and `A:42#2` for the second occurrence of a repeated identifier. Initial states are saved in `phrecord.dat`. Set them before neutralizing. If you change a state afterward, run `neutralize` again using the original solvated coordinates and their matching topology, then regenerate the MDPs. Keep a copy of the solvated topology if you plan to compare several initial states.
|
|
132
|
+
|
|
133
|
+
In the default `pdb2gmx` prompts, enter `y` to create a proposed disulfide or `n` to keep that pair reduced. For unattended standard inputs, `--pdb2gmx run --disulfides auto` uses GROMACS's automatic bond selection. `--pdb2gmx skip` writes the renamed structure and state record for a manual topology workflow.
|
|
134
|
+
|
|
135
|
+
For a fixed-pH run, the protonated histidine reference is the simulation pH. This makes its pH-dependent energy offset zero. A `genparams -ph 7.4` run writes 7.4 for that reference and leaves the two neutral-state pKa values in the parameter file as configured. The shipped CHARMM36m and Amber parameters start histidine in the protonated state at pH 4 and in a neutral tautomer at pH 7.4 unless overridden. [GitLab #43](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/43)
|
|
136
|
+
|
|
139
137
|
### 4. Add a periodic box and solvent (if not already present).
|
|
140
138
|
|
|
141
139
|
Periodic box (see [gmx editconf](https://manual.gromacs.org/documentation/current/onlinehelp/gmx-editconf.html)):
|
|
@@ -152,15 +150,23 @@ gmx solvate -cp box.pdb -p topol.top -o solvated.pdb
|
|
|
152
150
|
|
|
153
151
|
### 5. (Optional) Remove incorrectly placed water molecules.
|
|
154
152
|
|
|
155
|
-
|
|
153
|
+
Inspect solvent near buried pockets or membranes. [clean_after_solvate.py](scripts/clean_after_solvate.py) removes water using positions and residue identities. Pass the matching input topology and keep the two cleaned outputs together.
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
python /path/to/phbuilder/scripts/clean_after_solvate.py \
|
|
157
|
+
-f solvated.pdb -p topol.top -o cleaned.pdb --output-top cleaned.top
|
|
158
|
+
phbuilder neutralize -f cleaned.pdb -p cleaned.top
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The default output names are `solvated_updated.gro` and `topol_updated.top`. Use PDB output to retain chain boundaries and insertion codes. The cleaner reports how many water molecules it removed. [GitLab #35](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/35) · [GitLab #42](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/42)
|
|
156
162
|
|
|
157
163
|
### 6. Use `phbuilder neutralize` to ensure a net-neutral simulation system.
|
|
158
164
|
|
|
159
165
|
`phbuilder neutralize` performs two tasks: it adds ions to ensure a net-neutral system at $t = 0$, and it adds buffer particles in order to maintain a net-neutral system at $t > 0$.
|
|
160
166
|
|
|
161
|
-
Adding ions to obtain a net-neutral simulation system at $t = 0$ is not as trivial as it may first seem. When setting up a CpHMD simulation,
|
|
167
|
+
Adding ions to obtain a net-neutral simulation system at $t = 0$ is not as trivial as it may first seem. When setting up a CpHMD simulation, the titratable residues in the *structure* file are always in their most protonated state as we need all titratable hydrogen atoms to be present, but the *topology* (the actual charges of the titratable residues at $t = 0$) depend on the initial lambda values, which are set during the `gentopol` step and are provided to GROMACS in the `.mdp` files.
|
|
162
168
|
|
|
163
|
-
Adding buffers to maintain a net neutral system at $t > 0$ comes down to the number of buffers to be added, which depends on the number of titratable sites in the system. Each buffer particle can absorb up to $\pm0.5$ charge,
|
|
169
|
+
Adding buffers to maintain a net neutral system at $t > 0$ comes down to the number of buffers to be added, which depends on the number of titratable sites in the system. Each buffer particle can absorb up to $\pm0.5$ charge, and the default target is $2N_{\text{sites}}+1$ buffers. The number required for a particular system depends on its charge fluctuations. The amount of charge that is required to be 'absorbed' from the titratable groups is distributed evenly over all buffer particles, so if we have $-10$ charge to 'absorb' and 100 buffer particles, each buffer particle would take on a $+0.1$ charge in order to keep the system neutral (see below).
|
|
164
170
|
|
|
165
171
|
<p align="center">
|
|
166
172
|
<img src="figures/neutral.png" width="400"/>
|
|
@@ -178,16 +184,24 @@ Alternatively, if you want a specific ion concentration (mol/L) and/or a specifi
|
|
|
178
184
|
phbuilder neutralize -f solvated.pdb -conc 0.15 -nbufs 20
|
|
179
185
|
```
|
|
180
186
|
|
|
181
|
-
|
|
187
|
+
The command adds ions and buffers. It retains any already present, and `-nbufs` specifies the desired total. Omit `-conc` to keep the existing salt pairs and add only counterions as needed. With `-conc`, phbuilder estimates the number of salt pairs using the input water count.
|
|
188
|
+
|
|
189
|
+
Use `-solname TIP3` for a solvent named `TIP3` in both files. If the coordinates label water as `HOH` and the topology lists molecule type `SOL`, specify both names.
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
phbuilder neutralize -f cleaned.pdb -p cleaned.top -solname HOH -solmol SOL
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The solvent must occupy a contiguous block in the coordinates and appear once under `[ molecules ]` with the matching count. The command reports missing solvent, topology/count mismatches, and residual charge. If ion replacement exhausts suitable solvent, check the box and the minimum replacement distance `-rmin` in nm. The measured charge comes from `grompp` using the CpHMD endpoint charges in the generated MDP and the saved lambda states. [GitLab #44](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/44) · [GitLab #42](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/42) · [GitLab #38](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/38)
|
|
182
196
|
|
|
183
197
|
### 7. Use `phbuilder genparams` to generate the `.mdp` and `.ndx` files required for CpHMD.
|
|
184
198
|
|
|
185
199
|
At this point, if everything went correctly both your structure and topology file(s) should be completed and constitute a net-neutral system when running CpHMD. What is now left is the actual simulation part: energy minimization, equilibration and production using the correct CpHMD parameters.
|
|
186
200
|
|
|
187
|
-
Generate the `.mdp` files for
|
|
201
|
+
Generate the `.mdp` files for minimization, equilibration and production, including the CpHMD parameters for a specific simulation pH:
|
|
188
202
|
|
|
189
203
|
```
|
|
190
|
-
phbuilder genparams -f phneutral.pdb -ph 4.0
|
|
204
|
+
phbuilder genparams -f phneutral.pdb -ph 4.0
|
|
191
205
|
```
|
|
192
206
|
|
|
193
207
|
By default, the following files will be written:
|
|
@@ -197,11 +211,11 @@ By default, the following files will be written:
|
|
|
197
211
|
* `MD.mdp`
|
|
198
212
|
* `index.ndx`
|
|
199
213
|
|
|
200
|
-
|
|
214
|
+
`genparams` also writes `lambdareference.dat`. Use `-mdp` to preserve standard parameters in a custom production MDP and refresh its CpHMD keys. Use `-ndx` to add the generated lambda groups to an existing index while keeping other groups. When comparing pH values, confirm that the initial states used for neutralization still match `phrecord.dat`.
|
|
201
215
|
|
|
202
|
-
### 8. Check the generated files and modify parameters specific to your system as required.
|
|
216
|
+
### 8. Check the generated files and modify parameters specific to your system as required.
|
|
203
217
|
|
|
204
|
-
The `.mdp` files
|
|
218
|
+
The generated `.mdp` files are starting points. CpHMD production requires the leapfrog `integrator = md` in this fork. With other integrators, such as `sd`, the fork can set initial charges but does not advance the lambda coordinates. Steepest descent remains suitable for minimization. They should work for basic simulations, but for advanced stuff like semi-isotropic pressure coupling for membranes, pull code, AWH, more gradual equilibration, etc. you should modify these generic files accordingly. Also note that by default no position restraints are used for the protein during NVT and NPT coupling.
|
|
205
219
|
|
|
206
220
|
### 9. Perform equilibration.
|
|
207
221
|
|
|
@@ -231,20 +245,54 @@ gmx grompp -f MD.mdp -c NPT.pdb -p topol.top -n index.ndx -o MD.tpr
|
|
|
231
245
|
gmx mdrun -v -deffnm MD -c MD.pdb -x MD.xtc -npme 0
|
|
232
246
|
```
|
|
233
247
|
|
|
234
|
-
|
|
248
|
+
Append to the original run when restarting from a checkpoint.
|
|
249
|
+
|
|
250
|
+
```sh
|
|
251
|
+
gmx mdrun -deffnm MD -cpi MD.cpt -append
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Keep the original output files alongside the checkpoint. This fork can produce unreadable later EDR parts with `-noappend`. For lambda analysis use the appended EDR; the issue also affects `gmx energy` for those parts. [GitLab #37](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/37) · [Fork manual](https://gitlab.com/gromacs-constantph/constantph/-/blob/main/manual/constantph_usage.md)
|
|
255
|
+
|
|
256
|
+
### 11. Extract the lambda trajectories.
|
|
235
257
|
|
|
236
258
|
After the CpHMD simulation is completed one can extract the $\lambda$-coordinate trajectories from the `.edr` file in the form of readable `.xvg` files using the following command:
|
|
237
259
|
|
|
238
260
|
```
|
|
239
|
-
gmx cphmd -s MD.tpr -e MD.edr -numplot 1
|
|
261
|
+
gmx cphmd -s MD.tpr -e MD.edr -o lambda.xvg -numplot 1
|
|
240
262
|
```
|
|
241
263
|
|
|
264
|
+
The filenames match `lambdareference.dat` when you use `-o lambda.xvg -numplot 1`. Each data row contains the time and one lambda coordinate. For CHARMM36m `HSPT` and AMBER `HIPT`, the three consecutive coordinates are constrained to sum to one.
|
|
265
|
+
|
|
266
|
+
| Coordinate within a histidine site | CHARMM36m / Amber state | Interpretation |
|
|
267
|
+
| --- | --- | --- |
|
|
268
|
+
| 1 | HSP / HIP | Both ring nitrogens are protonated |
|
|
269
|
+
| 2 | HSE / HIE | Proton on Nε |
|
|
270
|
+
| 3 | HSD / HID | Proton on Nδ |
|
|
271
|
+
|
|
272
|
+
A row with `0.04 0.91 0.05` across the three aligned time series is HSE/HIE. A row with `0.55 0.40 0.05` is intermediate. For endpoint populations, count each state when its lambda is greater than 0.8, divide by the number of assigned frames, and report the excluded fraction. For example, 30 HSP, 50 HSE, 10 HSD and 10 intermediate frames give 33%, 56% and 11% of assigned frames, with 10% excluded. Report sampling uncertainty across independent replicas. [CpHMD trajectory analysis](https://doi.org/10.1021/acs.jctc.2c00516) · [GitLab #48](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/48)
|
|
273
|
+
|
|
274
|
+
## Titrate a CHARMM36m chain terminus
|
|
275
|
+
|
|
276
|
+
Explicit terminal sites use the `NH3T` and `COOHT` patches and the charge tables and correction coefficients from the published CHARMM36m terminal reference runs. Specify the chain, residue number, endpoint (0 protonated, 1 deprotonated), and reference pKa. The example below requests an N terminus at A:1 and a C terminus at A:42. Use the pKa values appropriate for your reference compounds.
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
ends=(--terminal 'N:A:1=0@8.0' --terminal 'C:A:42=1@4.0')
|
|
280
|
+
phbuilder gentopol -f input.pdb -ph 7 "${ends[@]}"
|
|
281
|
+
# Select NH3T and COOHT for the requested ends in the GROMACS menus.
|
|
282
|
+
gmx editconf -f phprocessed.pdb -o box.pdb -bt cubic -d 1.5
|
|
283
|
+
gmx solvate -cp box.pdb -p topol.top -o solvated.pdb
|
|
284
|
+
phbuilder neutralize -f solvated.pdb "${ends[@]}"
|
|
285
|
+
phbuilder genparams -f phneutral.pdb -ph 7 "${ends[@]}"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Box and solvate the prepared structure before neutralization. Repeat the same selectors in all three commands. Keep the structure in PDB format and use one reference pKa per terminal type. The N-terminal table requires the standard `N H1 H2 H3 CA HA` atom set, which excludes glycine and proline N termini. The C-terminal table requires `C OT1 OT2 HT2` from `COOHT`. The site is an additional lambda group on the same residue as any titratable side chain. [Reference inputs](https://doi.org/10.1021/acs.jctc.2c00517.s001) · [GitLab #29](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/29)
|
|
289
|
+
|
|
242
290
|
# Performing titrations
|
|
243
291
|
|
|
244
|
-
Performing a computational titration is helpful for determining the pKa shifts of titratable sites. After steps 1 to 9 of the basic workflow have been completed, one can use the included [create_titration.py](scripts/create_titration.py) to
|
|
292
|
+
Performing a computational titration is helpful for determining the pKa shifts of titratable sites. After steps 1 to 9 of the basic workflow have been completed, one can use the included [create_titration.py](scripts/create_titration.py) to set up a titration. For example, the command:
|
|
245
293
|
|
|
246
294
|
```
|
|
247
|
-
create_titration.py -f MD.mdp -c NPT.pdb -p topol.top -n index.ndx -pH 1:10:1 -nr 2
|
|
295
|
+
python /path/to/phbuilder/scripts/create_titration.py -f MD.mdp -c NPT.pdb -p topol.top -n index.ndx -pH 1:10:1 -nr 2
|
|
248
296
|
```
|
|
249
297
|
|
|
250
298
|
creates directories corresponding to pH 1 to 9, with each subdirectory containing two replicates (each containing the appropriate input files for `gmx mdrun`).
|
|
@@ -255,7 +303,7 @@ The minor change is at step 7. When parameters are generated, `phbuilder genpara
|
|
|
255
303
|
phbuilder genparams -f phneutral.pdb -ph 4.0 -titr
|
|
256
304
|
```
|
|
257
305
|
|
|
258
|
-
This will set the pH value to the string "ph", as well as all pH-dependent terms for pKa values in multisite groups (e.g. $\lambda_1$ of histidine). Those pH-dependent strings will be read by `create_titration.py` and modified according to the pH value for a particular
|
|
306
|
+
This will set the pH value to the string "ph", as well as all pH-dependent terms for pKa values in multisite groups (e.g. $\lambda_1$ of histidine). Those pH-dependent strings will be read by `create_titration.py` and modified according to the pH value for a particular simulation. Note however that a pH value is still required to be passed as input to `phbuilder genparams`. Minimization and equilibration files will be generated for this provided pH.
|
|
259
307
|
|
|
260
308
|
# Performing parameterizations
|
|
261
309
|
|
|
@@ -267,13 +315,7 @@ NOTE: the structure for the arginine tripeptide may be found [here](figures/arg_
|
|
|
267
315
|
|
|
268
316
|
### 1. Prepare your working directory.
|
|
269
317
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
```
|
|
273
|
-
/path/to/python3.11/site-packages/phbuilder/ffield/
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
to your working directory whenever used. To parameterize arginine, we will have to use modified versions of these files. Since it is not recommended to modify the default ones, we suggest placing copies in your working directory (either manually or by simply running `phbuilder gentopol` once). The files in your working directory will then override the default ones.
|
|
318
|
+
Copy the selected profile's `lambdagrouptypes.dat` from [the bundled parameter data](phbuilder/ffield) into your working directory before editing it. Use the same file throughout setup. `gentopol` copies the packaged force field and residue table into the working directory when local copies are absent.
|
|
277
319
|
|
|
278
320
|
### 2. Modify `lambdagrouptypes.dat`.
|
|
279
321
|
|
|
@@ -297,7 +339,7 @@ dvdl_1 = 0.0
|
|
|
297
339
|
|
|
298
340
|
[ BUF ]
|
|
299
341
|
range = -0.50 0.50
|
|
300
|
-
dvdl = 823.85 -2457.8 2172.2 -144.05 -1289 576.74
|
|
342
|
+
dvdl = 823.85 -2457.8 2172.2 -144.05 -1289 576.74
|
|
301
343
|
```
|
|
302
344
|
|
|
303
345
|
Here, it can be seen that `ARGT` will be used as the name for the titratable arginine. One can also see which atoms are to be made titratable, and which charge they should have in which protonation state. Finally, notice that `dvdl_1` is set to zero, as this is the parameter we are going to obtain during the parameterization.
|
|
@@ -308,7 +350,7 @@ As mentioned earlier, phbuilder cannot provide topology information for non-stan
|
|
|
308
350
|
|
|
309
351
|
**Option 1 : Make sure you have a separate `.itp` file for the titratable ligand.**
|
|
310
352
|
|
|
311
|
-
If `gentopol` detects any non-standard residue types, it will ask the user to provide a path to the corresponding `.itp` file.
|
|
353
|
+
If `gentopol` detects any non-standard residue types, it will ask the user to provide a path to the corresponding `.itp` file. phbuilder runs `gmx pdb2gmx` on the standard residues and appends the remaining molecules with their supplied topology. PDB ligands can use `HETATM` records. Include all ligand atoms, including hydrogens, in topology order. If this option is chosen, it is crucial that the input `.pdb` and `.itp` files correspond to the *most protonated state* of the non-standard residue type (i.e. with all hydrogens present). Note that despite providing a separate `.itp` file, you might still have to make additions to the force field. This possibly includes new atom, bond, pair, angle, and dihedral types not present in the standard force field, but present in the provided topology.
|
|
312
354
|
|
|
313
355
|
In your provided `.itp` file, the names in the [ atoms ] section should reflect the titratable name of the residue:
|
|
314
356
|
|
|
@@ -355,7 +397,7 @@ etc.
|
|
|
355
397
|
Third, make sure an entry for `ARGT` exists in the `charmm36-mar2019-cphmd.ff/merged.hdb`. One can do this by simply copying and pasting the entry for `ARG` and changing the name to `ARGT`:
|
|
356
398
|
|
|
357
399
|
```
|
|
358
|
-
ARGT 8
|
|
400
|
+
ARGT 8
|
|
359
401
|
1 1 HN N -C CA
|
|
360
402
|
1 5 HA CA N C CB
|
|
361
403
|
2 6 HB CB CG CA
|
|
@@ -399,15 +441,15 @@ will position restrain only atom 19. Position restraining during the parameteriz
|
|
|
399
441
|
|
|
400
442
|
### 5. Perform solvation and neutralization to obtain a net-neutral simulation system.
|
|
401
443
|
|
|
402
|
-
* When performing the neutralization step, we want to add only one buffer particle, and we want the buffer to be at least
|
|
403
|
-
* To prevent finite-size effects for small simulation boxes, we recommend using a simulation box of 5 nm cubed for the
|
|
444
|
+
* When performing the neutralization step, we want to add only one buffer particle, and we want the buffer to be at least 1.5 nm away from the tripeptide. We therefore set the `-nbufs 1` and `-rmin 1.5` flags.
|
|
445
|
+
* To prevent finite-size effects for small simulation boxes, we recommend using a simulation box of at least 5 nm cubed for the parameterization and replica simulations.
|
|
404
446
|
* The effects of ionic strength on the parameterization should be limited, but we nonetheless recommend adding at least a few ions to the parameterization system and replicates, e.g. by setting `-conc 0.15` (physiological NaCl concentration).
|
|
405
447
|
* For more information on the effects of box size and ionic strength on the parameterization, please refer to the [best practices paper](https://pubs.acs.org/doi/full/10.1021/acs.jctc.2c00517).
|
|
406
448
|
|
|
407
449
|
```
|
|
408
|
-
gmx editconf -f phprocessed.pdb -o box.pdb -bt cubic -d
|
|
450
|
+
gmx editconf -f phprocessed.pdb -o box.pdb -bt cubic -d 2.0
|
|
409
451
|
gmx solvate -cp box.pdb -p topol.top -o solvated.pdb
|
|
410
|
-
phbuilder neutralize -f solvated.pdb -nbufs 1 -rmin
|
|
452
|
+
phbuilder neutralize -f solvated.pdb -nbufs 1 -rmin 1.5 -conc 0.15
|
|
411
453
|
```
|
|
412
454
|
|
|
413
455
|
### 6. Use `genparams` to generate the `.mdp` files in calibration mode.
|
|
@@ -418,7 +460,7 @@ This can be done by setting the `-cal` flag:
|
|
|
418
460
|
phbuilder genparams -f phneutral.pdb -ph 4.0 -cal
|
|
419
461
|
```
|
|
420
462
|
|
|
421
|
-
We set pH = 4.0
|
|
463
|
+
We set pH = 4.0 because `-ph` is required by `genparams`. The actual value we supply doesn't matter as $V_{\text{pH}}$ is never computed during parameterization (explained below).
|
|
422
464
|
|
|
423
465
|
Setting the `-cal` flag will do a number of things. Most importantly, it will set
|
|
424
466
|
|
|
@@ -432,10 +474,10 @@ Setting `-cal` also adds `define = -DPOSRES -DPOSRES_BUF` to the `.mdp` files as
|
|
|
432
474
|
|
|
433
475
|
### 7. Perform basic workflow steps 8-9 (check generic `.mdp` files and perform EQ).
|
|
434
476
|
|
|
435
|
-
### 8. Use the included [create_parameterization.py](scripts/create_parameterization.py) to
|
|
477
|
+
### 8. Use the included [create_parameterization.py](scripts/create_parameterization.py) to set up the parameterization runs.
|
|
436
478
|
|
|
437
479
|
```
|
|
438
|
-
create_parameterization.py -f MD.mdp -c NPT.pdb -r NPT.pdb -p topol.top -n index.ndx
|
|
480
|
+
python /path/to/phbuilder/scripts/create_parameterization.py -f MD.mdp -c NPT.pdb -r NPT.pdb -p topol.top -n index.ndx
|
|
439
481
|
```
|
|
440
482
|
|
|
441
483
|
creates directories corresponding to different $\lambda$-values, each containing a `.tpr` run input file for `gmx mdrun`.
|
|
@@ -449,7 +491,7 @@ The 2-step parameterization protocol assumes that first, short parameterization
|
|
|
449
491
|
After the parameterization simulations are completed, running the command
|
|
450
492
|
|
|
451
493
|
```
|
|
452
|
-
gmx cphmd -s run.tpr -e run.edr -dvdl
|
|
494
|
+
gmx cphmd -s run.tpr -e run.edr -o cphmd.xvg -dvdl -nocoordinate
|
|
453
495
|
```
|
|
454
496
|
|
|
455
497
|
will yield a file `cphmd-dvdl-1-2.xvg` for which the second column contains the **dVdl** values of parameterized group. This should be done for each of the 13 parameterization simulations.
|
|
@@ -459,16 +501,16 @@ will yield a file `cphmd-dvdl-1-2.xvg` for which the second column contains the
|
|
|
459
501
|
To get the initial guess for dVdl coefficients, `fit_parameterization.py` needs to be run in the parameterization mode:
|
|
460
502
|
|
|
461
503
|
```
|
|
462
|
-
fit_parameterization.py -f MD.mdp -m p -g ARGT
|
|
504
|
+
python /path/to/phbuilder/scripts/fit_parameterization.py -f MD.mdp -m p -g ARGT
|
|
463
505
|
```
|
|
464
506
|
|
|
465
|
-
As an output, `fit_parameterization.py`
|
|
507
|
+
As an output, `fit_parameterization.py` writes an updated group entry for `lambdagrouptypes.dat` and a matching MDP block.
|
|
466
508
|
|
|
467
509
|
### 12. Perform replicates to test the obtained dVdl coefficients.
|
|
468
510
|
|
|
469
|
-
At this point, if everything went correctly, you have obtained an initial guess for the **dVdl** of your new titratable ligand. This concludes step one of the two-step parameterization protocol.
|
|
511
|
+
At this point, if everything went correctly, you have obtained an initial guess for the **dVdl** of your new titratable ligand. This concludes step one of the two-step parameterization protocol.
|
|
470
512
|
|
|
471
|
-
It is now time to test how the **dVdl** coefficients perform, and whether the second Boltzmann-reweighting step is required. For this, you can set up regular CpHMD simulations of the ligand in a box of water using the basic workflow.
|
|
513
|
+
It is now time to test how the **dVdl** coefficients perform, and whether the second Boltzmann-reweighting step is required. For this, you can set up regular CpHMD simulations of the ligand in a box of water using the basic workflow.
|
|
472
514
|
|
|
473
515
|
* You should not reuse simulation files from the parameterization but rather start from scratch following the basic workflow (but with the updated `lambdagrouptypes.dat`).
|
|
474
516
|
* When setting up the replicates, be sure that pH = ligand pKa and that `-dwpE 0` is specified for `genparams`.
|
|
@@ -479,10 +521,10 @@ When plotting the resulting $\lambda$-trajectories as a histogram, one should ob
|
|
|
479
521
|
|
|
480
522
|
### 13. If necessary, use inverse-Boltzmann to refine the parameterization.
|
|
481
523
|
|
|
482
|
-
If the
|
|
524
|
+
If the distributions are not flat, we will have to update the dVdl coefficients by adding the correction which should flatten the distribution. The correction for dVdl is computed as the derivative of $U(\lambda)$, where $U$ is the Boltzmann inversion of the distribution $p(\lambda)$: $U = -R T \log(p)$. To get this correction `fit_parameterization.py` needs to be run in reweighting mode:
|
|
483
525
|
|
|
484
526
|
```
|
|
485
|
-
python fit_parameterization.py -f MD.mdp -m s -g ARGT
|
|
527
|
+
python /path/to/phbuilder/scripts/fit_parameterization.py -f MD.mdp -m s -g ARGT
|
|
486
528
|
```
|
|
487
529
|
|
|
488
530
|
NOTE: To prevent issues, make sure your replica directories follow the naming format `s_1`, `s_2`, ..., `s_10`.
|
|
@@ -497,6 +539,22 @@ The reweighting can be repeated several times, but usually one repetition is eno
|
|
|
497
539
|
|
|
498
540
|
Figure: The initial guess for the **dVdl** coefficients for ARGT yields replicates for which the distributions are consistent but not flat (left). Upon performing the inverse-Boltzmann refinement and rerunning the replicates, the distributions are now both consistent and flat (right).
|
|
499
541
|
|
|
542
|
+
## Parameterize a coupled multisite group
|
|
543
|
+
|
|
544
|
+
Use a capped Ala–His–Ala peptide with one `HSPT` site and one buffer as a reference case. Prepare and equilibrate it at the protonated starting endpoint and generate a calibration MDP with `genparams -cal`. Supply all three state charge tables and their reference pKa values in `lambdagrouptypes.dat`. The shared artificial state is described in the methods paper. Run the fixed-lambda windows and extract all site derivatives and the buffer derivative for each window.
|
|
545
|
+
|
|
546
|
+
```sh
|
|
547
|
+
python /path/to/phbuilder/scripts/create_parameterization.py \
|
|
548
|
+
-f MD.mdp -c NPT.pdb -r NPT.pdb -p topol.top -n index.ndx --multisite --step 0.05
|
|
549
|
+
# Run gmx mdrun -s run.tpr -deffnm run in each r_* directory. Then, in each directory:
|
|
550
|
+
gmx cphmd -s run.tpr -e run.edr -o cphmd.xvg -dvdl -nocoordinate -numplot 4
|
|
551
|
+
# Back in the directory containing MD.mdp:
|
|
552
|
+
python /path/to/phbuilder/scripts/fit_parameterization.py \
|
|
553
|
+
-f MD.mdp -m p -g HSPT -fo 8 --discard 1000
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
The window generator fixes the site coordinates on `sum(lambda) = 1` and adjusts the buffer lambda to keep the starting charge constant. The fitter uses the site derivatives to recover one common potential and writes a coefficient row for each physical state. The printed RMSE measures agreement with the input windows. To validate the fit, compare derivative residuals on independent windows or replicas with their sampling uncertainty, then check that an independent histidine titration reproduces the reference microstate populations and pKa values. The `--discard` argument counts saved frames. Multisite fitting supports two or three coordinates, and inverse-Boltzmann refinement is available for single-site fits. [Fit method and validation targets](https://doi.org/10.1021/acs.jctc.2c00516) · [Polynomial fitting supplement](https://doi.org/10.1021/acs.jctc.2c00516.s003) · [GitLab #11](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/11)
|
|
557
|
+
|
|
500
558
|
# Running CpHMD simulations on HPC resources
|
|
501
559
|
|
|
502
560
|
To run CpHMD simulations on a cluster you will likely have to compile the CpHMD beta yourself. For this we suggest the following slurm script (modify as needed):
|
|
@@ -541,93 +599,42 @@ gmx mdrun -deffnm MD -x MD.xtc -npme 0 -nt $SLURM_JOB_CPUS_PER_NODE
|
|
|
541
599
|
|
|
542
600
|
This is assuming you have the gromacs-constantph beta located in your home `~` directory.
|
|
543
601
|
|
|
544
|
-
#
|
|
602
|
+
# Command-line reference
|
|
545
603
|
|
|
546
|
-
```
|
|
547
|
-
phbuilder gentopol
|
|
604
|
+
```sh
|
|
605
|
+
phbuilder gentopol --help
|
|
606
|
+
phbuilder neutralize --help
|
|
607
|
+
phbuilder genparams --help
|
|
548
608
|
```
|
|
549
609
|
|
|
550
|
-
|
|
610
|
+
The flags printed by each subcommand are authoritative. The [basic workflow](#basic-workflow) shows how to pass the outputs between commands.
|
|
551
611
|
|
|
552
|
-
|
|
612
|
+
# Troubleshooting and analysis
|
|
553
613
|
|
|
554
|
-
|
|
614
|
+
## Unexpected charge or exhausted solvent
|
|
555
615
|
|
|
556
|
-
|
|
616
|
+
The charge in a static topology can differ from the CpHMD charge measured by `neutralize`. Check which `lambdagrouptypes.dat` file was loaded, how its charges map to its ordered atom list, and the initial states in `phrecord.dat`. Avoid using `-ignw` to bypass a mismatch in the atom names or counts. For water insertion failures, compare the water count and name in the coordinates and topology, then inspect `builder.log` for the GROMACS diagnostic. [GitLab #38](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/38)
|
|
557
617
|
|
|
558
|
-
|
|
618
|
+
## A bound ligand stays protonated
|
|
559
619
|
|
|
560
|
-
|
|
561
|
-
|--------------|----------------|
|
|
562
|
-
| `-f` | [\<.pdb/.gro>] (required) <br /> Specify input structure file. |
|
|
563
|
-
| `-o` | [\<.pdb/.gro>] (phprocessed.pdb) <br /> Specify output structure file. |
|
|
564
|
-
| `-ph` | [\<float>] <br /> Specify intended simulation pH. Will be used together with the reference pKas of the titratable sites to auto set the initial lambdas. |
|
|
565
|
-
| `-v` | (no) <br /> Be more verbose. |
|
|
620
|
+
Compare matched ligand-in-water and bound-ligand simulations with the same force field, lambda parameters, and pH. Start independent replicas at both endpoints, repeat the neutralization for each starting state, and compare endpoint populations, transition counts and convergence. Sparse transitions can obscure a physical shift in pKa. If you vary the barrier to diagnose sampling, track that change separately from the comparison at the production barrier. [GitLab #41](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/41)
|
|
566
621
|
|
|
567
|
-
|
|
622
|
+
## Binding-energy analysis and gmxMMPBSA
|
|
568
623
|
|
|
569
|
-
|
|
570
|
-
phbuilder neutralize [-h] -f FILE [-p TOPOL] [-o OUTPUT] [-solname SOLNAME] [-pname PNAME] [-nname NNAME] [-conc CONC] [-nbufs NBUFS] [-rmin RMIN] [-ignw] [-v]
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
### DESCRIPTION
|
|
574
|
-
|
|
575
|
-
Adds the appropriate number of ions to ensure a net-neutral system at t=0, and adds buffer particles in order to maintain a net-neutral system at t>0. The system charge a t=0 depends on the chosen initial lambda (protonation) states. At t>0, protonation states can change dynamically, meaning the resulting charge difference needs to be 'absorbed' by buffer particles. Each buffer particle can absorb up to ±0.5 charge, and charge is distributed evenly across all buffers (-10 system charge and 100 BUF implies every BUF +0.1).
|
|
624
|
+
phbuilder has no direct interface for sending dynamically titrating trajectories to gmxMMPBSA. Use CpHMD populations to choose representative protonation states, then prepare consistent fixed-state complex, receptor and ligand inputs. Evaluate each state with the same analysis protocol. As a validation experiment, compare what the analysis reports for a fixed endpoint and a CpHMD endpoint with that same state before interpreting intermediate-lambda frames or pH-dependent energy decompositions. The reported pH trend in GitLab remains unexplained. [GitLab #31](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/31) · [GitLab #45](https://gitlab.com/gromacs-constantph/phbuilder/-/issues/45)
|
|
576
625
|
|
|
577
|
-
|
|
626
|
+
## Carrying lambda coordinates between equilibration stages
|
|
578
627
|
|
|
579
|
-
|
|
580
|
-
* Similar to [gmx genion](https://manual.gromacs.org/current/onlinehelp/gmx-genion.html), phbuilder neutralize neutralizes the system by *adding* ions to the input structure, not by removing or rebalancing existing ones. This implies the ion concentration in your output files cannot and will not be lower than the ion concentration in your input file.
|
|
628
|
+
[EQ_smart.py](scripts/EQ_smart.py) reads the last frame of the previous EDR and writes its lambda values into the next MDP. Use the same atom collections and ordering for both stages. Treat a lambda coordinate outside the fork's accepted range as a reason to inspect the parameterization, equilibration and buffer capacity.
|
|
581
629
|
|
|
582
|
-
|
|
630
|
+
# Testing
|
|
583
631
|
|
|
584
|
-
|
|
585
|
-
|--------------|----------------|
|
|
586
|
-
| `-f` | [\<.pdb/.gro>] (required) <br /> Specify input structure file. |
|
|
587
|
-
| `-p` | [\<.top>] (topol.top) <br /> Specify input topology file. |
|
|
588
|
-
| `-o` | [\<.pdb/.gro>] (phneutral.pdb) <br /> Specify output structure file. |
|
|
589
|
-
| `-solname` | [\<str>] (SOL) <br /> Specify solvent name (of which to replace molecules with ions and buffers). |
|
|
590
|
-
| `-pname` | [\<str>] (NA) <br /> Specify name of positive ion to use. |
|
|
591
|
-
| `-nname` | [\<str>] (CL) <br /> Specify name of negative ion to use. |
|
|
592
|
-
| `-conc` | [\<float>] (0.0) <br /> Specify ion concentration in mol/L. Note: uses solvent volume for calculating the required number of ions, not the periodic box volume as gmx genion does. |
|
|
593
|
-
| `-nbufs` | [\<int>] <br /> Specify number of buffer particles to add. If not set, $N_{\text{buf}} = 2N_{\text{sites}} + 1$. This ensures enough buffer particles will always be added, although you can likely get away with much less for larger systems. The GROMACS CpHMD beta MUST be sourced/loaded for neutralize to work correctly. |
|
|
594
|
-
| `-rmin` | [\<float>] (0.6) <br /> Set the minimum distance the ions and buffers should be placed from the solute.
|
|
595
|
-
| `-ignw` | (no) <br /> Ignore all gmx grompp warnings. |
|
|
596
|
-
| `-v` | (no) <br /> Be more verbose. |
|
|
632
|
+
Run these commands from the repository root.
|
|
597
633
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
634
|
+
```sh
|
|
635
|
+
python -m pip install -e '.[test]'
|
|
636
|
+
python -m pytest -m 'not integration'
|
|
637
|
+
PHBUILDER_GMX=/path/to/gmx python -m pytest --require-gromacs
|
|
602
638
|
```
|
|
603
639
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
Generates the CpHMD-specific `.mdp` and `.ndx` files. Will write generic EM.mdp EQ.mdp, and MD.mdp files for CHARMM36m and append the CpHMD parameters at the bottom. genparams requires the existence of a phrecord.dat file, which contains the initial lambda values and is created during the gentopol step. Note: if you previously used the auto feature (`-ph` flag) for gentopol, the pH you specify for genparams should reflect this.
|
|
607
|
-
|
|
608
|
-
### OPTIONS
|
|
609
|
-
|
|
610
|
-
| Flag______ | Description |
|
|
611
|
-
|--------------|----------------|
|
|
612
|
-
| `-f` | [\<.pdb/.gro>] (required) <br /> Specify input structure file. |
|
|
613
|
-
| `-ph` | [\<float>] (required) <br /> Specify simulation pH. |
|
|
614
|
-
| `-mdp` | [\<.mdp>] (MD.mdp) <br /> Specify `.mdp` file for the constant-pH parameters to be appended to. If the specified file does not exist, the `.mdp` file will be generated from scratch. Note that this only applies to production (MD), for energy minimization (EM) and equilibration (NVT/NPT), the .mdp files will be generated from scratch regardless. |
|
|
615
|
-
| `-ndx` | [\<.idx>] (index.ndx) <br /> Specify `.ndx` file to append the CpHMD index groups to. If not set or the specified file does not exist, a generic `index.ndx` will be created first. |
|
|
616
|
-
| `-nstout` | [\<int>] (500) <br /> Specify lambda coordinate output frequency. 500 is large enough for subsequent frames to be uncoupled (with a $dt = 0.002$).
|
|
617
|
-
| `-dwpE` | [\<float>] (7.5) <br /> Specify default height of bias potential barrier (kJ/mol).
|
|
618
|
-
| `-inter` | (no) <br /> Interactively set the height of the bias potential barrier (kJ/mol) for every titratable site.
|
|
619
|
-
| `-titr` | (no) <br /> Prepare files for running titrations with CpHMD: forces pH to be set to "ph" and ph-dependent pKa values to be written to MD.mdp as string. The `create_titration.py` script will further modify those entries according to the currently set ph. |
|
|
620
|
-
| `-cal` | (no) <br /> Run CpHMD simulation in calibration mode: forces on the lambda coordinates are computed, but their positions won't be updated. This is only used for parameterization purposes. |
|
|
621
|
-
| `-v` | (no) <br /> Be more verbose. |
|
|
622
|
-
|
|
623
|
-
# Tips, Tricks, and FAQ
|
|
624
|
-
|
|
625
|
-
* One can use the experimental [EQ_smart.py](scripts/EQ_smart.py) to perform a more sound CpHMD equilibration. When using this script, the lambda coordinates from the last frame of an equilibration step are extracted from the `.edr` file and inserted in the `.mdp` file for the next equilibration step.
|
|
626
|
-
|
|
627
|
-
**Q : Where are the default `charmm36-mar2019-cphmd.ff` and `lambdagrouptypes.dat` files located?**
|
|
628
|
-
|
|
629
|
-
A : To find out, run a `phbuilder` command with the `-v` flag. The path to the default files will be provided as extra user output.
|
|
630
|
-
|
|
631
|
-
**Q : What does `Condition: (lambdaCoordinate.x < 1.15 && lambdaCoordinate.x > -0.15) Lambda coordinate left the range for which it has been parametrised. Check your input parameters` mean?**
|
|
632
|
-
|
|
633
|
-
A : If you receive this error, it means one or more of your lambda coordinates moved outside the acceptable [-0.15, 1.15] range. Since V_wall (part of V_bias), which is applied to keep the lambda coordinate in the [0, 1] range, rises very steeply outside [0, 1], it means forces on the lambda coordinate were unacceptably high. This can happen if 1) your dV/dl coefficients / parameterization is incorrect, 2) your system wasn't properly equilibrated (try EQ_smart.py), 3) you didn't added enough buffer particles (forcing the buffer coordinate out of range).
|
|
640
|
+
The suite also detects `gmx-cph` or a CpHMD-capable `gmx` on `PATH`. Unit tests cover parameter parsing, files and setup scripts. The integration suite runs topology generation, solvent and buffer insertion, terminal sites, fixed-lambda calibration, and short simulations with checkpoint restart and lambda extraction.
|