mdtraj.formats.GroTrajectoryFile¶
-
class
mdtraj.formats.GroTrajectoryFile(filename, mode='r', force_overwrite=True)¶ Interface for reading and writing to GROMACS GRO files.
- Parameters
- filenamestr
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?
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)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(filename[, mode, force_overwrite])Initialize self.
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