StructuresDictReporter#
Capturing simulation trajectories in a lightweight Python structures dictionary.
The StructuresDictReporter class records coordinates, velocities, box vectors, and timestamps directly into a molsysmt.StructuresDict dictionary.
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.StructuresDictReporter.
Basic usage#
Let’s demonstrate using StructuresDictReporter with an OpenMM simulation:
import molsysmt as msm
molsys = msm.convert(msm.systems['Trp-Cage']['1l2y.h5msm'], to_form='molsysmt.MolSys')
simulation = msm.convert(molsys, to_form='openmm.Simulation', temperature='300 K')
reporter = msm.third_party.openmm.reporters.StructuresDictReporter(reportInterval=10)
simulation.reporters.append(reporter)
simulation.step(20)
res = reporter.finalize()
print('Captured trajectory frames:', len(res['coordinates']))
Captured trajectory frames: 3
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().