mdtraj.compute_dihedrals

mdtraj.compute_dihedrals(traj, indices, opt=True)

Compute the dihedral angles between the supplied quartets of atoms in each frame in a trajectory.

Parameters:

traj : Trajectory

An mtraj trajectory.

indices : np.ndarray, shape=(n_dihedrals, 4), dtype=int

Each row gives the indices of four atoms which together make a dihedral angle. The angle is between the planes spanned by the first three atoms and the last three atoms, a torsion around the bond between the middle two atoms.

opt : bool, default=True

Use an optimized native library to calculate angles.

Returns:

dihedrals : np.ndarray, shape=(n_frames, n_dihedrals), dtype=float

The output array gives, in each frame from the trajectory, each of the n_dihedrals torsion angles. The angles are measured in radians.

Versions