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

v0.3.0 API changes for OpenMMTools compatibility #163

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

nathanmlim
Copy link
Collaborator

Description

Significant changes to the overall BLUES API, where much of the refactoring is to follow similar structure to the openmmtools toolkit.

"Move" classes are now what carry out the actual simulation and modification of the openmm.Integrator/openmm.Context objects.

  • Running the NCMC+MD simulation now relies on using the LangevinDynamicsMove class which I've modified to ReportLangevinDynamicsMove to allow storing coordinates over the MD simulation phase.
  • NCMCMove provides the base class for perturbing atom coordinates. Every subsequent move we develop should inherit from this class and override the _propose_positions() function which simply takes a positions array and outputs the proposed positions (as opposed to modifying the context itself).
  • The RandomLigandRotationMove has been refactored to utilize this framework.
  • This redesign should allow us to draw from the openmmtools library of monte carlo moves which perturb atom coordinates and turn them into a move which uses the NCMC protocol. For example:
from openmmtools.mcmc import MCDisplacementMove
class NCMCDisplacementMove(MCDisplacementMove, NCMCMove):        
    def _get_integrator(self, thermodynamic_state):
        return NCMCMove._get_integrator(self,thermodynamic_state)

BLUESSampler replaces what was the BLUESSimulation class, drawing inspiration from the openmmtools.mcmc.MCMCSampler class.

  • Instead of handling openmm.Simulation objects, we now make use of the openmmtools.ThermodynamicState/SamplerState objects.
  • The BLUESSampler class ties together the States and Moves in order to execute the NCMC+MD simulation.

Reporters have been changed to Storage to avoid confusion with reporters designed to work with openmm.Simulations. Our reporters have been modified to NetCDF4Storage and BLUESStateDateStorage. These now take openmm.States and openmm.Integrators as their input, instead of the openmm.Simualtion and openmm.Context.

Todos

Notable points that this PR has either accomplished or will accomplish.

  • Re-implementation of random rotation
  • Test toluene/T4-lysozyme system
  • Module refactoring
  • Code clean-up
  • Unit testing
  • Docstrings
  • ReadTheDocs

Status

  • Ready to go

@nathanmlim nathanmlim changed the title Changes for v0.2.5 v0.2.5 API changes for OpenMMTools compatibility Jun 18, 2019
Copy link
Collaborator

@sgill2 sgill2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a big PR, but everything looks good to me!

blues/storage.py Outdated
@@ -93,7 +125,7 @@ def init_logger(logger, level=logging.INFO, stream=True, outfname=time.strftime(
logger : logging.getLogger()
The root logger object if it has been created already.
level : logging.<LEVEL>
Valid options for <LEVEL> would be DEBUG, INFO, WARNING, ERROR, CRITICAL.
Valid options for <LEVEL> would be DEBUG, INFO, warningING, ERROR, CRITICAL.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for the warningING? :)

@codecov
Copy link

codecov bot commented Jun 27, 2019

Codecov Report

Merging #163 into master will increase coverage by 13.71%.
The diff coverage is 80.81%.

@@             Coverage Diff             @@
##           master     #163       +/-   ##
===========================================
+ Coverage    61.5%   75.22%   +13.71%     
===========================================
  Files           7        6        -1     
  Lines        1478      795      -683     
  Branches      266      141      -125     
===========================================
- Hits          909      598      -311     
+ Misses        460      120      -340     
+ Partials      109       77       -32
Impacted Files Coverage Δ
blues/__init__.py 100% <ø> (ø) ⬆️
blues/integrators.py 80.89% <100%> (-10.12%) ⬇️
blues/storage.py 57.29% <62.69%> (ø)
blues/ncmc.py 82.88% <82.88%> (ø)
blues/systemfactory.py 92.75% <92.75%> (ø)
blues/utils.py 88.37% <96.15%> (+39.29%) ⬆️
... and 1 more

@davidlmobley davidlmobley changed the title v0.2.5 API changes for OpenMMTools compatibility v0.3.0 API changes for OpenMMTools compatibility Oct 20, 2020
@davidlmobley
Copy link
Member

A couple notes from discussing with Nathan:

  • He accidentally merged an earlier version of this, then forced a roll back. So it looks like a 0.2.5 version was merged, but it was reverted.
  • The branch is called 0.2.5 but we're renaming the PR because of the need to release an interim version number before sorting this out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants