Interface for reading and writing to a MSMBuilder2 “LH5” molecular dynamics trajectory file, a deprecated format.
Parameters: | filename : str
mode : {‘r, ‘w’}
force_overwrite : bool
|
---|
Methods
__init__(filename[, mode, force_overwrite]) | |
close() | Close the HDF5 file handle |
flush() | Write all buffered data in the to the disk file. |
read([n_frames, stride, atom_indices]) | Read one or more frames of data from the file |
read_as_traj([n_frames, stride, atom_indices]) | Read a trajectory from the LH5 file |
seek(offset[, whence]) | Move to a new file position |
tell() | Current file position |
write(coordinates) | Write one or more frames of data to the file |
Attributes
distance_unit | |
topology | Get the topology out from the file |
Close the HDF5 file handle
Write all buffered data in the to the disk file.
Read one or more frames of data from the file
Parameters: | n_frames : {int, None}
stride : {int, None}
atom_indices : {int, None}
|
---|---|
Returns: | xyz : np.ndarray, shape=(n_frames, n_atoms, 3), dtype=np.float32
|
Read a trajectory from the LH5 file
Parameters: | n_frames : {int, None}
stride : {int, None}
atom_indices : {int, None}
|
---|---|
Returns: | trajectory : Trajectory
|
Move to a new file position
Parameters: | offset : int
whence : {0, 1, 2}
|
---|
Current file position
Returns: | offset : int
|
---|
Get the topology out from the file
Returns: | topology : mdtraj.Topology
|
---|
Write one or more frames of data to the file
Parameters: | coordinates : np.ndarray, dtype=np.float32, shape=(n_frames, n_atoms, 3)
|
---|