Skip to content

Commit

Permalink
Merge branch 'main' into feat/improve_docker_building
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemhenry authored Jun 29, 2023
2 parents e318d16 + 06bbd50 commit da49b89
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 101 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
merge_group:
pull_request:
branches:
- "main"
Expand All @@ -23,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10"]
python-version: [3.9, "3.10"]
openmm: ["8.0", "7.7"]
include:
- openmm: "dev"
Expand All @@ -49,12 +50,13 @@ jobs:
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test
channels: jaimergp/label/unsupported-cudatoolkit-shim,conda-forge/label/openmm_dev/linux-64,conda-forge,openeye
channels: jaimergp/label/unsupported-cudatoolkit-shim,conda-forge/label/openmm_dev,conda-forge,openeye
channel-priority: flexible
cache-env: true
cache-downloads: true
extra-specs: |
python==${{ matrix.python-version }}
openmmtools==0.23.0
openmm==8.0.0dev3
- name: Setup micromamba
Expand All @@ -68,6 +70,7 @@ jobs:
extra-specs: |
python==${{ matrix.python-version }}
openmm==${{ matrix.openmm }}
openmmtools==0.23.0
- name: Install package
shell: bash -l {0}
Expand Down Expand Up @@ -103,4 +106,4 @@ jobs:
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
fail_ci_if_error: true
5 changes: 3 additions & 2 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ channels:
- conda-forge
- openeye
dependencies:
- ambertools <23
- arsenic
- autograd
- click
- cloudpathlib-s3 >=0.13.0
- coverage
- dask
- dask <2023.5
- dask-jobqueue
- dicttoxml
- distributed
Expand All @@ -27,7 +28,7 @@ dependencies:
- openff-units >=0.1.8
- openmm >=7.7
- openmmforcefields >=0.9.0
- openmmtools >=0.21.5 # may need to sort out ambermini/ambertools/parmed dependencies
- openmmtools # may need to sort out ambermini/ambertools/parmed dependencies
- openmoltools # may need to sort out ambermini/ambertools/parmed dependencies (we don't want ambertools)
- parmed # may need to sort out ambermini/ambertools/parmed dependencies
- pdbfixer
Expand Down
63 changes: 63 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,69 @@ This section lists features and improvements of note in each release.

The full release history can be viewed `at the GitHub perses releases page <https://github.com/choderalab/perses/releases>`_.

0.10.2 - Release
----------------

Bugfix release.

Enhancements
^^^^^^^^^^^^

* Added support for reading input files (ex yaml, sdf, pdbs) from AWS, GCP, and Azure. See the documentation for [cloudpathlib](https://cloudpathlib.drivendata.org/stable/authentication/) for how to setup authentication. Currently only reading the yaml from S3 is unit tested (ie `perses-cli --yaml s3://perses-testing/template_s3.yaml`), but other cloud providers and input files should work. `AzureBlobPath`, `S3Path` and `GSPath` are supported URI endpoints. Please report any issues on our issue tracker! by @mikemhenry in https://github.com/choderalab/perses/pull/1073
* ``CUDA`` platform was hardcoded in geometry engine, generating performance issues by not clearing openmm contexts correctly. Fixed by defaulting to using the faster ``CPU`` platform (for the geometry engine) and explicitly deleting context variables after they are used. by @ijpulidos in https://github.com/choderalab/perses/pull/1091
* Set aromatic draw style to `OEAromaticStyle_Circle` in atom mapper rendering by @mikemhenry in https://github.com/choderalab/perses/pull/1103
* Ligands with atoms changing constrained status were not being handled by mapping proposal. Atoms in bonds that change constrained/unconstrained to unconstrained/constrained during the transformation are now _demapped_. by @ijpulidos in https://github.com/choderalab/perses/pull/1125
* Now that upstream ``openmmtools`` is storing velocities on checkpoint, the small molecule transformation pipeline does not reassign velocities on resume by default. Instead, the velocities are read from the checkpoint file. by @ijpulidos in https://github.com/choderalab/perses/pull/1133
* CLI workflow for replica exchange now uses the faster ``LangevinMiddleIntegrator`` via the ``LangevinDynamicsMove``. Tests were updated to reflect the changes. by @ijpulidos in https://github.com/choderalab/perses/pull/1138
* Add opencontainers image-spec to `Dockerfile` by @SauravMaheshkar in https://github.com/choderalab/perses/pull/1139
* Updated to support openff-toolkit 0.11, which included API-breaking changes. by @jchodera in https://github.com/choderalab/perses/pull/1128
* Make solute-only trajectory writing optional. This option is controlled by the `atom_selection` option in the yaml file. The syntax uses the MDTraj selection syntax, e.g. `not water` @mikemhenry in https://github.com/choderalab/perses/pull/1185
* Users can now specify solvent model for simulations using the ``solvent_model`` field in the input YAML file. Supported values are 'tip3p', 'spce', 'tip4pew', 'tip5p', and 'swm4ndp' (polarizable) by @ijpulidos in https://github.com/choderalab/perses/pull/1202

Documentation
^^^^^^^^^^^^^
* Document setting `ionic_strength` in `examples/new-cli/template.yaml` by @mikemhenry in https://github.com/choderalab/perses/pull/1104
* Add reproducible version of COVID Moonshot example anyone can run as an example by @jchodera in https://github.com/choderalab/perses/pull/1145
* Speed up RTD env generation by @mikemhenry in https://github.com/choderalab/perses/pull/1105
* Fix documentation string for `ProteinMutationExecutor`, using `False` for `reassign_velocities` parameter. by @ijpulidos in https://github.com/choderalab/perses/pull/1169
* Document how to control the log level in the CLI by @mikemhenry in https://github.com/choderalab/perses/pull/1198

Bug Fixes
^^^^^^^^^

* Fixes bug where if a `:` was in a key, we could not override the argument in our perses-cli. @mikemhenry in https://github.com/choderalab/perses/pull/1062
* Resolves #1157 objects serialized with `utils.data.serialize` now will be compressed with `bzip2` or `gzip` depending on file name (`.gz` and `.bz2`, respectively) by @mikemhenry in https://github.com/choderalab/perses/pull/1163
* Fixes for new openmmtools 0.23.0 by @mikemhenry in https://github.com/choderalab/perses/pull/1203

Testing/CI/Packaging
^^^^^^^^^^^^^^^^^^^^
* add python 3.10 to CI by @mikemhenry in https://github.com/choderalab/perses/pull/1080
* skip broken tests by @mikemhenry in https://github.com/choderalab/perses/pull/1074
* Feat/fix ssl gpu error by @mikemhenry in https://github.com/choderalab/perses/pull/1095
* Previously the keyword argument `save_freq` in `validate_endstate_energies_md` was not functional and the value of `250` steps was hard coded. Now, `save_freq` works and has a default value of `250` steps. by @mikemhenry in https://github.com/choderalab/perses/pull/1101
* fix issue with test asset name by @mikemhenry in https://github.com/choderalab/perses/pull/1102
* Examples and benchmarks template input files now run vacuum, solvent and complex phases in order. by @ijpulidos in https://github.com/choderalab/perses/pull/1122
* Add openmm 8 to testing matrix by @mikemhenry in https://github.com/choderalab/perses/pull/1124
* Fix resume tests to use new CLI (resolves issue #1150) by @mikemhenry in https://github.com/choderalab/perses/pull/1151
* Avoid testing non-examples in CI by @ijpulidos in https://github.com/choderalab/perses/pull/1164
* only run dev with newest python version by @mikemhenry in https://github.com/choderalab/perses/pull/1165
* remove outdated recipe by @mikemhenry in https://github.com/choderalab/perses/pull/1159
* update release process by @mikemhenry in https://github.com/choderalab/perses/pull/1162
* add env caching to CI by @mikemhenry in https://github.com/choderalab/perses/pull/1178
* Skip failing openmm 8 tests by @mikemhenry in https://github.com/choderalab/perses/pull/1186
* Add small molecule repex consistency tests by @zhang-ivy in https://github.com/choderalab/perses/pull/1065
* Fix RESTTopologyFactory test by @zhang-ivy in https://github.com/choderalab/perses/pull/1188
* enable merge queue by @mikemhenry in https://github.com/choderalab/perses/pull/1206
* Using default online analysis interval in GPU repex tests by @ijpulidos in https://github.com/choderalab/perses/pull/1207

New Contributors
^^^^^^^^^^^^^^^^

* @SauravMaheshkar made their first contribution in https://github.com/choderalab/perses/pull/1139

**Full Changelog**: https://github.com/choderalab/perses/compare/0.10.1...0.10.2


0.10.1 - Release
----------------

Expand Down
13 changes: 13 additions & 0 deletions examples/new-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ Currently only `key:value` parts of the yaml can be overridden i.e. not sequence

To view all options ultimately used in the simulation, a file named `perses-$date-$yaml_name.yaml` is created under the simulation/experiment directory.

The `LOGLEVEL` environment variable is used to control the logging messages printed to the terminal.
Two common methods to set this environmental variable are:
1. Setting the environmental variable for all applications ran in the terminal session
```bash
$ export LOGLEVEL=DEBUG # This will set the log level to DEBUG for all programs ran after this export
$ perses-cli --yaml template.yaml
```
2. Setting the environmental variable for only one command
```bash
$ LOGLEVEL=DEBUG perses-cli --yaml template.yaml
```


## Example Use Case

In this example folder we have a protein: [2ZFF](https://www.rcsb.org/structure/2zff) and some ligands which we will use for a series of free energy calculations.
Expand Down
5 changes: 4 additions & 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 All @@ -78,3 +78,6 @@ phases:
# Use geometry-derived mapping
use_given_geometries: true
given_geometries_tolerance: 0.4 # angstroms

# Solvent model
solvent_model: "tip3p"
2 changes: 1 addition & 1 deletion perses/app/relative_point_mutation_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PointMutationExecutor(object):
hss = HybridRepexSampler(mcmc_moves=mcmc.LangevinSplittingDynamicsMove(timestep= 4.0 * unit.femtoseconds,
collision_rate=5.0 / unit.picosecond,
n_steps=250,
reassign_velocities=True,
reassign_velocities=False,
n_restart_attempts=20,
splitting="V R R R O R R R V",
constraint_tolerance=1e-06),
Expand Down
25 changes: 17 additions & 8 deletions perses/app/relative_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
from openmmtools.constants import kB
import logging
import os
import dask.distributed as distributed
from collections import namedtuple
from collections import namedtuple
import random
from scipy.special import logsumexp
Expand Down Expand Up @@ -72,6 +70,7 @@ def __init__(self,
use_given_geometries = False,
given_geometries_tolerance=0.2*unit.angstroms,
transform_waters_into_ions_for_charge_changes=True,
solvent_model="tip3p"
):
"""
Initialize a NonequilibriumFEPSetup object
Expand Down Expand Up @@ -160,6 +159,7 @@ def __init__(self,
self._use_given_geometries = use_given_geometries
self._given_geometries_tolerance = given_geometries_tolerance
self.small_molecule_forcefield = small_molecule_forcefield
self._solvent_model = solvent_model
if isinstance(ligand_input, str):
self._ligand_input = AnyPath(ligand_input)
else:
Expand Down Expand Up @@ -408,7 +408,9 @@ def __init__(self,
_logger.info(f"setting up complex phase...")
self._setup_complex_phase()
self._complex_topology_old_solvated, self._complex_positions_old_solvated, self._complex_system_old_solvated = self._solvate_system(
self._complex_topology_old, self._complex_positions_old,phase='complex',box_dimensions=self._complex_box_dimensions, ionic_strength=self._ionic_strength)
self._complex_topology_old, self._complex_positions_old, phase='complex',
box_dimensions=self._complex_box_dimensions, ionic_strength=self._ionic_strength,
model=self._solvent_model)
_logger.info(f"successfully generated complex topology, positions, system")

self._complex_md_topology_old_solvated = md.Topology.from_openmm(self._complex_topology_old_solvated)
Expand Down Expand Up @@ -466,7 +468,9 @@ def __init__(self,
_logger.info(f"no complex detected in phases...generating unique topology/geometry proposals...")
_logger.info(f"solvating ligand...")
self._ligand_topology_old_solvated, self._ligand_positions_old_solvated, self._ligand_system_old_solvated = self._solvate_system(
self._ligand_topology_old, self._ligand_positions_old,phase='solvent',box_dimensions=self._solvent_box_dimensions,ionic_strength=self._ionic_strength)
self._ligand_topology_old, self._ligand_positions_old, phase='solvent',
box_dimensions=self._solvent_box_dimensions, ionic_strength=self._ionic_strength,
model=self._solvent_model)
self._ligand_md_topology_old_solvated = md.Topology.from_openmm(self._ligand_topology_old_solvated)

_logger.info(f"creating TopologyProposal")
Expand Down Expand Up @@ -532,8 +536,10 @@ def __init__(self,

if self._proposal_phase is None:
_logger.info('No complex or solvent leg, so performing topology proposal for vacuum leg')
self._vacuum_topology_old, self._vacuum_positions_old, self._vacuum_system_old = self._solvate_system(self._ligand_topology_old,
self._ligand_positions_old,phase='vacuum')
# FIXME: We shouldn't use a "solvate" system method for the vacuum phase. Separate functionalities.
self._vacuum_topology_old, self._vacuum_positions_old, self._vacuum_system_old = self._solvate_system(
self._ligand_topology_old,
self._ligand_positions_old, phase='vacuum', model=self._solvent_model)
self._vacuum_topology_proposal = self._proposal_engine.propose(self._vacuum_system_old,
self._vacuum_topology_old,
current_mol_id=0, proposed_mol_id=1)
Expand Down Expand Up @@ -666,7 +672,8 @@ def _generate_solvent_topologies(self, topology_proposal, old_positions):

# solvate the old ligand topology:
old_solvated_topology, old_solvated_positions, old_solvated_system = self._solvate_system(
old_ligand_topology.to_openmm(), old_ligand_positions,phase='solvent', box_dimensions=self._solvent_box_dimensions)
old_ligand_topology.to_openmm(), old_ligand_positions, phase='solvent',
box_dimensions=self._solvent_box_dimensions, model=self._solvent_model)

old_solvated_md_topology = md.Topology.from_openmm(old_solvated_topology)

Expand Down Expand Up @@ -826,7 +833,7 @@ def _solvate_system(self, topology, positions, model='tip3p',phase='complex', bo
forcefield : SystemGenerator.forcefield
forcefield file of solvent to add
model : str, default 'tip3p'
solvent model to use for solvation
solvent model to use for solvation. Supported values are 'tip3p', 'spce', 'tip4pew', 'tip5p', and 'swm4ndp' (polarizable)
box_dimensions : tuple of Vec3, default None
if not None, padding distance will be omitted in favor of a pre-specified set of box dimensions
Expand Down Expand Up @@ -971,6 +978,7 @@ def activate_client(self,
LSF = True,
num_processes = 2,
adapt = False):
import dask.distributed as distributed

if LSF:
from dask_jobqueue import LSFCluster
Expand Down Expand Up @@ -1056,6 +1064,7 @@ def wait(self, futures):
"""
wrapper to wait until futures are complete.
"""
import dask.distributed as distributed
if self.client is None:
pass
else:
Expand Down
Loading

0 comments on commit da49b89

Please sign in to comment.