phbuilder 1.2.4__tar.gz → 1.3__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.
Files changed (49) hide show
  1. {phbuilder-1.2.4 → phbuilder-1.3}/PKG-INFO +24 -21
  2. {phbuilder-1.2.4 → phbuilder-1.3}/README.md +21 -20
  3. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/__init__.py +8 -4
  4. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/lambdagrouptypes.dat +1 -1
  5. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/parsecmdline.py +21 -8
  6. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/phbuilder.py +142 -90
  7. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/sanitize.py +85 -48
  8. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/structure.py +20 -19
  9. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/user.py +4 -5
  10. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder.egg-info/PKG-INFO +24 -21
  11. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder.egg-info/SOURCES.txt +10 -1
  12. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder.egg-info/requires.txt +2 -0
  13. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder.egg-info/top_level.txt +1 -0
  14. {phbuilder-1.2.4 → phbuilder-1.3}/pyproject.toml +2 -1
  15. {phbuilder-1.2.4 → phbuilder-1.3}/setup.cfg +3 -1
  16. phbuilder-1.3/tests/__init__.py +0 -0
  17. phbuilder-1.3/tests/test_genparams.py +46 -0
  18. phbuilder-1.3/tests/test_gentopol.py +32 -0
  19. phbuilder-1.3/tests/test_neutralize.py +18 -0
  20. phbuilder-1.3/tests/testutils.py +47 -0
  21. {phbuilder-1.2.4 → phbuilder-1.3}/LICENSE +0 -0
  22. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/README.md +0 -0
  23. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/atomtypes.atp +0 -0
  24. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/cmap.itp +0 -0
  25. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/ffbonded.itp +0 -0
  26. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/ffnonbonded.itp +0 -0
  27. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/forcefield.doc +0 -0
  28. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/forcefield.itp +0 -0
  29. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/gb.itp +0 -0
  30. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/ions.itp +0 -0
  31. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.arn +0 -0
  32. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.c.tdb +0 -0
  33. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.hdb +0 -0
  34. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.n.tdb +0 -0
  35. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.r2b +0 -0
  36. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.rtp +0 -0
  37. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.vsd +0 -0
  38. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/nbfix.itp +0 -0
  39. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/old_c36_cmap.itp +0 -0
  40. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/popc.itp +0 -0
  41. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/spc.itp +0 -0
  42. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/spce.itp +0 -0
  43. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/tip3p.itp +0 -0
  44. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/tip4p.itp +0 -0
  45. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/charmm36-mar2019-cphmd.ff/watermodels.dat +0 -0
  46. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/ffield/residuetypes.dat +0 -0
  47. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder/mdp.py +0 -0
  48. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder.egg-info/dependency_links.txt +0 -0
  49. {phbuilder-1.2.4 → phbuilder-1.3}/phbuilder.egg-info/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phbuilder
3
- Version: 1.2.4
3
+ Version: 1.3
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
@@ -18,6 +18,8 @@ Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: argcomplete>=3.1.1
20
20
  Requires-Dist: configparser>=6.0.0
21
+ Requires-Dist: sympy>=1.12
22
+ Requires-Dist: numpy
21
23
 
22
24
  <div style="width: 830px">
23
25
 
@@ -134,6 +136,13 @@ If you don't want to manually set initial lambda values, you can use the `-ph <p
134
136
  phbuilder gentopol -f input.pdb -ph <ph>
135
137
  ```
136
138
 
139
+ Furthermore, if you only want certain residue types to be made titratable, you can use the `-groups` flag. For example:
140
+
141
+ ```
142
+ phbuilder gentopol -f input.pdb -groups "ASPT GLUT"
143
+ ```
144
+
145
+ only considers aspartate and glutamate residues for setting up the CpHMD simulation.
137
146
  ### 4. Add a periodic box and solvent (if not already present).
138
147
 
139
148
  Periodic box (see [gmx editconf](https://manual.gromacs.org/documentation/current/onlinehelp/gmx-editconf.html)):
@@ -239,7 +248,7 @@ gmx cphmd -s MD.tpr -e MD.edr -numplot 1
239
248
 
240
249
  # Performing titrations
241
250
 
242
- Performing a computational titration is helpful for determining the microscopic pKas 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 setup a titration. For example, the command:
251
+ 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 setup a titration. For example, the command:
243
252
 
244
253
  ```
245
254
  create_titration.py -f MD.mdp -c NPT.pdb -p topol.top -n index.ndx -pH 1:10:1 -nr 2
@@ -247,21 +256,13 @@ create_titration.py -f MD.mdp -c NPT.pdb -p topol.top -n index.ndx -pH 1:10:1 -n
247
256
 
248
257
  creates directories corresponding to pH 1 to 9, with each subdirectory containing two replicates (each containing the appropriate input files for `gmx mdrun`).
249
258
 
250
- **NOTE** `create_titration.py` currently requires small modifications of `MD.mdp` file. In case of multisite groups (e.g. histidine), one of the $\lambda$-coordinates (usually the first coordinate associated with the multisite group) should have pH value equal to $\text{p}K_\text{a}$ (check [manual](https://gitlab.com/gromacs-constantph/constantph/-/blob/main/manual/constantph_usage.md)). To achieve this, `create_titration.py` searches through the **.mdp** file, and if it sees pH and $\text{p}K_\text{a}$ in one line, it replaces pH with actual numeric value. This will ensure the correct set up at all pH values. To give an example:
251
- ```
252
- lambda-dynamics-group-type3-state-1-reference-pka = pH
253
- ```
254
- this line will be sequentially changed to
259
+ The minor change is at step 7. When parameters are generated, `phbuilder genparams` needs to be called with the `-titr` option:
260
+
255
261
  ```
256
- lambda-dynamics-group-type3-state-1-reference-pka = 1.0
257
- lambda-dynamics-group-type3-state-1-reference-pka = 2.0
258
- lambda-dynamics-group-type3-state-1-reference-pka = 3.0
259
- ...
262
+ phbuilder genparams -f phneutral.pdb -ph 4.0 -titr
260
263
  ```
261
- in the corresponding folders.
262
-
263
264
 
264
- **NOTE** This behaviour will change in the next release of the code.
265
+ 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 somulation. 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.
265
266
 
266
267
  # Performing parameterizations
267
268
 
@@ -405,15 +406,15 @@ will position restrain only atom 19. Position restraining during the parameteriz
405
406
 
406
407
  ### 5. Perform solvation and neutralization to obtain a net-neutral simulation system.
407
408
 
408
- * When performing the neutralization step, we want to add only one buffer particle, and we want the buffer to be at least 2 nm away from the tripeptide. We therefore set the `-nbufs 1` and `-rmin 2.0` flags.
409
- * To prevent finite-size effects for small simulation boxes, we recommend using a simulation box of 5 nm cubed for the paramterization and replica simulations.
409
+ * 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.
410
+ * To prevent finite-size effects for small simulation boxes, we recommend using a simulation box of at least 5 nm cubed for the paramterization and replica simulations.
410
411
  * 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).
411
412
  * 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).
412
413
 
413
414
  ```
414
- gmx editconf -f phprocessed.pdb -o box.pdb -bt cubic -d 1.8
415
+ gmx editconf -f phprocessed.pdb -o box.pdb -bt cubic -d 2.0
415
416
  gmx solvate -cp box.pdb -p topol.top -o solvated.pdb
416
- phbuilder neutralize -f solvated.pdb -nbufs 1 -rmin 2.0 -conc 0.15
417
+ phbuilder neutralize -f solvated.pdb -nbufs 1 -rmin 1.5 -conc 0.15
417
418
  ```
418
419
 
419
420
  ### 6. Use `genparams` to generate the `.mdp` files in calibration mode.
@@ -563,11 +564,12 @@ Allows you to select which residues to make titratable and which initial lambda
563
564
 
564
565
  OPTIONS
565
566
 
566
- | Flag__ | Description |
567
+ | Flag____ | Description |
567
568
  |--------------|----------------|
568
569
  | `-f` | [\<.pdb/.gro>] (required) <br /> Specify input structure file. |
569
570
  | `-o` | [\<.pdb/.gro>] (phprocessed.pdb) <br /> Specify output structure file. |
570
- | `-ph` | [\<float>] <br /> Specify intended simulation pH. Will be used together with the macroscopic pKas of the titratable sites to auto set the initial lambdas. |
571
+ | `-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. |
572
+ | `-groups` | [\<str>] <br /> Specify which titratable residue types to consider. Example: "ASPT GLUT" will only consider Asp and Glu residues for CpHMD. |
571
573
  | `-v` | (no) <br /> Be more verbose. |
572
574
 
573
575
  # Synopsis `phbuilder neutralize`
@@ -604,7 +606,7 @@ Adds the appropriate number of ions to ensure a net-neutral system at t=0, and a
604
606
  # Synopsis `phbuilder genparams`
605
607
 
606
608
  ```
607
- phbuilder genparams [-h] -f FILE -ph PH [-mdp MDP] [-ndx NDX] [-nstout NSTOUT] [-dwpE DWPE] [-inter] [-cal] [-v]
609
+ phbuilder genparams [-h] -f FILE -ph PH [-mdp MDP] [-ndx NDX] [-nstout NSTOUT] [-dwpE DWPE] [-inter] [-titr] [-cal] [-v]
608
610
  ```
609
611
 
610
612
  ### DESCRIPTION
@@ -622,6 +624,7 @@ Generates the CpHMD-specific `.mdp` and `.ndx` files. Will write generic EM.mdp
622
624
  | `-nstout` | [\<int>] (500) <br /> Specify lambda coordinate output frequency. 500 is large enough for subsequent frames to be uncoupled (with a $dt = 0.002$).
623
625
  | `-dwpE` | [\<float>] (7.5) <br /> Specify default height of bias potential barrier (kJ/mol).
624
626
  | `-inter` | (no) <br /> Interactively set the height of the bias potential barrier (kJ/mol) for every titratable site.
627
+ | `-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. |
625
628
  | `-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. |
626
629
  | `-v` | (no) <br /> Be more verbose. |
627
630
 
@@ -113,6 +113,13 @@ If you don't want to manually set initial lambda values, you can use the `-ph <p
113
113
  phbuilder gentopol -f input.pdb -ph <ph>
114
114
  ```
115
115
 
116
+ Furthermore, if you only want certain residue types to be made titratable, you can use the `-groups` flag. For example:
117
+
118
+ ```
119
+ phbuilder gentopol -f input.pdb -groups "ASPT GLUT"
120
+ ```
121
+
122
+ only considers aspartate and glutamate residues for setting up the CpHMD simulation.
116
123
  ### 4. Add a periodic box and solvent (if not already present).
117
124
 
118
125
  Periodic box (see [gmx editconf](https://manual.gromacs.org/documentation/current/onlinehelp/gmx-editconf.html)):
@@ -218,7 +225,7 @@ gmx cphmd -s MD.tpr -e MD.edr -numplot 1
218
225
 
219
226
  # Performing titrations
220
227
 
221
- Performing a computational titration is helpful for determining the microscopic pKas 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 setup a titration. For example, the command:
228
+ 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 setup a titration. For example, the command:
222
229
 
223
230
  ```
224
231
  create_titration.py -f MD.mdp -c NPT.pdb -p topol.top -n index.ndx -pH 1:10:1 -nr 2
@@ -226,21 +233,13 @@ create_titration.py -f MD.mdp -c NPT.pdb -p topol.top -n index.ndx -pH 1:10:1 -n
226
233
 
227
234
  creates directories corresponding to pH 1 to 9, with each subdirectory containing two replicates (each containing the appropriate input files for `gmx mdrun`).
228
235
 
229
- **NOTE** `create_titration.py` currently requires small modifications of `MD.mdp` file. In case of multisite groups (e.g. histidine), one of the $\lambda$-coordinates (usually the first coordinate associated with the multisite group) should have pH value equal to $\text{p}K_\text{a}$ (check [manual](https://gitlab.com/gromacs-constantph/constantph/-/blob/main/manual/constantph_usage.md)). To achieve this, `create_titration.py` searches through the **.mdp** file, and if it sees pH and $\text{p}K_\text{a}$ in one line, it replaces pH with actual numeric value. This will ensure the correct set up at all pH values. To give an example:
230
- ```
231
- lambda-dynamics-group-type3-state-1-reference-pka = pH
232
- ```
233
- this line will be sequentially changed to
236
+ The minor change is at step 7. When parameters are generated, `phbuilder genparams` needs to be called with the `-titr` option:
237
+
234
238
  ```
235
- lambda-dynamics-group-type3-state-1-reference-pka = 1.0
236
- lambda-dynamics-group-type3-state-1-reference-pka = 2.0
237
- lambda-dynamics-group-type3-state-1-reference-pka = 3.0
238
- ...
239
+ phbuilder genparams -f phneutral.pdb -ph 4.0 -titr
239
240
  ```
240
- in the corresponding folders.
241
-
242
241
 
243
- **NOTE** This behaviour will change in the next release of the code.
242
+ 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 somulation. 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.
244
243
 
245
244
  # Performing parameterizations
246
245
 
@@ -384,15 +383,15 @@ will position restrain only atom 19. Position restraining during the parameteriz
384
383
 
385
384
  ### 5. Perform solvation and neutralization to obtain a net-neutral simulation system.
386
385
 
387
- * When performing the neutralization step, we want to add only one buffer particle, and we want the buffer to be at least 2 nm away from the tripeptide. We therefore set the `-nbufs 1` and `-rmin 2.0` flags.
388
- * To prevent finite-size effects for small simulation boxes, we recommend using a simulation box of 5 nm cubed for the paramterization and replica simulations.
386
+ * 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.
387
+ * To prevent finite-size effects for small simulation boxes, we recommend using a simulation box of at least 5 nm cubed for the paramterization and replica simulations.
389
388
  * 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).
390
389
  * 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).
391
390
 
392
391
  ```
393
- gmx editconf -f phprocessed.pdb -o box.pdb -bt cubic -d 1.8
392
+ gmx editconf -f phprocessed.pdb -o box.pdb -bt cubic -d 2.0
394
393
  gmx solvate -cp box.pdb -p topol.top -o solvated.pdb
395
- phbuilder neutralize -f solvated.pdb -nbufs 1 -rmin 2.0 -conc 0.15
394
+ phbuilder neutralize -f solvated.pdb -nbufs 1 -rmin 1.5 -conc 0.15
396
395
  ```
397
396
 
398
397
  ### 6. Use `genparams` to generate the `.mdp` files in calibration mode.
@@ -542,11 +541,12 @@ Allows you to select which residues to make titratable and which initial lambda
542
541
 
543
542
  OPTIONS
544
543
 
545
- | Flag__ | Description |
544
+ | Flag____ | Description |
546
545
  |--------------|----------------|
547
546
  | `-f` | [\<.pdb/.gro>] (required) <br /> Specify input structure file. |
548
547
  | `-o` | [\<.pdb/.gro>] (phprocessed.pdb) <br /> Specify output structure file. |
549
- | `-ph` | [\<float>] <br /> Specify intended simulation pH. Will be used together with the macroscopic pKas of the titratable sites to auto set the initial lambdas. |
548
+ | `-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. |
549
+ | `-groups` | [\<str>] <br /> Specify which titratable residue types to consider. Example: "ASPT GLUT" will only consider Asp and Glu residues for CpHMD. |
550
550
  | `-v` | (no) <br /> Be more verbose. |
551
551
 
552
552
  # Synopsis `phbuilder neutralize`
@@ -583,7 +583,7 @@ Adds the appropriate number of ions to ensure a net-neutral system at t=0, and a
583
583
  # Synopsis `phbuilder genparams`
584
584
 
585
585
  ```
586
- phbuilder genparams [-h] -f FILE -ph PH [-mdp MDP] [-ndx NDX] [-nstout NSTOUT] [-dwpE DWPE] [-inter] [-cal] [-v]
586
+ phbuilder genparams [-h] -f FILE -ph PH [-mdp MDP] [-ndx NDX] [-nstout NSTOUT] [-dwpE DWPE] [-inter] [-titr] [-cal] [-v]
587
587
  ```
588
588
 
589
589
  ### DESCRIPTION
@@ -601,6 +601,7 @@ Generates the CpHMD-specific `.mdp` and `.ndx` files. Will write generic EM.mdp
601
601
  | `-nstout` | [\<int>] (500) <br /> Specify lambda coordinate output frequency. 500 is large enough for subsequent frames to be uncoupled (with a $dt = 0.002$).
602
602
  | `-dwpE` | [\<float>] (7.5) <br /> Specify default height of bias potential barrier (kJ/mol).
603
603
  | `-inter` | (no) <br /> Interactively set the height of the bias potential barrier (kJ/mol) for every titratable site.
604
+ | `-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. |
604
605
  | `-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. |
605
606
  | `-v` | (no) <br /> Be more verbose. |
606
607
 
@@ -1,16 +1,20 @@
1
1
  # PYTHON_ARGCOMPLETE_OK
2
2
 
3
3
  def entryFunction():
4
+ """Entry point for phbuilder. When phbuilder is run, this function is
5
+ called first.
6
+ """
7
+
4
8
  # PYTHON_ARGCOMPLETE_OK
5
9
 
6
10
  # Execute this as soon as possible because of the TAB autocomplete thing.
7
- from . import parsecmdline
11
+ from .parsecmdline import parsecmdline
8
12
 
9
13
  # Parse command line input.
10
- CLI = parsecmdline.parsecmdline()
14
+ CLI = parsecmdline()
11
15
 
12
16
  # Import everything else.
13
- from . import phbuilder
17
+ from .phbuilder import phbuilder
14
18
 
15
19
  # Run main program.
16
- phbuilder.phbuilder(CLI).runner()
20
+ return phbuilder(CLI).runner()
@@ -22,7 +22,7 @@ dvdl_1 = 59.636 -429.770 514.370 -204.910 -558.210 27.157
22
22
  incl = HIS HIS1 HISA HISB HISH HISD HISE HISP HSD HSE HSP
23
23
  atoms = CB CD2 HD2 CG NE2 HE2 ND1 HD1 CE1 HE1
24
24
  qqA = 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
25
- pKa_1 = 0.0
25
+ pKa_1 = ph
26
26
  qqB_1 = -0.05 0.19 0.13 0.19 -0.51 0.44 -0.51 0.44 0.32 0.18
27
27
  dvdl_1 = -3015.4 -13444.1 -34779. -44335.5 -31383.1 -13684.4 -4905.57 106.148 -484.107 11865.5 48985.4 104163. 103612. 59628.7 25794.9 3490.9 2180.34 -18552.6 -70083.6 -117174. -91492.5 -47959.2 -12542.4 -3968.74 14751.8 49997.8 63417.3 42048.3 16441.1 3929.98 -6193.44 -18113.5 -17591.7 -9832.74 -2246.33 934.809 2225.21 1887.54 594.263 402.485 604.077 158.757 -463.471 -193.458 82.6296
28
28
  pKa_2 = 6.53
@@ -1,8 +1,7 @@
1
1
  # PYTHON_ARGCOMPLETE_OK
2
2
 
3
- import argparse
4
- import argcomplete
5
- import sys
3
+ from argparse import ArgumentParser
4
+ from argcomplete import autocomplete
6
5
 
7
6
 
8
7
  def parsecmdline():
@@ -16,7 +15,7 @@ def parsecmdline():
16
15
  desc_1 = "System builder for constant-pH simulations in GROMACS. phbuilder consists of three tools: gentopol, neutralize, and genparams. Each tool performs a specific task for preparing a constant-pH simulation. Functionality for setting up titrations and parameterizations is provided with the help of stand-alone Python scripts, provided on the gitlab. Out of the box, phbuilder comes with the force field and CpHMD topology parameters required for setting up titratable Arg, Lys, Asp, Glu, and His residues in CHARMM36m."
17
16
 
18
17
  # Epilogue. Also used by subcommands.
19
- desc_2 = "phbuilder VERSION 1.2.4. For the user manual visit https://gitlab.com/gromacs-constantph/phbuilder."
18
+ desc_2 = "phbuilder VERSION 1.3. For the user manual visit https://gitlab.com/gromacs-constantph/phbuilder."
20
19
 
21
20
  # gentopol main description.
22
21
  desc_3 = "Allows you to select which residues to make titratable and which initial lambda (protonation) state they should have. Also (re)generates the system topology using the modified CHARMM36m force field. If you don't want to manually set initial lambda values, you can use the -ph flag to have gentopol automatically choose the appropriate initial lambda values, based on the criterion: pH > pKa means start deprotonated, else start protonated."
@@ -27,7 +26,7 @@ def parsecmdline():
27
26
  # genparams main description.
28
27
  desc_5 = "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."
29
28
 
30
- parser = argparse.ArgumentParser(prog='phbuilder', description=desc_1, epilog=desc_2)
29
+ parser = ArgumentParser(prog='phbuilder', description=desc_1, epilog=desc_2)
31
30
 
32
31
  subparsers = parser.add_subparsers(required=False)
33
32
 
@@ -51,9 +50,15 @@ def parsecmdline():
51
50
  required=False,
52
51
  dest='ph',
53
52
  action='store',
54
- help='[<float>] Specify intended simulation pH. Will be used together with the macroscopic pKas of the titratable sites to auto set the initial lambdas.',
53
+ help='[<float>] Specify intended simulation pH. Will be used together with the reference pKas of the titratable sites to auto set the initial lambdas.',
55
54
  type=float)
56
55
 
56
+ parser_1.add_argument('-groups',
57
+ required=False,
58
+ dest='groups',
59
+ action='store',
60
+ help='[<str>] Specify which titratable residue types to consider. Example: \"ASPT GLUT\" will only consider Asp and Glu residues for CpHMD. Also residue alternative name (e.g. \"ASP GLU\") can be provided.')
61
+
57
62
  parser_1.add_argument('-v',
58
63
  required=False,
59
64
  dest='verbosity',
@@ -197,6 +202,13 @@ def parsecmdline():
197
202
  const=1,
198
203
  help='(no) Interactively set the height of the bias potential barrier (kJ/mol) for every titratable site.')
199
204
 
205
+ parser_3.add_argument('-titr',
206
+ required=False,
207
+ dest='titr',
208
+ action='store_const',
209
+ const=1,
210
+ help="(no) Prepare files for CpHMD titration. This will leave all pH-dependent pKa values as they are in lambdagrouptypes.dat. Those will be further modified by the create_titration.py script.")
211
+
200
212
  parser_3.add_argument('-cal',
201
213
  required=False,
202
214
  dest='cal',
@@ -214,7 +226,7 @@ def parsecmdline():
214
226
  parser_3.set_defaults(target='genparams')
215
227
 
216
228
  # Required for auto-completing using argcomplete.
217
- argcomplete.autocomplete(parser)
229
+ autocomplete(parser)
218
230
 
219
231
  # Do the actual parsing.
220
232
  CLI = parser.parse_args()
@@ -222,7 +234,8 @@ def parsecmdline():
222
234
  # Prevent Python errors when no subcommand is specified.
223
235
  if vars(CLI) == {}:
224
236
  parser.print_help()
225
- sys.exit(0)
237
+ from sys import exit # Lazy/deffered import.
238
+ exit(0)
226
239
 
227
240
  # Object containing all the parsed key-value pairs.
228
241
  return CLI