Skip to content

Load file with reduced box vectors - #799

Merged
dwhswenson merged 10 commits into
openpathsampling:masterfrom
dwhswenson:reduce_box_vectors
Oct 8, 2018
Merged

dwhswenson merged 10 commits into
openpathsampling:masterfrom
dwhswenson:reduce_box_vectors

Conversation

@dwhswenson

@dwhswenson dwhswenson commented Oct 3, 2018 •

Copy link
Copy Markdown
Member

This adds tools to simplify loading input trajectories, especially loading Gromacs trajectories for the OpenMM engine.

Gromacs trajectory files, such as TRRs, round the box vectors that they store. OpenMM has a strict requirement that box vectors be in reduced form. Because of the rounding in the TRR files, Gromacs input often needs to be massaged to work. OpenMM has a way of handling this, but because we load the trajectories with MDTraj, we bypass the part of OpenMM that does this. Internally, we'll just import the method that OpenMM uses and apply it to our snapshots.

The PR adds tools to simplify this, including a particular method to load TRR files for the OpenMM engine.

  • Add functions for reducing box vectors in snapshots and trajectories
  • Add convenience function for loading OpenMM-engine-ready trajectory from TRR file
  • Docstrings
  • Unit tests

@dwhswenson dwhswenson self-assigned this Oct 3, 2018
@dwhswenson dwhswenson changed the title [WIP] Load file with reduced box vectors Load file with reduced box vectors Oct 7, 2018
@dwhswenson

Copy link
Copy Markdown
Member Author

This should be ready for review and merge. I think the only possible concern is that we're importing a somewhat-hidden feature of OpenMM. However, to the extent possible, I'd prefer to have them maintain it, rather than rewriting their code as part of OPS. If they move the functionality to another name, we can update easily enough.

Overall, this will make it much more convenient to use existing Gromacs trajectories as input to OPS:

from openpathsampling.engines.openmm.tools import load_trr
traj = load_trr("file.trr", top="conf.gro")

This should include velocities, and also fix box vector rounding.

@dwhswenson
dwhswenson requested a review from jhprinz October 7, 2018 13:52
@dwhswenson dwhswenson assigned jhprinz and unassigned dwhswenson Oct 7, 2018
@dwhswenson
dwhswenson merged commit 8a0775a into openpathsampling:master Oct 8, 2018
@dwhswenson
dwhswenson deleted the reduce_box_vectors branch October 8, 2018 09:31
@dwhswenson

Copy link
Copy Markdown
Member Author

This should also fix some problems with notebook tests; a recent change somewhere made ipynbs in Py 3.6 stricter about the order of from __future__ imports.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants