mdtraj.load_dtr

mdtraj.load_dtr(filename, top=None, stride=None, atom_indices=None, frame=None)

Load a dtr file from disk.

The .dtr format is a cross-platform compressed binary trajectory format produced by DESMOND. Many different trajectory formats are generated from different versions of DESMOND. They usually stores:

atomic coordinates velocities (or momentum that will be converted to velocity) box vectors time information other arbitrary data
Below lists the supported trajectory format by various version of DESMOND:
WRAPPED_V_2 : single precision, positions and velocities DBL_WRAPPED_V_2: : double precision, positions and velocities WRAPPED_V_1 : single precision, positions and velocities DBL_WRAPPED_V_1 : double precision, positions and velocities POSN_MOMENTUM_V_1 : single precision, positions and momentum DBL_POSN_MOMENTUM_V_1 : double precision, positions and momentum ANTON_SFXP_V3 : trajectory generated on ANTON

WRAPPED_V_2 is produced by DESMOND released by Schrodinger since 2010.

Unlike other trajectory format, DESMOND trajectory splits frames into different files, and put them under a directory. Other auxiliary files containing meta data are also stored under the same directory. Among those files, there is one empty file named clickme.dtr, which is originally created to allow DESMOND trajectory to be loaded by VMD.

Parameters:

filename : str

String filename of dtr file that ends with clickme.dtr. Alternatively, directory name can also be accepted.

top : {str, Trajectory, Topology}

dtr format does not contain topology information. Pass in either the path to a pdb file, a trajectory, or a topology to supply this information.

stride : int, default=None

Only read every stride-th frame

atom_indices : array_like, optional

If not none, then read only a subset of the atoms coordinates from the file. This may be slightly slower than the standard read because it requires an extra copy, but will save memory.

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.DTRTrajectoryFile
Low level interface to dtr files

Examples

>>> # loading clickme.dtr file under DESMOND trajectory directory
>>> import mdtraj as md
>>> traj = md.load_dtr('output_trj/clickme.dtr', top='topology.pdb')
>>> print traj
<mdtraj.Trajectory with 500 frames, 423 atoms at 0x110740a90>
>>> # loading DESMOND trajectory directory directly
>>> import mdtraj as md
>>> traj = md.load_dtr('output_trj', top='topology.pdb')
>>> print traj
<mdtraj.Trajectory with 500 frames, 423 atoms at 0x110740a90>