mdtraj.formats.GroTrajectoryFile¶
- class mdtraj.formats.GroTrajectoryFile(filename, mode='r', force_overwrite=True, top=None)[source]¶
Interface for reading and writing to GROMACS GRO files.
- Parameters:
filename (path-like) – The filename to open. A path to a file on disk.
mode ({'r', 'w'}) – The mode in which to open the file, either ‘r’ for read or ‘w’ for write.
force_overwrite (bool) – If opened in write mode, and a file by the name of filename already exists on disk, should we overwrite it?
top (mdtraj.core.Topology, default=None) – if you give a topology as input the topology won’t be parsed from the gro file it saves time if you have to parse a big number of files
- n_atoms¶
The number of atoms in the file
- Type:
int
- topology¶
The topology. TODO(rmcgibbo) note about chain
- Type:
md.Topology
See also
load_gro
High-level wrapper that returns a
md.Trajectory
Methods
close
()Close the file
read
([n_frames, stride, atom_indices])Read data from a molecular dynamics trajectory in the GROMACS GRO format.
read_as_traj
([n_frames, stride, atom_indices])Read a trajectory from a gro file
seek
(offset[, whence])Move to a new file position
tell
()Current file position
write
(coordinates, topology[, time, ...])Write one or more frames of a molecular dynamics trajectory to disk in the GROMACS GRO format.
Methods
__init__
(filename[, mode, force_overwrite, top])close
()Close the file
read
([n_frames, stride, atom_indices])Read data from a molecular dynamics trajectory in the GROMACS GRO format.
read_as_traj
([n_frames, stride, atom_indices])Read a trajectory from a gro file
seek
(offset[, whence])Move to a new file position
tell
()Current file position
write
(coordinates, topology[, time, ...])Write one or more frames of a molecular dynamics trajectory to disk in the GROMACS GRO format.
Attributes
distance_unit