|
13 | 13 | "id": "7266db2c-37e5-419a-9015-929ea1635d98", |
14 | 14 | "metadata": {}, |
15 | 15 | "source": [ |
16 | | - "In this notebook we run an MD simulation of benzene bound to T4-lysozyme L99A." |
| 16 | + "In this notebook we run an MD simulation of benzene bound to T4-lysozyme L99A.\n", |
| 17 | + "\n", |
| 18 | + "<img src=\"assets/t4lyso.png\" width=\"400\">" |
17 | 19 | ] |
18 | 20 | }, |
19 | 21 | { |
|
76 | 78 | }, |
77 | 79 | { |
78 | 80 | "cell_type": "code", |
79 | | - "execution_count": null, |
| 81 | + "execution_count": 1, |
80 | 82 | "id": "6559bc05", |
81 | 83 | "metadata": {}, |
82 | 84 | "outputs": [], |
|
87 | 89 | "if \"COLAB_RELEASE_TAG\" in os.environ:\n", |
88 | 90 | " !pip install -q condacolab\n", |
89 | 91 | " import condacolab\n", |
90 | | - " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")" |
| 92 | + " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/openfe/releases/download/v1.7.0/OpenFEforge-1.7.0-Linux-x86_64.sh\")" |
91 | 93 | ] |
92 | 94 | }, |
93 | 95 | { |
94 | 96 | "cell_type": "code", |
95 | | - "execution_count": null, |
| 97 | + "execution_count": 2, |
96 | 98 | "id": "eb1368ca", |
97 | 99 | "metadata": {}, |
98 | 100 | "outputs": [], |
|
134 | 136 | }, |
135 | 137 | { |
136 | 138 | "cell_type": "code", |
137 | | - "execution_count": 1, |
| 139 | + "execution_count": 3, |
138 | 140 | "id": "20fc8142-c618-4d50-b903-5a04f6a34d5c", |
139 | 141 | "metadata": {}, |
140 | 142 | "outputs": [], |
|
186 | 188 | }, |
187 | 189 | { |
188 | 190 | "cell_type": "code", |
189 | | - "execution_count": 2, |
| 191 | + "execution_count": 4, |
190 | 192 | "id": "b27e54cc-fd6a-4afc-ab22-4dde0561938c", |
191 | 193 | "metadata": {}, |
192 | 194 | "outputs": [], |
|
200 | 202 | "# Setting the production length and checkpoint interval to 20 ps to match the trajectory write interval, so one frame will be written\n", |
201 | 203 | "settings.simulation_settings.production_length = 0.02 * unit.nanosecond # setting the npt production length to 20 ps\n", |
202 | 204 | "settings.output_settings.checkpoint_interval = 0.02 * unit.nanosecond # setting the checkpoint interval to 20 ps\n", |
203 | | - "settings.engine_settings.compute_platform = 'CPU' # running the simulation on the cpu" |
| 205 | + "settings.engine_settings.compute_platform = 'CPU' # running the simulation on the cpu\n", |
| 206 | + "settings.solvation_settings.solvent_padding = 1.0 * unit.nanometer # set the solvent padding to 1 nm to reduce the number of waters" |
204 | 207 | ] |
205 | 208 | }, |
206 | 209 | { |
207 | 210 | "cell_type": "code", |
208 | | - "execution_count": 3, |
| 211 | + "execution_count": 5, |
209 | 212 | "id": "b69668c9-2e74-421e-a9ea-b7f3bc6c6e5a", |
210 | 213 | "metadata": {}, |
211 | 214 | "outputs": [ |
|
220 | 223 | " 'amber/tip3p_HFE_multivalent.xml',\n", |
221 | 224 | " 'amber/phosaa10.xml'],\n", |
222 | 225 | " 'hydrogen_mass': 3.0,\n", |
223 | | - " 'nonbonded_cutoff': <Quantity(1.0, 'nanometer')>,\n", |
| 226 | + " 'nonbonded_cutoff': {'unit': 'nanometer', 'val': 0.9},\n", |
224 | 227 | " 'nonbonded_method': 'PME',\n", |
225 | 228 | " 'rigid_water': True,\n", |
226 | | - " 'small_molecule_forcefield': 'openff-2.1.1'},\n", |
227 | | - " 'integrator_settings': {'barostat_frequency': <Quantity(25.0, 'timestep')>,\n", |
| 229 | + " 'small_molecule_forcefield': 'openff-2.2.1'},\n", |
| 230 | + " 'integrator_settings': {'barostat_frequency': {'unit': 'timestep',\n", |
| 231 | + " 'val': 25.0},\n", |
228 | 232 | " 'constraint_tolerance': 1e-06,\n", |
229 | | - " 'langevin_collision_rate': <Quantity(1.0, '1 / picosecond')>,\n", |
| 233 | + " 'langevin_collision_rate': {'unit': '1 / picosecond',\n", |
| 234 | + " 'val': 1.0},\n", |
230 | 235 | " 'n_restart_attempts': 20,\n", |
231 | 236 | " 'reassign_velocities': False,\n", |
232 | 237 | " 'remove_com': False,\n", |
233 | | - " 'timestep': <Quantity(4.0, 'femtosecond')>},\n", |
234 | | - " 'output_settings': {'checkpoint_interval': <Quantity(20.0, 'picosecond')>,\n", |
| 238 | + " 'timestep': {'unit': 'femtosecond', 'val': 4.0}},\n", |
| 239 | + " 'output_settings': {'checkpoint_interval': {'unit': 'nanosecond', 'val': 0.02},\n", |
235 | 240 | " 'checkpoint_storage_filename': 'checkpoint.chk',\n", |
236 | 241 | " 'equil_npt_structure': 'equil_npt.pdb',\n", |
237 | 242 | " 'equil_nvt_structure': 'equil_nvt.pdb',\n", |
|
241 | 246 | " 'output_indices': 'not water',\n", |
242 | 247 | " 'preminimized_structure': 'system.pdb',\n", |
243 | 248 | " 'production_trajectory_filename': 'simulation.xtc',\n", |
244 | | - " 'trajectory_write_interval': <Quantity(20.0, 'picosecond')>},\n", |
| 249 | + " 'trajectory_write_interval': {'unit': 'picosecond',\n", |
| 250 | + " 'val': 20.0}},\n", |
245 | 251 | " 'partial_charge_settings': {'nagl_model': None,\n", |
246 | 252 | " 'number_of_conformers': None,\n", |
247 | 253 | " 'off_toolkit_backend': 'ambertools',\n", |
248 | 254 | " 'partial_charge_method': 'am1bcc'},\n", |
249 | 255 | " 'protocol_repeats': 1,\n", |
250 | | - " 'simulation_settings': {'equilibration_length': <Quantity(0.01, 'nanosecond')>,\n", |
251 | | - " 'equilibration_length_nvt': <Quantity(0.01, 'nanosecond')>,\n", |
| 256 | + " 'simulation_settings': {'equilibration_length': {'unit': 'nanosecond',\n", |
| 257 | + " 'val': 0.01},\n", |
| 258 | + " 'equilibration_length_nvt': {'unit': 'nanosecond',\n", |
| 259 | + " 'val': 0.01},\n", |
252 | 260 | " 'minimization_steps': 5000,\n", |
253 | | - " 'production_length': <Quantity(0.02, 'nanosecond')>},\n", |
254 | | - " 'solvation_settings': {'box_shape': 'cube',\n", |
| 261 | + " 'production_length': {'unit': 'nanosecond',\n", |
| 262 | + " 'val': 0.02}},\n", |
| 263 | + " 'solvation_settings': {'box_shape': 'dodecahedron',\n", |
255 | 264 | " 'box_size': None,\n", |
256 | 265 | " 'box_vectors': None,\n", |
257 | 266 | " 'number_of_solvent_molecules': None,\n", |
258 | 267 | " 'solvent_model': 'tip3p',\n", |
259 | | - " 'solvent_padding': <Quantity(1.2, 'nanometer')>},\n", |
| 268 | + " 'solvent_padding': {'unit': 'nanometer', 'val': 1.0}},\n", |
260 | 269 | " 'thermo_settings': {'ph': None,\n", |
261 | | - " 'pressure': <Quantity(0.986923267, 'standard_atmosphere')>,\n", |
| 270 | + " 'pressure': {'unit': 'bar', 'val': 1},\n", |
262 | 271 | " 'redox_potential': None,\n", |
263 | | - " 'temperature': <Quantity(298.15, 'kelvin')>}}\n" |
| 272 | + " 'temperature': {'unit': 'kelvin', 'val': 298.15}}}\n" |
| 273 | + ] |
| 274 | + }, |
| 275 | + { |
| 276 | + "name": "stderr", |
| 277 | + "output_type": "stream", |
| 278 | + "text": [ |
| 279 | + "/Users/atravitz/micromamba/envs/openfe-conda/lib/python3.11/site-packages/gufe/settings/models.py:30: PydanticDeprecatedSince20: The `dict` method is deprecated; use `model_dump` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.11/migration/\n", |
| 280 | + " pprint.pprint(self.dict())\n" |
264 | 281 | ] |
265 | 282 | } |
266 | 283 | ], |
|
282 | 299 | }, |
283 | 300 | { |
284 | 301 | "cell_type": "code", |
285 | | - "execution_count": 4, |
| 302 | + "execution_count": 6, |
286 | 303 | "id": "3b0f5a26-b23b-4ab2-9f1e-293d98ed5bcd", |
287 | 304 | "metadata": {}, |
288 | 305 | "outputs": [], |
|
303 | 320 | }, |
304 | 321 | { |
305 | 322 | "cell_type": "code", |
306 | | - "execution_count": 5, |
| 323 | + "execution_count": 7, |
307 | 324 | "id": "987cceda-1253-417b-8cca-bc750ac0aa1e", |
308 | 325 | "metadata": {}, |
309 | 326 | "outputs": [], |
|
342 | 359 | }, |
343 | 360 | { |
344 | 361 | "cell_type": "code", |
345 | | - "execution_count": 6, |
| 362 | + "execution_count": 8, |
346 | 363 | "id": "7689c7ba-39a2-49ea-b82b-e3b198354c5b", |
347 | 364 | "metadata": {}, |
348 | 365 | "outputs": [], |
|
353 | 370 | "md_dir.mkdir(exist_ok=True)\n", |
354 | 371 | "\n", |
355 | 372 | "# then we write out the transformation\n", |
356 | | - "nontransformation.dump(md_dir / f\"{nontransformation.name}.json\")" |
| 373 | + "nontransformation.to_json(md_dir / f\"{nontransformation.name}.json\")" |
357 | 374 | ] |
358 | 375 | }, |
359 | 376 | { |
|
381 | 398 | }, |
382 | 399 | { |
383 | 400 | "cell_type": "code", |
384 | | - "execution_count": 7, |
| 401 | + "execution_count": 9, |
385 | 402 | "id": "544d037d-3a53-4390-91b8-3104c00694f0", |
386 | 403 | "metadata": { |
387 | 404 | "editable": true, |
|
395 | 412 | "name": "stderr", |
396 | 413 | "output_type": "stream", |
397 | 414 | "text": [ |
398 | | - "/Users/hannahbaumann/miniforge3/envs/openfe_dev/lib/python3.12/site-packages/openfe/protocols/openmm_utils/omm_compute.py:76: UserWarning: Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n", |
| 415 | + "INFO:openfe.utils.system_probe.log:SYSTEM CONFIG DETAILS:\n", |
| 416 | + "INFO:openfe.utils.system_probe.log.hostname:hostname: 'Alyssas-Macbook-Pro.local'\n", |
| 417 | + "INFO:openfe.utils.system_probe.log.gpu:CUDA-based GPU not found\n", |
| 418 | + "INFO:openfe.utils.system_probe.log:Memory used: 20.7G (63.6%)\n", |
| 419 | + "INFO:openfe.utils.system_probe.log:scratch_PlainMDProtocolUnit-52e66ff618014bb3877c15dc0d137171_attempt_0: 43% full (530.3G free)\n", |
| 420 | + "INFO:gufekey.openfe.protocols.openmm_md.plain_md_methods.PlainMDProtocolUnit:Creating system\n", |
| 421 | + "INFO:openmmforcefields.generators.template_generators:Requested to generate parameters for residue <Residue 0 (UNK) of chain 0>\n", |
| 422 | + "INFO:openmmforcefields.generators.template_generators:Generating a residue template for [H][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H] using openff-2.2.1\n", |
| 423 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 0\n", |
| 424 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 1\n", |
| 425 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 2\n", |
| 426 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 3\n", |
| 427 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 4\n", |
| 428 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 5\n", |
| 429 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 6\n", |
| 430 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 7\n", |
| 431 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 8\n", |
| 432 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 9\n", |
| 433 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 10\n", |
| 434 | + "INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 11\n", |
| 435 | + "/Users/atravitz/micromamba/envs/openfe-conda/lib/python3.11/site-packages/openfe/protocols/openmm_utils/omm_compute.py:76: UserWarning: Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n", |
399 | 436 | " warnings.warn(wmsg)\n", |
400 | | - "WARNING:root:Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n" |
| 437 | + "WARNING:root:Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n", |
| 438 | + "INFO:openfe.protocols.openmm_md.plain_md_methods:minimizing systems\n", |
| 439 | + "INFO:openfe.protocols.openmm_md.plain_md_methods:Running NVT equilibration\n", |
| 440 | + "INFO:openfe.protocols.openmm_md.plain_md_methods:Completed NVT equilibration in 19.77936577796936 seconds\n", |
| 441 | + "INFO:openfe.protocols.openmm_md.plain_md_methods:Running NPT equilibration\n", |
| 442 | + "INFO:openfe.protocols.openmm_md.plain_md_methods:Completed NPT equilibration in 22.49833083152771 seconds\n", |
| 443 | + "INFO:openfe.protocols.openmm_md.plain_md_methods:running production phase\n", |
| 444 | + "INFO:openfe.protocols.openmm_md.plain_md_methods:Completed simulation in 45.916950941085815 seconds\n" |
401 | 445 | ] |
402 | 446 | } |
403 | 447 | ], |
|
430 | 474 | }, |
431 | 475 | { |
432 | 476 | "cell_type": "code", |
433 | | - "execution_count": 9, |
| 477 | + "execution_count": 10, |
434 | 478 | "id": "16fbf816-8d3d-4121-ab0e-5cd7741788d6", |
435 | 479 | "metadata": {}, |
436 | 480 | "outputs": [ |
437 | 481 | { |
438 | 482 | "name": "stdout", |
439 | 483 | "output_type": "stream", |
440 | 484 | "text": [ |
441 | | - "checkpoint.chk equil_npt.pdb minimized.pdb simulation.xtc\n", |
442 | | - "db.json equil_nvt.pdb simulation.log system.pdb\n" |
| 485 | + "ls: shared_PlainMDProtocolUnit-6b85013e6cb94120baf447540650643b_attempt_0/: No such file or directory\n" |
443 | 486 | ] |
444 | 487 | } |
445 | 488 | ], |
446 | 489 | "source": [ |
447 | | - "!ls shared_PlainMDProtocolUnit-256e9093d8f3443b9949b95e7ddbb64e_attempt_0/" |
| 490 | + "!ls shared_PlainMDProtocolUnit-6b85013e6cb94120baf447540650643b_attempt_0/" |
448 | 491 | ] |
449 | 492 | }, |
450 | 493 | { |
|
455 | 498 | "### Performance consideration for gas phase MD simulations\n", |
456 | 499 | "For gas phase MD simulations, we suggest setting `OPENMM_CPU_THREADS` to `1` to obtain good performance." |
457 | 500 | ] |
| 501 | + }, |
| 502 | + { |
| 503 | + "cell_type": "code", |
| 504 | + "execution_count": null, |
| 505 | + "id": "b7f8de97-95b6-4c83-b5ef-17fae1614557", |
| 506 | + "metadata": {}, |
| 507 | + "outputs": [], |
| 508 | + "source": [] |
458 | 509 | } |
459 | 510 | ], |
460 | 511 | "metadata": { |
|
473 | 524 | "name": "python", |
474 | 525 | "nbconvert_exporter": "python", |
475 | 526 | "pygments_lexer": "ipython3", |
476 | | - "version": "3.12.8" |
| 527 | + "version": "3.11.14" |
477 | 528 | }, |
478 | 529 | "widgets": { |
479 | 530 | "application/vnd.jupyter.widget-state+json": { |
|
0 commit comments