Motivation: the extract_trajectory function in the current version of
yank (0.25.2) is not compatible with the replica exchange trajectory files
generated by the current version of openmmtools (0.20.0)
(check this issue).
Install: clone the repo and install in a virtual environment using
pip install .
Needs yank. For a full list of dependencies, check the requirements.yml
file.
Extract frames corresponding to state index 0:
from mmdemux import extract_trajectory, extract_trajectory_to_file
trj = extract_trajectory(nc_path=<path to the NetCD4 file>,
state_index=0, ref_system=<reference system>,
top=<topology>)extract_trajectory returns a mdtraj Trajectory object.
extract_trajectory_to_file will save the trajectory to file with the file
format determined by the filename extension (using the mdtraj convention).
Write frames corresponding to state index 0 to a NetCDF file trj.nc:
extract_trajectory_to_file(nc_path=<path to the NetCDF file>'trj.nc',
out_path=`trj.nc`, state_index=0,
ref_system=<reference system>,
top=<topology>)