Interface for reading and writing to GROMACS GRO files.
Parameters: | filename : str
mode : {‘r’, ‘w’}
force_overwrite : bool
|
---|
See also
Attributes
n_atoms | (int) The number of atoms in the file |
topology | (md.Topology) The topology. TODO(rmcgibbo) note about chain |
Methods
__init__(filename[, mode, force_overwrite]) | |
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 |
Write one or more frames of a molecular dynamics trajectory to disk in the GROMACS GRO format.
Parameters: | coordinates : np.ndarray, dtype=np.float32, shape=(n_frames, n_atoms, 3)
topology : mdtraj.Topology
time : np.ndarray, dtype=float32, shape=(n_frames), optional
unitcell_vectors : np.ndarray, dtype=float32, shape=(n_frames, 3, 3), optional
precision : int, optional
|
---|
Read a trajectory from a gro file
Parameters: | n_frames : int, optional
stride : np.ndarray, optional
atom_indices : array_like, optional
|
---|---|
Returns: | trajectory : Trajectory
|
Read data from a molecular dynamics trajectory in the GROMACS GRO format.
Parameters: | n_frames : int, optional
stride : int, optional
atom_indices : np.ndarray, dtype=int, optional
|
---|---|
Returns: | coordinates : np.ndarray, shape=(n_frames, n_atoms, 3)
time : np.ndarray, None
unitcell_vectors : np.ndarray, shape=(n_frames, 3, 3)
|
Move to a new file position
Parameters: | offset : int
whence : {0, 1, 2}
|
---|
Current file position
Returns: | offset : int
|
---|
Close the file