mdtraj.load_pdb

mdtraj.load_pdb(filename, stride=None, atom_indices=None, frame=None)

Load a RCSB Protein Data Bank file from disk.

Parameters:

filename : str

Path to the PDB file on disk.

stride : int, default=None

Only read every stride-th model from the file

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). So if you want to load only the first atom in the file, you would supply atom_indices = np.array([0]).

frame : int, optional

Use this option to load only a single frame from a trajectory on disk. If frame is None, the default, the entire trajectory will be loaded. If supplied, stride will be ignored.

Returns:

trajectory : md.Trajectory

The resulting trajectory, as an md.Trajectory object.

See also

mdtraj.PDBTrajectoryFile
Low level interface to PDB files

Examples

>>> import mdtraj as md
>>> pdb = md.load_pdb('2EQQ.pdb')
>>> print pdb
<mdtraj.Trajectory with 20 frames, 423 atoms at 0x110740a90>
Versions