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

Interoperability with OpenMM #2863

Closed
jbarnoud opened this issue Jul 23, 2020 · 1 comment · Fixed by #2917
Closed

Interoperability with OpenMM #2863

jbarnoud opened this issue Jul 23, 2020 · 1 comment · Fixed by #2917

Comments

@jbarnoud
Copy link
Contributor

Is your feature request related to a problem?

On the contrary to most MD engines, OpenMM gives access to most of its internals through a python API. In a typical OpenMM workflow, many operations are performed using that API including loading and manipulating topologies, and writing the trajectory to file. An interoperability layer between OpenMM and MDAnalysis would make it easier to use MDAnalysis to prepare OpenMM simulation, and benefit from the file formats supported by the library when saving a running OpenMM trajectory to disk.

Describe the solution you'd like

Topology parser for simtk.openmm.app.Topology

OpenMM stores topologies using the simtk.openmm.app.Topology object. That object provides name, element, and residue information for each atom, so as the topologically relevant connectivity between the atoms. The information stored in that object would allow building a MDAnalysis.core.topology.Topology object. This opens the door to creating a Universe.

Universe from simtk.openmm.app.PDBFile, simtk.openmm.app.PDBXFile, and simtk.openmm.app.Modeller instances

These objects are the ones used by OpenMM to read and write PDB and mmCIF files, and to build or modify topologies (with operations such as adding water, or building a membrane). They contain both a topology and coordinates which is everything we need to create a Universe.

With the ability to create such Universes, MDAnalysis gains access to the file reading and topology modelling capabilities of OpenMM.

Converters to simtk.openmm.app.PDBFile, simtk.openmm.app.PDBXFile, and simtk.openmm.app.Modeller

These objects do contain enough information to build a Universe, but a Universe should contain everything necessary to build them as well. This opens MDAnalysis compatibility and topology modelling capabilities to users preparing OpenMM simulations.

MDAnalysis reporter for OpenMM

OpenMM uses a mechanism called reporters to stop the MD loop and let python do something such as writing a frame to disk. OpenMM provides a collection of reporters. However, a reporter built on top of MDAnalysis brings to capabilities: it allows OpenMM to write the running simulation is any format that MDAnalysis can write, and it allows to run analyses on the fly as the simulation runs.

Describe alternatives you've considered

Universe from simtk.openmm.System or simtk.openmm.app.Simulation

A System describes the hamiltonian of a simulation, and Simulation the simulation itself with its System, its topology, and its integrator. They do contain everything needed to build a Universe. However, deciding what potential from a System should appear as a topologically relevant bond is not trivial, and is reminiscent of #588. It is made even trickier as OpenMM accepts custom potentials.

Streaming trajectory reader

MDAnalysis used to have a trajectory reader that was streaming frames. Such a reader could be linked to a running simulation for on the fly analyses.

@ahy3nz
Copy link
Contributor

ahy3nz commented Aug 22, 2020

Hi this is an interesting issue, is anyone working on this yet? If not, I'd like to help contribute some openmm conversions to mdanalysis

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

Successfully merging a pull request may close this issue.

2 participants