.. # split from OEBioFunctions.rst:606

.. include:: ../substitutions

.. oe:namespace:: OEBio

.. meta::
   :keywords: OERMSD

.. oe:function:: OERMSD

   .. oe:language:: c++ java csharp

      .. oe:api::

         double OERMSD(const OEChem::OEMolBase& ref,
                       const OEChem::OEMolBase& fit,
                       OESequenceAlignment& align, bool onlyCAlpha = true,
                       bool overlay = false, double* rot = 0, double* trans = 0)

   .. oe:language:: python

      .. oe:api:: python

         OERMSD(ref: Union[OEGraphMol,OEMol,OEQMol],
                fit: Union[OEGraphMol,OEMol,OEQMol],
                align: OESequenceAlignment, onlyCAlpha: bool = True,
                overlay: bool = False, rot: OEDoubleArray = None,
                trans: OEDoubleArray = None) -> float

   This OEBio :oe:func:`OEBio::OERMSD` function is quite
   analogous to the heavily
   overloaded OEChem :oe:func:`OEChem::OERMSD` functions.
   This function takes two molecules as const
   parameters (one the reference and the other to be fit) and adds
   an additional :ref:`OESequenceAlignment <OEBio_OESequenceAlignment>`
   class parameter that indicates the correspondence between the two molecules.
   Whether the corresponding
   alignment considers all backbone atoms or only alpha carbons is
   controlled by the 'onlyCAlpha' parameter. The 'overlay' parameter
   indicates whether the RMSD should be measured using the current
   coordinates of the two molecules (default) or whether an optimum
   possible RMSD between the two molecules should be calculated. If
   the optimum overlay is calculated, the transformations applied to
   the 'fit' molecule to generate this optimum overlay can be retrieved
   by passing an array of ``double[9]`` to the 'rot' parameter and an array
   of ``double[3]`` to the 'trans' parameter. These two arrays can
   subsequently be applied to the 'fit' molecule using the
   :oe:func:`OEChem::OERotate` and :oe:func:`OEChem::OETranslate` 
   functions if desired. It is important that
   :oe:func:`OEChem::OERotate` and :oe:func:`OEChem::OETranslate` are
   applied in that order.

   The return value is a root-mean square distance between the
   specified atoms in the two molecules.

   **ref**
      The reference molecule. Must have 3D coordinates assigned.

   **fit**
      The molecule to be fitted. Must have 3D coordinates assigned.

