# BioSimSpace.Trajectory.Trajectory¶

class BioSimSpace.Trajectory.Trajectory(process=None, trajectory=None, topology=None, system=None, property_map={})

A class for reading a manipulating biomolecular trajectories.

__init__(process=None, trajectory=None, topology=None, system=None, property_map={})

Constructor.

Parameters
• process (Process) – A BioSimSpace process object.

• trajectory (str) – A trajectory file.

• topology (str) – A topology file.

• system (System) – A BioSimSpace System object. If passed, then trajectory coordinates and velocities will be copied into this system and returned. This is useful if you wish to preserve all molecular properties, which might be lost during reading of the topology format required by the trajectory backend.

• property_map (dict) – A dictionary that maps system “properties” to their user defined values. This allows the user to refer to properties with their own naming scheme, e.g. { “charge” : “my-charge” }

Methods

 __init__([process, trajectory, topology, …]) Constructor. getFrames([indices]) Get trajectory frames as a list of System objects. getTrajectory([format]) Get the current trajectory object. Return the current number of trajectory frames. rmsd([frame, atoms]) Compute the root mean squared displacement.
getFrames(indices=None)

Get trajectory frames as a list of System objects.

Parameters

indices ([int], [Time]) – A list of trajectory frame indices, or time stamps (in ns).

Returns

frames – The list of System objects.

Return type
getTrajectory(format='auto')

Get the current trajectory object.

Parameters

format (str) – Whether to return an ‘MDTraj’ or ‘MDAnalysis’ object. Use “auto” if you are happy with either format, i.e. it will try each backend in sequence and return an object from the first one that works.

Returns

trajectory – The trajectory in MDTraj or MDAnalysis format.

Return type

mdtraj.core.trajectory.Trajectory, MDAnalysis.core.universe.Universe

nFrames()

Return the current number of trajectory frames.

Returns

nFrames – The number of trajectory frames.

Return type

int

rmsd(frame=None, atoms=None)

Compute the root mean squared displacement.

Parameters
• frame (int) – The index of the reference frame.

• atoms ([int]) – A list of reference atom indices.

Returns

rmsd – A list containing the RMSD value at each time point.

Return type