# mdtraj.rmsf

mdtraj.rmsf(target, reference, frame=0, atom_indices=None, parallel=True, precentered=False)

  Compute RMSF of atom positions in target trajectory. This will center target conformations in place.

  Parameters:

    - target (md.Trajectory) – Compute the RMSF of atom positions in target trajectory.

    - reference (md.Trajectory, or None) – A trajectory with the same number of atoms as in the target to be used as a reference. If None, the average xyz positions of each atom will be used.

    - frame (int, default=0) – The index of the conformation in reference to measure distances to.

    - atom_indices (array_like, or None) – The indices of the atoms to use in the RMSF calculation. If not supplied, all atoms will be used. If the atoms used in alignment and the atoms used in RMSF calculations are different, the trajectory must be aligned first manually.

    - ref_atom_indices (array_like, or None) – Use these indices for the reference trajectory. If not supplied, the atom indices will be the same as those for target.

    - parallel (bool) – Use OpenMP to calculate each of the RMSFs in parallel over multiple cores.

    - precentered (bool, default=False) – Assume that the conformations are already centered at the origin, and that the “rmsd_traces” have been computed, as is done by Trajectory.center_coordinates. The “rmsd_traces” are intermediate calculations needed for the RMSF calculation which can be computed independently on each trajectory. Note that this has the potential to be unsafe; if you use Trajectory.center_coordinates and then modify the trajectory’s coordinates, the center and traces will be out of date and the RMSFs will be incorrect.

  Examples

      >>> import mdtraj as md
      >>> rmsf = md.rmsf(trajectory, trajectory, 0)
      >>> print rmsf
      array([ 0.0,  0.03076187,  0.02549562, ...,  0.06230228,
          0.00666826,  0.24364147])

  The calculation is slightly faster if you precenter the trajectory >>> trajectory.center_coordinates() >>> rmsf = md.rmsf(trajectory, trajectory, 0, precentered=True)

  If the atoms used in alignment and RMSF calculations are different, align the trajectory before using this method. >>> trajectory.superpose(atom_indices=atom_indices) >>> rmsf = md.rmsf(trajectory, None, atom_indices=rmsf_atom_indices)

  See also

  `Trajectory.center_coordinates`

  Notes

  This function uses OpenMP to parallelize the calculation across multiple cores. To control the number of threads launched by OpenMP, you can set the environment variable `OMP_NUM_THREADS`.

  Returns:

    rmsf – A 1-D numpy array of the optimal root-mean-square fluctuations of the selected atoms.

  Return type:

    np.ndarray, shape=(atom_indices,)