Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for new openmmtools 0.23.0 #1203

Merged
merged 28 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bd4c691
change default to none
mikemhenry Apr 18, 2023
a235671
Merge branch 'main' into feat/set_default_to_none_for_atom_selection
mikemhenry Apr 25, 2023
2820950
Changing default in template yaml file
ijpulidos May 30, 2023
a71fc09
Test null/none atom selection
ijpulidos May 30, 2023
0226dd5
null atom selection should be empty list
ijpulidos May 30, 2023
bd3a6e6
Merge branch 'main' into feat/set_default_to_none_for_atom_selection
ijpulidos May 30, 2023
3de54db
Document how to control the log level in the CLI
mikemhenry May 30, 2023
26046e7
Update examples/new-cli/README.md
mikemhenry May 31, 2023
754baa1
Add solvent_model kwarg to RelativeFEPSetup
ijpulidos Jun 5, 2023
135dc60
Specify solvent model input YAML/CLI
ijpulidos Jun 5, 2023
24dfaa0
Test openmmtools_dev
mikemhenry Jun 9, 2023
41bff85
Update CI.yaml
mikemhenry Jun 9, 2023
851f822
Update CI.yaml
mikemhenry Jun 9, 2023
6364535
make sure we pull in openmmtools
mikemhenry Jun 9, 2023
65fae3b
forgot to add new env file
mikemhenry Jun 9, 2023
d061e90
Online analysis multiple of checkpoint interval. Fix tests.
ijpulidos Jun 9, 2023
0474f9a
Using dask import inside functions
ijpulidos Jun 9, 2023
1505004
Merge branch 'feat/set_default_to_none_for_atom_selection' into mikem…
ijpulidos Jun 9, 2023
1a7f712
Merge remote-tracking branch 'origin/mikemhenry-patch-2' into mikemhe…
ijpulidos Jun 9, 2023
cd0e440
Merge branch '1192-add-solvent-model-cli' into mikemhenry-patch-3
ijpulidos Jun 9, 2023
8cfbb49
dask import inside functions
ijpulidos Jun 9, 2023
2df9be9
Pinning dask version
ijpulidos Jun 9, 2023
cae139e
set CI to just pull from normal channels since we pushed update
mikemhenry Jun 12, 2023
273c880
Drop 3.8 testing
mikemhenry Jun 12, 2023
0149438
Testing with ambertools < 23
ijpulidos Jun 13, 2023
7a38a07
Revert "Merge branch '1192-add-solvent-model-cli' into mikemhenry-pat…
ijpulidos Jun 15, 2023
ca3c43e
Revert "Merge remote-tracking branch 'origin/mikemhenry-patch-2' into…
ijpulidos Jun 15, 2023
6afba88
Revert "Merge branch 'feat/set_default_to_none_for_atom_selection' in…
ijpulidos Jun 15, 2023
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 examples/new-cli/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ trajectory_directory: lig0to1
trajectory_prefix: out

# Atoms to store in NetCDF files (MDTraj selection syntax)
atom_selection: not water
atom_selection: null

# Calculation phases to run
# Permitted phases: ['complex', 'solvent', 'vacuum']
Expand Down
4 changes: 2 additions & 2 deletions perses/app/setup_relative_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def run_setup(setup_options, serialize_systems=True, build_samplers=True):
_logger.info(f"\tatom selection detected: {atom_selection}")
else:
_logger.info(f"\tno atom selection detected: default to all.")
atom_selection = 'all'
atom_selection = 'none'

if setup_options['fe_type'] == 'neq':
_logger.info(f"\tInstantiating nonequilibrium switching FEP")
Expand Down Expand Up @@ -660,7 +660,7 @@ def run_setup(setup_options, serialize_systems=True, build_samplers=True):
if atom_selection:
selection_indices = htf[phase].hybrid_topology.select(atom_selection)
else:
selection_indices = None
selection_indices = []

storage_name = AnyPath(trajectory_directory) / f"{trajectory_prefix}-{phase}.nc"
_logger.info(f'\tstorage_name: {storage_name}')
Expand Down
42 changes: 42 additions & 0 deletions perses/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import yaml


def pytest_addoption(parser):
Expand All @@ -25,3 +26,44 @@ def pytest_collection_modifyitems(config, items):
def in_tmpdir(tmpdir):
with tmpdir.as_cwd():
yield

@pytest.fixture
def input_yaml_template():
input_yaml = """
atom_selection: null
checkpoint_interval: 5
fe_type: repex
forcefield_files:
- amber/ff14SB.xml
- amber/tip3p_standard.xml
- amber/tip3p_HFE_multivalent.xml
- amber/phosaa10.xml
n_cycles: 10
n_equilibration_iterations: 10
n_states: 3
n_steps_per_move_application: 50
new_ligand_index: 15
old_ligand_index: 14
phases:
- vacuum
pressure: 1.0
save_setup_pickle_as: fesetup_hbonds.pkl
small_molecule_forcefield: openff-2.0.0
solvent_padding: 9.0
temperature: 300.0
timestep: 4.0
trajectory_directory: cdk2_repex_hbonds
trajectory_prefix: cdk2
"""
return input_yaml

@pytest.fixture
def input_template_obj_default_selection(input_yaml_template):
input_obj = yaml.safe_load(input_yaml_template)
return input_obj


@pytest.fixture
def input_template_not_water_selection(input_template_obj_default_selection):
input_template_obj_default_selection["atom_selection"] = "not water"
return input_template_obj_default_selection
34 changes: 4 additions & 30 deletions perses/tests/test_resume.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
import os
import subprocess
import tempfile

import pytest
import simtk.openmm.app as app
Expand All @@ -20,7 +19,9 @@


@pytest.mark.gpu_ci
def test_cli_resume_repex():
@pytest.mark.parametrize("input_params", ["input_template_obj_default_selection",
"input_template_not_water_selection"])
def test_cli_resume_repex(input_params, request):

with enter_temp_directory() as temp_dir:
os.chdir(temp_dir)
Expand All @@ -33,34 +34,7 @@ def test_cli_resume_repex():
os.path.join("data", "cdk2-example", "CDK2_ligands_shifted.sdf"),
)

document = """
atom_selection: not water
checkpoint_interval: 5
fe_type: repex
forcefield_files:
- amber/ff14SB.xml
- amber/tip3p_standard.xml
- amber/tip3p_HFE_multivalent.xml
- amber/phosaa10.xml
n_cycles: 10
n_equilibration_iterations: 10
n_states: 3
n_steps_per_move_application: 50
new_ligand_index: 15
old_ligand_index: 14
phases:
- vacuum
pressure: 1.0
save_setup_pickle_as: fesetup_hbonds.pkl
small_molecule_forcefield: openff-2.0.0
solvent_padding: 9.0
temperature: 300.0
timestep: 4.0
trajectory_directory: cdk2_repex_hbonds
trajectory_prefix: cdk2
"""

y_doc = yaml.load(document, Loader=yaml.UnsafeLoader)
y_doc = request.getfixturevalue(input_params)
y_doc["protein_pdb"] = protein_pdb
y_doc["ligand_file"] = ligand_file

Expand Down