Container Classes: Serializer, Conformation, Trajectory

Trajectory

class msmbuilder.Trajectory.Trajectory(S)[source]

Bases: msmbuilder.Conformation.ConformationBaseClass

This is the representation of a sequence of conformations.

Notes: Use classmethod load_from_pdb to create an instance of this class from a PDB filename. The Trajectory is a dictionary-like object. The dictionary key ‘XYZList’ contains a numpy array of XYZ coordinates, stored such that X[i,j,k] gives Frame i, Atom j, Coordinate k.

Loading from disk

Trajectory.load_trajectory_file(Filename[, ...]) Loads a trajectory into memory, automatically deciding which methods to call based on filetype.
Trajectory.load_from_pdb(Filename) Create a Trajectory from a PDB Filename
Trajectory.load_from_pdbList(Filenames) Create a Trajectory with title Title from a Filename.
Trajectory.load_from_trr(TRRFilenameList[, ...]) Create a Trajectory with title Title from a Filename.
Trajectory.load_from_dcd(FilenameList[, ...]) Create a Trajectory from a Filename.
Trajectory.load_from_xtc(XTCFilenameList[, ...]) Create a Trajectory from a collection of XTC files
Trajectory.load_from_hdf(TrajFilename[, ...]) Method to load a trajectory which was saved as HDF
Trajectory.load_from_lhdf(TrajFilename[, ...]) Method to load a trajectory which was saved as LHDF

Reading in chunks

Trajectory.enum_chunks_from_hdf(TrajFilename) Function to read trajectory files which have been saved as HDF.
Trajectory.enum_chunks_from_lhdf(TrajFilename) Method to read trajectory files which have been saved as LHDF.

Saving to disk

Trajectory.save(Filename[, precision]) Dump the coordinates to disk in format auto-detected by filename
Trajectory.SaveToHDF
Trajectory.save_to_lhdf(filename[, precision]) Save a Trajectory instance to a Lossy HDF File.
Trajectory.save_to_xtc(filename[, precision]) Dump the coordinates to XTC
Trajectory.save_to_pdb(Filename) Dump the coordinates to PDB
Trajectory.save_to_xyz(Filename) Dump the coordinates to XYZ format

Read a single frame

Trajectory.read_frame(TrajFilename, WhichFrame)
Trajectory.read_hdf_frame(TrajFilename, ...) Read a single frame from HDF5 trajectory file without loading file into memory.
Trajectory.read_lhdf_frame(TrajFilename, ...) Read a single frame from Lossy LHDF5 trajectory file without loading file into memory.
Trajectory.read_dcd_frame(TrajFilename, ...) Read a single frame from DCD trajectory without loading file into memory.
Trajectory.read_xtc_frame(TrajFilename, ...) Read a single frame from XTC trajectory file without loading file into memory.

Appending

Trajectory.append_frames_to_file(filename, ...) Append an array of XYZ data to an existing .h5 or .lh5 file.
Trajectory.AppendPDB(Filename) Add on to a pdb file

Manipulation

Trajectory.restrict_atom_indices(AtomIndices)
Trajectory.subsample(stride) Keep only the frames at some interval
Trajectory.GetEnumeratedAtomID() Returns an array of consecutive integers that enumerate over all atoms in the system.
Trajectory.GetEnumeratedResidueID() Returns an array of NONUNIQUE consecutive integers that enumerate over all Residues in the system. STARTING WITH ZERO!
Trajectory.GetNumberOfAtoms() Return the number of atoms in this object.
Trajectory.GetNumberOfResidues() Return the number of residues in this object.