mdtraj.load_binpos

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

Load an AMBER .binpos file from disk.

The .binpos format is a cross-platform binary trajectory format produced by AMBER software. It stores only the atomic coordinates, and does not store any unit cell informations. Its use is discouraged.

Parameters:

filename : str

String filename of AMBER binpos file.

top : {str, Trajectory, Topology}

The BINPOS 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.BINPOSTrajectoryFile
Low level interface to BINPOS files

Examples

>>> import mdtraj as md                                        
>>> traj = md.load_binpos('output.binpos', top='topology.pdb') 
>>> print traj                                                 
<mdtraj.Trajectory with 500 frames, 423 atoms at 0x110740a90>  
>>> traj2 = md.load_binpos('output.dcd', stride=2, top='topology.pdb') 
>>> print traj2                                                      
<mdtraj.Trajectory with 250 frames, 423 atoms at 0x11136e410>