mdtraj.formats.GroTrajectoryFile¶
- class mdtraj.formats.GroTrajectoryFile(filename, mode='r', force_overwrite=True, top=None)¶
 Interface for reading and writing to GROMACS GRO files.
- Parameters
 - filenamepath-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_overwritebool
 If opened in write mode, and a file by the name of filename already exists on disk, should we overwrite it?
- topmdtraj.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
See also
load_groHigh-level wrapper that returns a
md.Trajectory
- Attributes
 - n_atomsint
 The number of atoms in the file
- topologymd.Topology
 The topology. TODO(rmcgibbo) note about chain
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.
- __init__(filename, mode='r', force_overwrite=True, top=None)¶
 
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