mdtraj.formats.LH5TrajectoryFile

class mdtraj.formats.LH5TrajectoryFile(filename, mode='r', force_overwrite=True)

Interface for reading and writing to a MSMBuilder2 “LH5” molecular dynamics trajectory file, a deprecated format.

Parameters
filenamestr

Path to the file to open

mode{‘r, ‘w’}

Mode in which to open the file. ‘r’ is for reading and ‘w’ is for writing

force_overwritebool

In mode=’w’, how do you want to behave if a file by the name of filename already exists? if force_overwrite=True, it will be overwritten.

Attributes
topology

Get the topology out from the file

Methods

close(self)

Close the HDF5 file handle

flush(self)

Write all buffered data in the to the disk file.

read(self[, n_frames, stride, atom_indices])

Read one or more frames of data from the file

read_as_traj(self[, n_frames, stride, …])

Read a trajectory from the LH5 file

seek(self, offset[, whence])

Move to a new file position

tell(self)

Current file position

write(self, coordinates)

Write one or more frames of data to the file

__init__(self, filename, mode='r', force_overwrite=True)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, filename[, mode, force_overwrite])

Initialize self.

close(self)

Close the HDF5 file handle

flush(self)

Write all buffered data in the to the disk file.

read(self[, n_frames, stride, atom_indices])

Read one or more frames of data from the file

read_as_traj(self[, n_frames, stride, …])

Read a trajectory from the LH5 file

seek(self, offset[, whence])

Move to a new file position

tell(self)

Current file position

write(self, coordinates)

Write one or more frames of data to the file

Attributes

distance_unit

topology

Get the topology out from the file