H5MSMReporter#
Streaming OpenMM simulation trajectories directly to binary H5MSM files on disk.
The H5MSMReporter class writes high-speed compressed HDF5 binary trajectory files (.h5msm) incrementally during OpenMM molecular dynamics simulations.
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects: molsysmt.third_party.openmm.reporters.H5MSMReporter.
Basic usage#
Let’s stream trajectory data to an H5MSM file:
import molsysmt as msm
import os
molsys = msm.convert(msm.systems['Trp-Cage']['1l2y.h5msm'], to_form='molsysmt.MolSys')
simulation = msm.convert(molsys, to_form='openmm.Simulation', temperature='300 K')
h5_out = 'traj_run.h5msm'
reporter = msm.third_party.openmm.reporters.H5MSMReporter(file=h5_out, reportInterval=10, steps=20)
simulation.reporters.append(reporter)
simulation.step(20)
reporter.close()
print('H5MSM trajectory written. Exists on disk:', os.path.exists(h5_out))
if os.path.exists(h5_out):
os.remove(h5_out)
H5MSM trajectory written. Exists on disk: True
See also
openmm.Simulation: OpenMM Simulation form adapter in MolSysMT.
openmm.System: OpenMM System container in MolSysMT.
Convert: Converting molecular systems with
molsysmt.basic.convert().