phbuilder 1.1__py3-none-any.whl

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 (38) hide show
  1. phbuilder/__init__.py +16 -0
  2. phbuilder/ffield/charmm36-mar2019-cphmd.ff/atomtypes.atp +455 -0
  3. phbuilder/ffield/charmm36-mar2019-cphmd.ff/cmap.itp +1025 -0
  4. phbuilder/ffield/charmm36-mar2019-cphmd.ff/ffbonded.itp +19675 -0
  5. phbuilder/ffield/charmm36-mar2019-cphmd.ff/ffnonbonded.itp +40366 -0
  6. phbuilder/ffield/charmm36-mar2019-cphmd.ff/forcefield.doc +252 -0
  7. phbuilder/ffield/charmm36-mar2019-cphmd.ff/forcefield.itp +26 -0
  8. phbuilder/ffield/charmm36-mar2019-cphmd.ff/gb.itp +49 -0
  9. phbuilder/ffield/charmm36-mar2019-cphmd.ff/ions.itp +98 -0
  10. phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.arn +6 -0
  11. phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.c.tdb +76 -0
  12. phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.hdb +414 -0
  13. phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.n.tdb +93 -0
  14. phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.r2b +16 -0
  15. phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.rtp +123316 -0
  16. phbuilder/ffield/charmm36-mar2019-cphmd.ff/merged.vsd +221 -0
  17. phbuilder/ffield/charmm36-mar2019-cphmd.ff/nbfix.itp +101 -0
  18. phbuilder/ffield/charmm36-mar2019-cphmd.ff/old_c36_cmap.itp +486 -0
  19. phbuilder/ffield/charmm36-mar2019-cphmd.ff/popc.itp +1279 -0
  20. phbuilder/ffield/charmm36-mar2019-cphmd.ff/spc.itp +30 -0
  21. phbuilder/ffield/charmm36-mar2019-cphmd.ff/spce.itp +30 -0
  22. phbuilder/ffield/charmm36-mar2019-cphmd.ff/tip3p.itp +49 -0
  23. phbuilder/ffield/charmm36-mar2019-cphmd.ff/tip4p.itp +53 -0
  24. phbuilder/ffield/charmm36-mar2019-cphmd.ff/watermodels.dat +6 -0
  25. phbuilder/ffield/lambdagrouptypes.dat +40 -0
  26. phbuilder/ffield/residuetypes.dat +211 -0
  27. phbuilder/mdp.py +133 -0
  28. phbuilder/parsecmdline.py +228 -0
  29. phbuilder/phbuilder.py +1408 -0
  30. phbuilder/sanitize.py +180 -0
  31. phbuilder/structure.py +333 -0
  32. phbuilder/user.py +142 -0
  33. phbuilder-1.1.dist-info/LICENSE +674 -0
  34. phbuilder-1.1.dist-info/METADATA +609 -0
  35. phbuilder-1.1.dist-info/RECORD +38 -0
  36. phbuilder-1.1.dist-info/WHEEL +5 -0
  37. phbuilder-1.1.dist-info/entry_points.txt +2 -0
  38. phbuilder-1.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,228 @@
1
+ # PYTHON_ARGCOMPLETE_OK
2
+
3
+ import argparse
4
+ import argcomplete
5
+ import sys
6
+
7
+
8
+ def parsecmdline():
9
+ """Parses command line using the python argparse module.
10
+
11
+ Returns:
12
+ CLI: object containing all the parsed key-value pairs.
13
+ """
14
+
15
+ # phbuilder main description.
16
+ 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 Asp, Glu, and His residues in CHARMM36m."
17
+
18
+ # Epilogue. Also used by subcommands.
19
+ desc_2 = "phbuilder VERSION 1.1. For the user manual visit https://gitlab.com/gromacs-constantph/phbuilder."
20
+
21
+ # gentopol main description.
22
+ 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."
23
+
24
+ # neutralize main description.
25
+ desc_4 = "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)."
26
+
27
+ # genparams main description.
28
+ 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
+
30
+ parser = argparse.ArgumentParser(prog='phbuilder', description=desc_1, epilog=desc_2)
31
+
32
+ subparsers = parser.add_subparsers(required=False)
33
+
34
+ parser_1 = subparsers.add_parser('gentopol', help=desc_3, epilog=desc_2)
35
+ required1 = parser_1.add_argument_group("required arguments")
36
+
37
+ required1.add_argument('-f',
38
+ required=True,
39
+ dest='file',
40
+ action='store',
41
+ help='[<.pdb/.gro>] (required) Specify input structure file.')
42
+
43
+ parser_1.add_argument('-o',
44
+ required=False,
45
+ dest='output',
46
+ action='store',
47
+ default='phprocessed.pdb',
48
+ help='[<.pdb/.gro>] (phprocessed.pdb) Specify output structure file.')
49
+
50
+ parser_1.add_argument('-ph',
51
+ required=False,
52
+ dest='ph',
53
+ 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.',
55
+ type=float)
56
+
57
+ parser_1.add_argument('-v',
58
+ required=False,
59
+ dest='verbosity',
60
+ action='store_const',
61
+ const=1,
62
+ help='(no) Be more verbose.')
63
+
64
+ parser_1.set_defaults(target='gentopol')
65
+
66
+ parser_2 = subparsers.add_parser('neutralize', help=desc_4, epilog=desc_2)
67
+ required2 = parser_2.add_argument_group("required arguments")
68
+
69
+ required2.add_argument('-f',
70
+ required=True,
71
+ dest='file',
72
+ action='store',
73
+ help='[<.pdb/.gro>] (required) Specify input structure file.')
74
+
75
+ required2.add_argument('-p',
76
+ required=False,
77
+ dest='topol',
78
+ action='store',
79
+ default='topol.top',
80
+ help='[<.top>] (topol.top) Specify input topology file.')
81
+
82
+ parser_2.add_argument('-o',
83
+ required=False,
84
+ dest='output',
85
+ action='store',
86
+ default='phneutral.pdb',
87
+ help='[<.pdb/.gro>] (phneutral.pdb) Specify output structure file.')
88
+
89
+ parser_2.add_argument('-solname',
90
+ required=False,
91
+ dest='solname',
92
+ action='store',
93
+ default='SOL',
94
+ help=' [<str>] (SOL) Specify solvent name (of which to replace molecules with ions and buffers).')
95
+
96
+ parser_2.add_argument('-pname',
97
+ required=False,
98
+ dest='pname',
99
+ action='store',
100
+ default='NA',
101
+ help='[<str>] (NA) Specify name of positive ion to use.')
102
+
103
+ parser_2.add_argument('-nname',
104
+ required=False,
105
+ dest='nname',
106
+ action='store',
107
+ default='CL',
108
+ help='[<str>] (CL) Specify name of negative ion to use.')
109
+
110
+ parser_2.add_argument('-conc',
111
+ required=False,
112
+ dest='conc',
113
+ action='store',
114
+ default=0.0,
115
+ help='[<float>] (0.0) 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.',
116
+ type=float)
117
+
118
+ parser_2.add_argument('-nbufs',
119
+ required=False,
120
+ dest='nbufs',
121
+ action='store',
122
+ help="[<int>] Specify number of buffer particles to add. If not set, N_buf = 2N_sites + 1. This ensures enough buffer particles will always be added, although you can likely get away with much less for larger systems.",
123
+ type=int)
124
+
125
+ parser_2.add_argument('-rmin',
126
+ required=False,
127
+ dest='rmin',
128
+ action='store',
129
+ default=0.60,
130
+ help='[<float>] (0.6) Set the minimum distance the ions and buffers should be placed from the solute.',
131
+ type=float)
132
+
133
+ parser_2.add_argument('-ignw',
134
+ required=False,
135
+ dest='ignw',
136
+ action='store_const',
137
+ const=1,
138
+ help='(no) Ignore all gmx grompp warnings.')
139
+
140
+ parser_2.add_argument('-v',
141
+ required=False,
142
+ dest='verbosity',
143
+ action='store_const',
144
+ const=1,
145
+ help='(no) Be more verbose.')
146
+
147
+ parser_2.set_defaults(target='neutralize')
148
+
149
+ parser_3 = subparsers.add_parser('genparams', help=desc_5, epilog=desc_2)
150
+ required3 = parser_3.add_argument_group("required arguments")
151
+
152
+ required3.add_argument('-f',
153
+ required=True,
154
+ dest='file',
155
+ action='store',
156
+ help='[<.pdb/.gro>] (required) Specify input structure file.')
157
+
158
+ required3.add_argument('-ph',
159
+ required=True,
160
+ dest='ph',
161
+ action='store',
162
+ help='[<float>] (required) Specify simulation pH.',
163
+ type=float)
164
+
165
+ parser_3.add_argument('-mdp',
166
+ required=False,
167
+ dest='mdp',
168
+ action='store',
169
+ help='[<.mdp>] (MD.mdp) 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.')
170
+
171
+ parser_3.add_argument('-ndx',
172
+ required=False,
173
+ dest='ndx',
174
+ action='store',
175
+ help="[<.idx>] (index.ndx) 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.")
176
+
177
+ parser_3.add_argument('-nstout',
178
+ required=False,
179
+ dest='nstout',
180
+ action='store',
181
+ default=500,
182
+ help='[<int>] (500) Specify lambda coordinate output frequency. 500 is large enough for subsequent frames to be uncoupled (with a dt = 0.002).',
183
+ type=int)
184
+
185
+ parser_3.add_argument('-dwpE',
186
+ required=False,
187
+ dest='dwpE',
188
+ action='store',
189
+ default=7.5,
190
+ help='[<float>] (7.5) Specify default height of bias potential barrier (kJ/mol).',
191
+ type=float)
192
+
193
+ parser_3.add_argument('-inter',
194
+ required=False,
195
+ dest='inter',
196
+ action='store_const',
197
+ const=1,
198
+ help='(no) Interactively set the height of the bias potential barrier (kJ/mol) for every titratable site.')
199
+
200
+ parser_3.add_argument('-cal',
201
+ required=False,
202
+ dest='cal',
203
+ action='store_const',
204
+ const=1,
205
+ help="(no) 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.")
206
+
207
+ parser_3.add_argument('-v',
208
+ required=False,
209
+ dest='verbosity',
210
+ action='store_const',
211
+ const=1,
212
+ help='(no) Be more verbose.')
213
+
214
+ parser_3.set_defaults(target='genparams')
215
+
216
+ # Required for auto-completing using argcomplete.
217
+ argcomplete.autocomplete(parser)
218
+
219
+ # Do the actual parsing.
220
+ CLI = parser.parse_args()
221
+
222
+ # Prevent Python errors when no subcommand is specified.
223
+ if vars(CLI) == {}:
224
+ parser.print_help()
225
+ sys.exit(0)
226
+
227
+ # Object containing all the parsed key-value pairs.
228
+ return CLI