mdtraj.load_frame¶
-
mdtraj.
load_frame
(filename, index, top=None, atom_indices=None, **kwargs)¶ Load a single frame from a trajectory file
Parameters: filename : str
Path to the trajectory file on disk
index : int
Load the index-th frame from the specified file
top : {str, Trajectory, Topology}
Most trajectory formats do not contain topology information. Pass in either the path to a RCSB PDB file, a trajectory, or a topology to supply this information.
atom_indices : array_like, optional
If not none, then read only a subset of the atoms coordinates from the file. These indices are zero-based (not 1 based, as used by the PDB format).
Returns: trajectory : md.Trajectory
The resulting conformation, as an md.Trajectory object containing a single frame.
See also
Examples
>>> import mdtraj as md >>> first_frame = md.load_frame('traj.h5', 0) >>> print first_frame <mdtraj.Trajectory with 1 frames, 22 atoms>