Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion abfe_tutorial/abfe_json/toluene.json

Large diffs are not rendered by default.

87 changes: 52 additions & 35 deletions abfe_tutorial/abfe_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Generating charges: 100%|█████████████████████████| 1/1 [00:00<00:00, 1.53it/s]\n"
"Generating charges: 100%|█████████████████████████| 1/1 [00:00<00:00, 1.42it/s]\n"
]
}
],
Expand Down Expand Up @@ -231,17 +231,33 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 7,
"id": "c31c712b-4844-477b-8aa4-ded6f0c8ca5f",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/hannahbaumann/miniforge3/envs/openfe_dev/lib/python3.12/site-packages/Bio/Application/__init__.py:39: BiopythonDeprecationWarning: The Bio.Application modules and modules relying on it have been deprecated.\n",
"\n",
"Due to the on going maintenance burden of keeping command line application\n",
"wrappers up to date, we have decided to deprecate and eventually remove these\n",
"modules.\n",
"\n",
"We instead now recommend building your command line and invoking it directly\n",
"with the subprocess module.\n",
" warnings.warn(\n"
]
}
],
"source": [
"from openfe.protocols.openmm_afe import AbsoluteBindingProtocol;"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"id": "fb839094",
"metadata": {},
"outputs": [],
Expand All @@ -251,7 +267,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 9,
"id": "8b99f77f-c70c-436d-b4eb-fb462a4b043e",
"metadata": {
"scrolled": true
Expand All @@ -262,7 +278,7 @@
"output_type": "stream",
"text": [
"{'alchemical_settings': {},\n",
" 'complex_equil_output_settings': {'checkpoint_interval': <Quantity(250.0, 'picosecond')>,\n",
" 'complex_equil_output_settings': {'checkpoint_interval': <Quantity(1.0, 'nanosecond')>,\n",
" 'checkpoint_storage_filename': 'checkpoint.chk',\n",
" 'equil_npt_structure': 'equil_npt_structure.pdb',\n",
" 'equil_nvt_structure': 'equil_nvt_structure.pdb',\n",
Expand Down Expand Up @@ -367,7 +383,7 @@
" 0.9,\n",
" 0.95,\n",
" 1.0]},\n",
" 'complex_output_settings': {'checkpoint_interval': <Quantity(250.0, 'picosecond')>,\n",
" 'complex_output_settings': {'checkpoint_interval': <Quantity(1.0, 'nanosecond')>,\n",
" 'checkpoint_storage_filename': 'complex_checkpoint.nc',\n",
" 'forcefield_cache': 'db.json',\n",
" 'output_filename': 'complex.nc',\n",
Expand Down Expand Up @@ -424,11 +440,11 @@
" 'dssp_filter': True,\n",
" 'guest_atoms': None,\n",
" 'host_atoms': None,\n",
" 'host_max_distance': <Quantity(3, 'nanometer')>,\n",
" 'host_min_distance': <Quantity(1, 'nanometer')>,\n",
" 'host_max_distance': <Quantity(3.0, 'nanometer')>,\n",
" 'host_min_distance': <Quantity(1.0, 'nanometer')>,\n",
" 'host_selection': 'backbone',\n",
" 'rmsf_cutoff': <Quantity(0.1, 'nanometer')>},\n",
" 'solvent_equil_output_settings': {'checkpoint_interval': <Quantity(250.0, 'picosecond')>,\n",
" 'solvent_equil_output_settings': {'checkpoint_interval': <Quantity(1.0, 'nanosecond')>,\n",
" 'checkpoint_storage_filename': 'checkpoint.chk',\n",
" 'equil_npt_structure': 'equil_npt_structure.pdb',\n",
" 'equil_nvt_structure': 'equil_nvt_structure.pdb',\n",
Expand Down Expand Up @@ -485,7 +501,7 @@
" 0.77,\n",
" 0.85,\n",
" 1.0]},\n",
" 'solvent_output_settings': {'checkpoint_interval': <Quantity(250.0, 'picosecond')>,\n",
" 'solvent_output_settings': {'checkpoint_interval': <Quantity(1.0, 'nanosecond')>,\n",
" 'checkpoint_storage_filename': 'solvent_checkpoint.nc',\n",
" 'forcefield_cache': 'db.json',\n",
" 'output_filename': 'solvent.nc',\n",
Expand Down Expand Up @@ -534,19 +550,19 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 11,
"id": "55067780-d228-4661-8c1e-5cb0217fd2dc",
"metadata": {},
"outputs": [],
"source": [
"from openff.units import unit\n",
"\n",
"# change the values\n",
"# Run only a single repeat\n",
"settings.protocol_repeats = 1\n",
"settings.solvent_simulation_settings.equilibration_length = 10 * unit.picosecond\n",
"settings.solvent_simulation_settings.production_length = 500 * unit.picosecond\n",
"settings.complex_simulation_settings.equilibration_length = 10 * unit.picosecond\n",
"settings.complex_simulation_settings.production_length = 500 * unit.picosecond\n",
"# Change the min and max distance between protein and ligand atoms for Boresch restraints to avoid periodicity issues\n",
"settings.restraint_settings.host_min_distance = 0.5 * unit.nanometer\n",
"settings.restraint_settings.host_max_distance = 1.5 * unit.nanometer\n",
"\n",
"settings.engine_settings.compute_platform = 'CUDA'"
]
},
Expand All @@ -561,7 +577,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 12,
"id": "23f6322b-0336-4aa9-b9d0-ebe533dc5753",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -595,7 +611,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 13,
"id": "1231fad8-b37d-4008-a851-5ad546386286",
"metadata": {},
"outputs": [],
Expand All @@ -619,10 +635,19 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 14,
"id": "b69efbcd-b888-4afc-a33e-01860889f408",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/hannahbaumann/miniforge3/envs/openfe_dev/lib/python3.12/site-packages/gufe/transformations/transformation.py:124: DeprecationWarning: use of this method is deprecated; instead use `to_json`\n",
" warnings.warn(\n"
]
}
],
"source": [
"import pathlib\n",
"# first we create the directory\n",
Expand Down Expand Up @@ -667,7 +692,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 15,
"id": "44ba94ca",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -702,7 +727,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 16,
"id": "6dbedb47-46b9-4c22-ad74-a580174a359c",
"metadata": {},
"outputs": [],
Expand All @@ -713,7 +738,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 17,
"id": "be690ef1-3243-4114-b56f-5babbb660af6",
"metadata": {
"scrolled": true
Expand Down Expand Up @@ -828,7 +853,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 18,
"id": "f62f69a1-09c0-4a4a-9b37-9663b51a75ac",
"metadata": {},
"outputs": [],
Expand All @@ -846,7 +871,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 19,
"id": "3b459b28-a4dc-4fa9-a961-b106c45d79ce",
"metadata": {},
"outputs": [
Expand All @@ -859,22 +884,14 @@
" 'pint_unit_registry': 'openff_units'}"
]
},
"execution_count": 23,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"estimate"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4ca58949-6e5c-46df-a281-812636ac797f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
34 changes: 23 additions & 11 deletions cookbook/choose_protocol.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
" 'softcore_alpha': 0.85,\n",
" 'turn_off_core_unique_exceptions': False,\n",
" 'use_dispersion_correction': False},\n",
" 'engine_settings': {'compute_platform': None},\n",
" 'engine_settings': {'compute_platform': None, 'gpu_device_index': None},\n",
" 'forcefield_settings': {'constraints': 'hbonds',\n",
" 'forcefields': ['amber/ff14SB.xml',\n",
" 'amber/tip3p_standard.xml',\n",
Expand All @@ -194,20 +194,22 @@
" 'nonbonded_method': 'PME',\n",
" 'rigid_water': True,\n",
" 'small_molecule_forcefield': 'openff-2.1.1'},\n",
" 'integrator_settings': {'barostat_frequency': <Quantity(25, 'timestep')>,\n",
" 'integrator_settings': {'barostat_frequency': <Quantity(25.0, 'timestep')>,\n",
" 'constraint_tolerance': 1e-06,\n",
" 'langevin_collision_rate': <Quantity(1.0, '1 / picosecond')>,\n",
" 'n_restart_attempts': 20,\n",
" 'reassign_velocities': False,\n",
" 'remove_com': False,\n",
" 'timestep': <Quantity(4, 'femtosecond')>},\n",
" 'timestep': <Quantity(4.0, 'femtosecond')>},\n",
" 'lambda_settings': {'lambda_functions': 'default', 'lambda_windows': 11},\n",
" 'output_settings': {'checkpoint_interval': <Quantity(250, 'picosecond')>,\n",
" 'output_settings': {'checkpoint_interval': <Quantity(1.0, 'nanosecond')>,\n",
" 'checkpoint_storage_filename': 'checkpoint.chk',\n",
" 'forcefield_cache': 'db.json',\n",
" 'output_filename': 'simulation.nc',\n",
" 'output_indices': 'not water',\n",
" 'output_structure': 'hybrid_system.pdb'},\n",
" 'output_structure': 'hybrid_system.pdb',\n",
" 'positions_write_frequency': <Quantity(100.0, 'picosecond')>,\n",
" 'velocities_write_frequency': None},\n",
" 'partial_charge_settings': {'nagl_model': None,\n",
" 'number_of_conformers': None,\n",
" 'off_toolkit_backend': 'ambertools',\n",
Expand All @@ -218,13 +220,17 @@
" 'minimization_steps': 5000,\n",
" 'n_replicas': 11,\n",
" 'production_length': <Quantity(5.0, 'nanosecond')>,\n",
" 'real_time_analysis_interval': <Quantity(250, 'picosecond')>,\n",
" 'real_time_analysis_minimum_time': <Quantity(500, 'picosecond')>,\n",
" 'real_time_analysis_interval': <Quantity(250.0, 'picosecond')>,\n",
" 'real_time_analysis_minimum_time': <Quantity(500.0, 'picosecond')>,\n",
" 'sampler_method': 'repex',\n",
" 'sams_flatness_criteria': 'logZ-flatness',\n",
" 'sams_gamma0': 1.0,\n",
" 'time_per_iteration': <Quantity(1, 'picosecond')>},\n",
" 'solvation_settings': {'solvent_model': 'tip3p',\n",
" 'time_per_iteration': <Quantity(1.0, 'picosecond')>},\n",
" 'solvation_settings': {'box_shape': 'cube',\n",
" 'box_size': None,\n",
" 'box_vectors': None,\n",
" 'number_of_solvent_molecules': None,\n",
" 'solvent_model': 'tip3p',\n",
" 'solvent_padding': <Quantity(1.2, 'nanometer')>},\n",
" 'thermo_settings': {'ph': None,\n",
" 'pressure': <Quantity(0.986923267, 'standard_atmosphere')>,\n",
Expand Down Expand Up @@ -327,6 +333,10 @@
" solvation_settings=equil_rfe_settings.OpenMMSolvationSettings(\n",
" solvent_model='tip3p', # Solvent model to generate starting coords\n",
" solvent_padding=1.2 * unit.nm, # Total distance between periodic image starting coords\n",
" box_shape = 'cube', # Cubic water box\n",
" box_size = None, # Size of the water box\n",
" box_vectors = None, # Box vectors\n",
" number_of_solvent_molecules = None, # Number of solvent molecules\n",
" ),\n",
" partial_charge_settings=equil_rfe_settings.OpenFFPartialChargeSettings(\n",
" partial_charge_method='am1bcc', # Partial charge method applied - am1bcc\n",
Expand Down Expand Up @@ -394,7 +404,9 @@
" checkpoint_storage_filename='checkpoint.chk', # Filename for simulation checkpoints\n",
" forcefield_cache='db.json', # Cache for small molecule residue templates\n",
" output_indices='not water', # Do not save water positions\n",
" checkpoint_interval=250 * unit.ps, # Save a checkpoint every 250 picoseconds\n",
" checkpoint_interval=1 * unit.ns, # Save a checkpoint every 1 nanoseconds\n",
" positions_write_frequency=100.0 * unit.picosecond, # Save position every 100 picoseconds\n",
" velocities_write_frequency = None, # Don't save velocities\n",
" ),\n",
")"
]
Expand Down Expand Up @@ -472,7 +484,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.10"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
Loading
Loading