ReadTrajectory
This type represents a trajectory on disk for reading. It is used to read snapshots of the molecular system (MDFrame objects).
MolecularDynamicsFiles.ReadTrajectory — Typemutable struct ReadTrajectoryRepresents a molecular dynamics trajectory stored on disk.
A trajectory consists of a set of states of a molecular simulation. This structure allows for iteration over the states that are contained in trajectory files on disk.
Fields:
format: the file format of the trajectory filesfilepaths: paths to files of the trajectory files containing snapshotsfmasktimesteps: timesteps inferred from filenames (integers read from file mask)i: index of file currently being readio: input filestream of currently read file
MolecularDynamicsFiles.ReadTrajectory — MethodReadTrajectory(
filepath::String,
format::MolecularDynamicsFiles.Format.T
) -> ReadTrajectory
Create a ReadTrajectory with trajectory files specified by filepath, of format format.
The files are plain text files that may be compressed with gzip.
A trajectory may be contained in a single file with snapshots appended one after another. This is possible only with formats LAMMPS Dump and XYZ.
Alternatively, the trajectory may be defined as a set of files in a directory, with each file containing data for a single snapshot (MDFrame). In this case, files are specified by a file path with the filename containing a mask symbol '*'. A filename with a mask symbol matches all files in that directory with an integer in place of the mask symbol. The timestep for frames is also read from the mask if the timestep is not specified in the files themselves.
Arguments:
filepath: path to trajectory files. Is either a path to a file on disk, or a path with the filename containing a single wildcard "*", representing a mask. A filename with a mask matches all filepaths with an integer (timestep) in place of the mask.format: file format of the trajectory (for example Format.LAMMPSDump)
Base.read — Methodread(t::ReadTrajectory) -> MDFrame
Read a single frame (state, snapshot) from a trajectory.
MolecularDynamicsFiles.done — Methoddone(t::ReadTrajectory) -> Bool
See if the trajectory is at the end (no more frames left to read).