Skip to content

Commit 315bed0

Browse files
committed
Update md inputs for v1.7
1 parent 30cdca9 commit 315bed0

1 file changed

Lines changed: 89 additions & 30 deletions

File tree

openmm_md/plain_md.ipynb

Lines changed: 89 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,16 @@
137137
"execution_count": 1,
138138
"id": "20fc8142-c618-4d50-b903-5a04f6a34d5c",
139139
"metadata": {},
140-
"outputs": [],
140+
"outputs": [
141+
{
142+
"name": "stderr",
143+
"output_type": "stream",
144+
"text": [
145+
"/home/ialibay/software/mambaforge/install/envs/openfe/lib/python3.12/site-packages/openmoltools/utils.py:9: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
146+
" from pkg_resources import resource_filename\n"
147+
]
148+
}
149+
],
141150
"source": [
142151
"import openfe\n",
143152
"from openfe import ChemicalSystem, ProteinComponent, SmallMoleculeComponent, SolventComponent\n",
@@ -186,7 +195,7 @@
186195
},
187196
{
188197
"cell_type": "code",
189-
"execution_count": 2,
198+
"execution_count": 3,
190199
"id": "b27e54cc-fd6a-4afc-ab22-4dde0561938c",
191200
"metadata": {},
192201
"outputs": [],
@@ -200,12 +209,13 @@
200209
"# Setting the production length and checkpoint interval to 20 ps to match the trajectory write interval, so one frame will be written\n",
201210
"settings.simulation_settings.production_length = 0.02 * unit.nanosecond # setting the npt production length to 20 ps\n",
202211
"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"
212+
"settings.engine_settings.compute_platform = 'CPU' # running the simulation on the cpu\n",
213+
"settings.solvation_settings.solvent_padding = 1.0 * unit.nanometer # set the solvent padding to 1 nm to reduce the number of waters"
204214
]
205215
},
206216
{
207217
"cell_type": "code",
208-
"execution_count": 3,
218+
"execution_count": 4,
209219
"id": "b69668c9-2e74-421e-a9ea-b7f3bc6c6e5a",
210220
"metadata": {},
211221
"outputs": [
@@ -220,18 +230,20 @@
220230
" 'amber/tip3p_HFE_multivalent.xml',\n",
221231
" 'amber/phosaa10.xml'],\n",
222232
" 'hydrogen_mass': 3.0,\n",
223-
" 'nonbonded_cutoff': <Quantity(1.0, 'nanometer')>,\n",
233+
" 'nonbonded_cutoff': {'unit': 'nanometer', 'val': 0.9},\n",
224234
" 'nonbonded_method': 'PME',\n",
225235
" 'rigid_water': True,\n",
226-
" 'small_molecule_forcefield': 'openff-2.1.1'},\n",
227-
" 'integrator_settings': {'barostat_frequency': <Quantity(25.0, 'timestep')>,\n",
236+
" 'small_molecule_forcefield': 'openff-2.2.1'},\n",
237+
" 'integrator_settings': {'barostat_frequency': {'unit': 'timestep',\n",
238+
" 'val': 25.0},\n",
228239
" 'constraint_tolerance': 1e-06,\n",
229-
" 'langevin_collision_rate': <Quantity(1.0, '1 / picosecond')>,\n",
240+
" 'langevin_collision_rate': {'unit': '1 / picosecond',\n",
241+
" 'val': 1.0},\n",
230242
" 'n_restart_attempts': 20,\n",
231243
" 'reassign_velocities': False,\n",
232244
" 'remove_com': False,\n",
233-
" 'timestep': <Quantity(4.0, 'femtosecond')>},\n",
234-
" 'output_settings': {'checkpoint_interval': <Quantity(20.0, 'picosecond')>,\n",
245+
" 'timestep': {'unit': 'femtosecond', 'val': 4.0}},\n",
246+
" 'output_settings': {'checkpoint_interval': {'unit': 'nanosecond', 'val': 0.02},\n",
235247
" 'checkpoint_storage_filename': 'checkpoint.chk',\n",
236248
" 'equil_npt_structure': 'equil_npt.pdb',\n",
237249
" 'equil_nvt_structure': 'equil_nvt.pdb',\n",
@@ -241,26 +253,38 @@
241253
" 'output_indices': 'not water',\n",
242254
" 'preminimized_structure': 'system.pdb',\n",
243255
" 'production_trajectory_filename': 'simulation.xtc',\n",
244-
" 'trajectory_write_interval': <Quantity(20.0, 'picosecond')>},\n",
256+
" 'trajectory_write_interval': {'unit': 'picosecond',\n",
257+
" 'val': 20.0}},\n",
245258
" 'partial_charge_settings': {'nagl_model': None,\n",
246259
" 'number_of_conformers': None,\n",
247260
" 'off_toolkit_backend': 'ambertools',\n",
248261
" 'partial_charge_method': 'am1bcc'},\n",
249262
" 'protocol_repeats': 1,\n",
250-
" 'simulation_settings': {'equilibration_length': <Quantity(0.01, 'nanosecond')>,\n",
251-
" 'equilibration_length_nvt': <Quantity(0.01, 'nanosecond')>,\n",
263+
" 'simulation_settings': {'equilibration_length': {'unit': 'nanosecond',\n",
264+
" 'val': 0.01},\n",
265+
" 'equilibration_length_nvt': {'unit': 'nanosecond',\n",
266+
" 'val': 0.01},\n",
252267
" 'minimization_steps': 5000,\n",
253-
" 'production_length': <Quantity(0.02, 'nanosecond')>},\n",
254-
" 'solvation_settings': {'box_shape': 'cube',\n",
268+
" 'production_length': {'unit': 'nanosecond',\n",
269+
" 'val': 0.02}},\n",
270+
" 'solvation_settings': {'box_shape': 'dodecahedron',\n",
255271
" 'box_size': None,\n",
256272
" 'box_vectors': None,\n",
257273
" 'number_of_solvent_molecules': None,\n",
258274
" 'solvent_model': 'tip3p',\n",
259-
" 'solvent_padding': <Quantity(1.2, 'nanometer')>},\n",
275+
" 'solvent_padding': {'unit': 'nanometer', 'val': 1.0}},\n",
260276
" 'thermo_settings': {'ph': None,\n",
261-
" 'pressure': <Quantity(0.986923267, 'standard_atmosphere')>,\n",
277+
" 'pressure': {'unit': 'bar', 'val': 1},\n",
262278
" 'redox_potential': None,\n",
263-
" 'temperature': <Quantity(298.15, 'kelvin')>}}\n"
279+
" 'temperature': {'unit': 'kelvin', 'val': 298.15}}}\n"
280+
]
281+
},
282+
{
283+
"name": "stderr",
284+
"output_type": "stream",
285+
"text": [
286+
"/home/ialibay/software/mambaforge/install/envs/openfe/lib/python3.12/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",
287+
" pprint.pprint(self.dict())\n"
264288
]
265289
}
266290
],
@@ -282,7 +306,7 @@
282306
},
283307
{
284308
"cell_type": "code",
285-
"execution_count": 4,
309+
"execution_count": 5,
286310
"id": "3b0f5a26-b23b-4ab2-9f1e-293d98ed5bcd",
287311
"metadata": {},
288312
"outputs": [],
@@ -303,7 +327,7 @@
303327
},
304328
{
305329
"cell_type": "code",
306-
"execution_count": 5,
330+
"execution_count": 6,
307331
"id": "987cceda-1253-417b-8cca-bc750ac0aa1e",
308332
"metadata": {},
309333
"outputs": [],
@@ -342,7 +366,7 @@
342366
},
343367
{
344368
"cell_type": "code",
345-
"execution_count": 6,
369+
"execution_count": 7,
346370
"id": "7689c7ba-39a2-49ea-b82b-e3b198354c5b",
347371
"metadata": {},
348372
"outputs": [],
@@ -353,7 +377,7 @@
353377
"md_dir.mkdir(exist_ok=True)\n",
354378
"\n",
355379
"# then we write out the transformation\n",
356-
"nontransformation.dump(md_dir / f\"{nontransformation.name}.json\")"
380+
"nontransformation.to_json(md_dir / f\"{nontransformation.name}.json\")"
357381
]
358382
},
359383
{
@@ -381,7 +405,7 @@
381405
},
382406
{
383407
"cell_type": "code",
384-
"execution_count": 7,
408+
"execution_count": 8,
385409
"id": "544d037d-3a53-4390-91b8-3104c00694f0",
386410
"metadata": {
387411
"editable": true,
@@ -395,9 +419,36 @@
395419
"name": "stderr",
396420
"output_type": "stream",
397421
"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",
422+
"INFO:openfe.utils.system_probe.log:SYSTEM CONFIG DETAILS:\n",
423+
"INFO:openfe.utils.system_probe.log.hostname:hostname: 'sith'\n",
424+
"INFO:openfe.utils.system_probe.log.gpu:CUDA-based GPU not found\n",
425+
"INFO:openfe.utils.system_probe.log:Memory used: 7.3G (25.9%)\n",
426+
"INFO:openfe.utils.system_probe.log:scratch_PlainMDProtocolUnit-6b85013e6cb94120baf447540650643b_attempt_0: 82% full (53.4G free)\n",
427+
"INFO:gufekey.openfe.protocols.openmm_md.plain_md_methods.PlainMDProtocolUnit:Creating system\n",
428+
"INFO:openmmforcefields.generators.template_generators:Requested to generate parameters for residue <Residue 0 (UNK) of chain 0>\n",
429+
"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",
430+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 0\n",
431+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 1\n",
432+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 2\n",
433+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 3\n",
434+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 4\n",
435+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 5\n",
436+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 6\n",
437+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 7\n",
438+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 8\n",
439+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 9\n",
440+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 10\n",
441+
"INFO:openff.interchange.smirnoff._nonbonded:Preset charges applied to atom index 11\n",
442+
"/home/ialibay/github/openfe/openfe/protocols/openmm_utils/omm_compute.py:76: UserWarning: Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n",
399443
" warnings.warn(wmsg)\n",
400-
"WARNING:root:Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n"
444+
"WARNING:root:Non-CUDA platform selected: CPU, this may significantly impact simulation performance\n",
445+
"INFO:openfe.protocols.openmm_md.plain_md_methods:minimizing systems\n",
446+
"INFO:openfe.protocols.openmm_md.plain_md_methods:Running NVT equilibration\n",
447+
"INFO:openfe.protocols.openmm_md.plain_md_methods:Completed NVT equilibration in 93.03289294242859 seconds\n",
448+
"INFO:openfe.protocols.openmm_md.plain_md_methods:Running NPT equilibration\n",
449+
"INFO:openfe.protocols.openmm_md.plain_md_methods:Completed NPT equilibration in 105.741370677948 seconds\n",
450+
"INFO:openfe.protocols.openmm_md.plain_md_methods:running production phase\n",
451+
"INFO:openfe.protocols.openmm_md.plain_md_methods:Completed simulation in 216.3571000099182 seconds\n"
401452
]
402453
}
403454
],
@@ -430,21 +481,29 @@
430481
},
431482
{
432483
"cell_type": "code",
433-
"execution_count": 9,
484+
"execution_count": 10,
434485
"id": "16fbf816-8d3d-4121-ab0e-5cd7741788d6",
435486
"metadata": {},
436487
"outputs": [
437488
{
438489
"name": "stdout",
439490
"output_type": "stream",
440491
"text": [
441-
"checkpoint.chk equil_npt.pdb minimized.pdb simulation.xtc\n",
442-
"db.json equil_nvt.pdb simulation.log system.pdb\n"
492+
"checkpoint.chk\tequil_npt.pdb minimized.pdb simulation.xtc\n",
493+
"db.json\t\tequil_nvt.pdb simulation.log system.pdb\n"
494+
]
495+
},
496+
{
497+
"name": "stderr",
498+
"output_type": "stream",
499+
"text": [
500+
"/home/ialibay/software/mambaforge/install/envs/openfe/lib/python3.12/pty.py:95: DeprecationWarning: This process (pid=257465) is multi-threaded, use of forkpty() may lead to deadlocks in the child.\n",
501+
" pid, fd = os.forkpty()\n"
443502
]
444503
}
445504
],
446505
"source": [
447-
"!ls shared_PlainMDProtocolUnit-256e9093d8f3443b9949b95e7ddbb64e_attempt_0/"
506+
"!ls shared_PlainMDProtocolUnit-6b85013e6cb94120baf447540650643b_attempt_0/"
448507
]
449508
},
450509
{
@@ -473,7 +532,7 @@
473532
"name": "python",
474533
"nbconvert_exporter": "python",
475534
"pygments_lexer": "ipython3",
476-
"version": "3.12.8"
535+
"version": "3.12.11"
477536
},
478537
"widgets": {
479538
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)