mdtraj.load_xyz

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

Load a xyz trajectory file.

While there is no universal standard for this format, this plugin adheres to the same format as the VMD plugin:

http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/xyzplugin.html

Most notably, units are in angstroms and anything past the ‘z’ field is ignored.

Parameters:
filenamepath-like

Path of xyz trajectory file.

top{str, Trajectory, Topology}

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

strideint, default=None

Only read every stride-th frame

atom_indicesarray_like, optional

If not none, then read only a subset of the atoms coordinates from the file.

frameint, 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:
trajectorymd.Trajectory

The resulting trajectory, as an md.Trajectory object.

See also

mdtraj.XYZTrajectoryFile

Low level interface to xyz files