XTCFile¶
- class openmm.app.xtcfile.XTCFile(fileName, topology, dt, firstStep=0, interval=1, append=False)¶
XTCFile provides methods for creating XTC files. To use this class, create a XTCFile object, then call writeModel() once for each model in the file.
- __init__(fileName, topology, dt, firstStep=0, interval=1, append=False)¶
Create a XTC file, or open an existing file to append.
- Parameters
fileName (str) – A file name to write to
topology (Topology) – The Topology defining the molecular system being written
dt (time) – The time step used in the trajectory
firstStep (int=0) – The index of the first step in the trajectory
interval (int=1) – The frequency (measured in time steps) at which states are written to the trajectory
append (bool=False) – If True, open an existing XTC file to append to. If False, create a new file.
Methods
__init__
(fileName, topology, dt[, …])Create a XTC file, or open an existing file to append.
writeModel
(positions[, unitCellDimensions, …])Write out a model to the XTC file.
- writeModel(positions, unitCellDimensions=None, periodicBoxVectors=None)¶
Write out a model to the XTC file.
The periodic box can be specified either by the unit cell dimensions (for a rectangular box), or the full set of box vectors (for an arbitrary triclinic box). If neither is specified, the box vectors specified in the Topology will be used. Regardless of the value specified, no dimensions will be written if the Topology does not represent a periodic system.
- Parameters
positions (list) – The list of atomic positions to write
unitCellDimensions (Vec3=None) – The dimensions of the crystallographic unit cell.
periodicBoxVectors (tuple of Vec3=None) – The vectors defining the periodic box.