Skip to content

Commit 1c09b45

Browse files
authored
Merge pull request #201 from OpenFreeEnergy/update-md-tutorial
Update some settings in the MD tutorial to get outputs
2 parents d0043f2 + 3297cd1 commit 1c09b45

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

openmm_md/plain_md.ipynb

+30-15
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"id": "7266db2c-37e5-419a-9015-929ea1635d98",
1414
"metadata": {},
1515
"source": [
16-
"In this notebook we run an MD simulation of benzene bound to T4-lysozyme L99A.",
17-
"![image](assets/t4lyso.png)"
16+
"In this notebook we run an MD simulation of benzene bound to T4-lysozyme L99A.![image](assets/t4lyso.png)"
1817
]
1918
},
2019
{
@@ -147,7 +146,9 @@
147146
"settings = PlainMDProtocol.default_settings()\n",
148147
"settings.simulation_settings.equilibration_length_nvt = 0.01 * unit.nanosecond # setting the nvt equilibration length to 10 ps\n",
149148
"settings.simulation_settings.equilibration_length = 0.01 * unit.nanosecond # setting the npt equilibration length to 10 ps\n",
150-
"settings.simulation_settings.production_length = 0.01 * unit.nanosecond # setting the npt production length to 10 ps\n",
149+
"# Setting the production length and checkpoint interval to 20 ps to match the trajectory write interval, so one frame will be written\n",
150+
"settings.simulation_settings.production_length = 0.02 * unit.nanosecond # setting the npt production length to 20 ps\n",
151+
"settings.output_settings.checkpoint_interval = 0.02 * unit.nanosecond # setting the checkpoint interval to 20 ps\n",
151152
"settings.engine_settings.compute_platform = 'CPU' # running the simulation on the cpu"
152153
]
153154
},
@@ -161,7 +162,7 @@
161162
"name": "stdout",
162163
"output_type": "stream",
163164
"text": [
164-
"{'engine_settings': {'compute_platform': 'CPU'},\n",
165+
"{'engine_settings': {'compute_platform': 'CPU', 'gpu_device_index': None},\n",
165166
" 'forcefield_settings': {'constraints': 'hbonds',\n",
166167
" 'forcefields': ['amber/ff14SB.xml',\n",
167168
" 'amber/tip3p_standard.xml',\n",
@@ -171,15 +172,15 @@
171172
" 'nonbonded_cutoff': <Quantity(1.0, 'nanometer')>,\n",
172173
" 'nonbonded_method': 'PME',\n",
173174
" 'rigid_water': True,\n",
174-
" 'small_molecule_forcefield': 'openff-2.0.0'},\n",
175-
" 'integrator_settings': {'barostat_frequency': <Quantity(25, 'timestep')>,\n",
175+
" 'small_molecule_forcefield': 'openff-2.1.1'},\n",
176+
" 'integrator_settings': {'barostat_frequency': <Quantity(25.0, 'timestep')>,\n",
176177
" 'constraint_tolerance': 1e-06,\n",
177178
" 'langevin_collision_rate': <Quantity(1.0, '1 / picosecond')>,\n",
178179
" 'n_restart_attempts': 20,\n",
179180
" 'reassign_velocities': False,\n",
180181
" 'remove_com': False,\n",
181-
" 'timestep': <Quantity(4, 'femtosecond')>},\n",
182-
" 'output_settings': {'checkpoint_interval': <Quantity(1, 'picosecond')>,\n",
182+
" 'timestep': <Quantity(4.0, 'femtosecond')>},\n",
183+
" 'output_settings': {'checkpoint_interval': <Quantity(20.0, 'picosecond')>,\n",
183184
" 'checkpoint_storage_filename': 'checkpoint.chk',\n",
184185
" 'equil_npt_structure': 'equil_npt.pdb',\n",
185186
" 'equil_nvt_structure': 'equil_nvt.pdb',\n",
@@ -189,7 +190,7 @@
189190
" 'output_indices': 'not water',\n",
190191
" 'preminimized_structure': 'system.pdb',\n",
191192
" 'production_trajectory_filename': 'simulation.xtc',\n",
192-
" 'trajectory_write_interval': <Quantity(20, 'picosecond')>},\n",
193+
" 'trajectory_write_interval': <Quantity(20.0, 'picosecond')>},\n",
193194
" 'partial_charge_settings': {'nagl_model': None,\n",
194195
" 'number_of_conformers': None,\n",
195196
" 'off_toolkit_backend': 'ambertools',\n",
@@ -198,8 +199,12 @@
198199
" 'simulation_settings': {'equilibration_length': <Quantity(0.01, 'nanosecond')>,\n",
199200
" 'equilibration_length_nvt': <Quantity(0.01, 'nanosecond')>,\n",
200201
" 'minimization_steps': 5000,\n",
201-
" 'production_length': <Quantity(0.01, 'nanosecond')>},\n",
202-
" 'solvation_settings': {'solvent_model': 'tip3p',\n",
202+
" 'production_length': <Quantity(0.02, 'nanosecond')>},\n",
203+
" 'solvation_settings': {'box_shape': 'cube',\n",
204+
" 'box_size': None,\n",
205+
" 'box_vectors': None,\n",
206+
" 'number_of_solvent_molecules': None,\n",
207+
" 'solvent_model': 'tip3p',\n",
203208
" 'solvent_padding': <Quantity(1.2, 'nanometer')>},\n",
204209
" 'thermo_settings': {'ph': None,\n",
205210
" 'pressure': <Quantity(0.986923267, 'standard_atmosphere')>,\n",
@@ -286,7 +291,7 @@
286291
},
287292
{
288293
"cell_type": "code",
289-
"execution_count": 7,
294+
"execution_count": 6,
290295
"id": "7689c7ba-39a2-49ea-b82b-e3b198354c5b",
291296
"metadata": {},
292297
"outputs": [],
@@ -325,7 +330,7 @@
325330
},
326331
{
327332
"cell_type": "code",
328-
"execution_count": null,
333+
"execution_count": 7,
329334
"id": "544d037d-3a53-4390-91b8-3104c00694f0",
330335
"metadata": {
331336
"editable": true,
@@ -334,7 +339,17 @@
334339
},
335340
"tags": []
336341
},
337-
"outputs": [],
342+
"outputs": [
343+
{
344+
"name": "stderr",
345+
"output_type": "stream",
346+
"text": [
347+
"/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",
348+
" warnings.warn(wmsg)\n",
349+
"WARNING:root:Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n"
350+
]
351+
}
352+
],
338353
"source": [
339354
"import gufe\n",
340355
"import pathlib\n",
@@ -407,7 +422,7 @@
407422
"name": "python",
408423
"nbconvert_exporter": "python",
409424
"pygments_lexer": "ipython3",
410-
"version": "3.10.13"
425+
"version": "3.12.8"
411426
},
412427
"widgets": {
413428
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)