Interface for reading and writing to an TINKER archive files. (Note that the TINKER .xyz format is identical to this.) This is a file-like object, that both reading or writing depending on the mode flag. It implements the context manager protocol, so you can also use it with the python ‘with’ statement.
The conventional units in the arc file is angstrom. The format only supports storing the cartesian coordinates and box lengths.
Parameters: | filename : str
mode : {‘r’}
force_overwrite : bool
|
---|
Attributes
topology | (Topology) A single-chain, single-residue topology generated from the atom and bond information found in the TINKER archive/xyz file. It is only generated from the first member of the archive |
Open an TINKER.arc file for reading/writing.
Methods
__init__(filename[, mode, force_overwrite]) | Open an TINKER.arc file for reading/writing. |
close() | Close the .arc file |
read([n_frames, stride, atom_indices]) | Read data from a TINKER .arc file. |
read_as_traj([n_frames, stride, atom_indices]) | Read a trajectory from a ARC file |
seek(offset[, whence]) | Move to a new file position |
tell() | Current file position |
write(xyz) | The ArcTrajectoryFile does not have a write method, because TINKER .arc files have special numerical atom types which are not shared by any other trajectory file format. |
Attributes
distance_unit |
Move to a new file position
Parameters: | offset : int
whence : {0, 1, 2}
|
---|
Current file position
Returns: | offset : int
|
---|
Close the .arc file
Read a trajectory from a ARC file
Parameters: | n_frames : int, optional
stride : np.ndarray, optional
atom_indices : array_like, optional
|
---|
See also
Read data from a TINKER .arc file.
Note that only the Cartesian coordinates are read in. The .arc file also contains TINKER-specific numeric atom types and some bonding information, which we do not read in.
Parameters: | n_frames : int, None
stride : np.ndarray, optional
atom_indices : array_like, optional
|
---|---|
Returns: | xyz : np.ndarray, shape=(n_frames, n_atoms, 3), dtype=np.float32
|
The ArcTrajectoryFile does not have a write method, because TINKER .arc files have special numerical atom types which are not shared by any other trajectory file format.
Parameters: | xyz : np.ndarray, shape=(n_frames, n_atoms, 3)
|
---|