BLUES: Binding modes of Ligands Using Enhanced Sampling
This package takes advantage of non-equilibrium candidate Monte Carlo moves (NCMC) to help sample between different ligand binding modes.
- Gill, S; Lim, N. M.; Grinaway, P.; Rustenburg, A. S.; Fass, J.; Ross, G.; Chodera, J. D.; Mobley, D. L. “Binding Modes of Ligands Using Enhanced Sampling (BLUES): Rapid Decorrelation of Ligand Binding Modes Using Nonequilibrium Candidate Monte Carlo” - Journal of Physical Chemistry B. February 27, 2018
blues/- Source code and example scripts for BLUES toolkit
devdocs/- Class diagrams for developers
devtools/- Developer tools and documentation for conda, travis, and issuing a release
images/- Images/logo for repository
notebooks- Jupyter notebooks for testing/development
BLUES is compatible with MacOSX/Linux with Python>=3.5 (blues<=1.1 still works with Python 2.7) Install miniconda according to your system.
Starting from v1.2, you will need the OpenEye toolkits and related tools:
conda install -c openeye/label/Orion -c omnia oeommtools packmol # Requires OpenEye License conda install -c openeye openeye-toolkits
Recommended: Install releases from conda
conda install -c mobleylab blues
Development builds: contains latest commits/PRs not yet issued in a point release
conda install -c mobleylab/label/dev blues
Install from source (NOT RECOMMENDED)
# Clone the BLUES repository git clone firstname.lastname@example.org:MobleyLab/blues.git # Install some dependencies conda install -c omnia -c conda-forge openmmtools=0.15.0 openmm=7.2.2 numpy cython # Install BLUES package from the top directory pip install -e . # To validate your BLUES installation run the tests. pip instal -e .[tests] pytest -v -s
BLUES using NCMC
This package takes advantage of non-equilibrium candidate Monte Carlo moves (NCMC) to help sample between different ligand binding modes using the OpenMM simulation package. One goal for this package is to allow for easy additions of other moves of interest, which will be covered below.
An example of how to set up a simulation sampling the binding modes of toluene bound to T4 lysozyme using NCMC and a rotational move can be found in
Actually using BLUES
The integrator of
BLUES contains the framework necessary for NCMC. Specifically, the integrator class calculates the work done during a NCMC move. It also controls the lambda scaling of parameters. The integrator that BLUES uses inherits from
openmmtools.integrators.AlchemicalNonequilibriumLangevinIntegrator to keep track of the work done outside integration steps, allowing Monte Carlo (MC) moves to be incorporated together with the NCMC thermodynamic perturbation protocol. Currently the
openmmtools.alchemy package is used to generate the lambda parameters for the ligand, allowing alchemical modification of the sterics and electrostatics of the system.
Simulation class in
blues/simulation.py serves as a wrapper for running NCMC simulations.
Implementing Custom Moves
Users can implement their own MC moves into NCMC by inheriting from an appropriate
blues.moves.Move class and constructing a custom
move() method that only takes in an Openmm context object as a parameter. The
move() method will then access the positions of that context, change those positions, then update the positions of that context. For example if you would like to add a move that randomly translates a set of coordinates the code would look similar to this pseudocode:
from blues.moves import Move class TranslationMove(Move): def __init__(self, atom_indices): self.atom_indices = atom_indices def move(context): """pseudocode for move""" positions = context.context.getState(getPositions=True).getPositions(asNumpy=True) #get positions from context #use some function that translates atom_indices newPositions = RandomTranslation(positions[self.atom_indices]) context.setPositions(newPositions) return context
Note: This feature has not been tested, use at your own risk.
If you're interested in combining moves together sequentially–say you'd like to perform a rotation and translation move together–instead of coding up a new
Move class that performs that, you can instead leverage the functionality of existing
Moves using the
CombinationMove takes in a list of instantiated
Move objects. The
move() method perfroms the moves in either listed or reverse order. Replicating a rotation and translation move on t, then, can effectively be done by passing in an instantiated TranslationMove (from the pseudocode example above) and RandomLigandRotation.
One important non-obvious thing to note about the CombinationMove class is that to ensure detailed balance is maintained, moves are done half the time in listed order and half the time in the reverse order.
- Version 0.0.1: Basic BLUES functionality/package
- Version 0.0.2: Maintenance release fixing a critical bug and improving organization as a package.
- Version 0.0.3: Refactored BLUES functionality and design.
- Version 0.0.4: Minor bug fixes plus a functionality problem on some GPU configs.
- Version 0.1.0: Refactored move proposals, added Monte Carlo functionality, Smart Darting moves, and changed alchemical integrator.
- Version 0.1.1: Features to boost move acceptance such as freezing atoms in the NCMC simulation and adding extra propagation steps in the alchemical integrator.
- Version 0.1.2: Incorporation of SideChainMove functionality (Contributor: Kalistyn Burley)
- Version 0.1.3: Improvements to simulation logging functionality and parameters for extra propagation.
- Version 0.2.0: YAML support, API changes, custom reporters.
- Version 0.2.1: Bug fix in alchemical correction term
- Version 0.2.2: Bug fixes for OpenEye tests and restarting from the YAML; enhancements to the Logger and package installation.
- Version 0.2.3: Improvements to Travis CI, fix in velocity synicng, and add tests for checking freezing selection.
We would like to thank Patrick Grinaway and John Chodera for their basic code framework for NCMC in OpenMM (see https://github.com/choderalab/perses/tree/master/perses/annihilation), and John Chodera and Christopher Bayly for their helpful discussions.