.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEMDLPerceiveParity

.. oe:function:: OEMDLPerceiveParity

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

      .. oe:api::

         void OEMDLPerceiveParity(OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEMDLPerceiveParity(mol: Union[OEGraphMol,OEMol,OEQMol]) -> None

   This function sets the MDL stereo parity information for each atom
   from the **OEChem TK** stereochemistry.  Any atom that has tetrahedral stereo
   specified has the corresponding MDL stereo parity value, one or two, placed in its
   'MDLParity' generic data, with type ``unsigned int``.  This MDL stereo
   parity is relative to the current order of atoms returned by an
   iterator of atoms across a molecule.  All other atoms, non-chiral or
   without stereo specified, have their MDL stereo parity set to zero or three.

   :oe:func:`OEChem::OEMDLPerceiveParity` internally calls the
   :oe:func:`OEChem::OEPerceiveChiral` function, so there's no need to
   explicitly call :oe:func:`OEChem::OEPerceiveChiral` on a molecule prior
   to calling :oe:func:`OEChem::OEMDLPerceiveParity`.

   .. note::

      This function is the opposite of the
      :oe:func:`OEChem::OEMDLStereoFromParity` function.

   .. note::

      This function assumes that atoms have stereo parity values assigned explicitly.  This is generally automatic
      when reading structure file formats, or via generation of conformers.  For 3D structures
      from other sources, an explicit call to the :oe:func:`OEChem::OE3DToInternalStereo` function prior to
      calling this function may be required to ensure atom stereo parities are assigned based on the 3D coordinates.

   .. seealso::

      * :oe:func:`OEChem::OEMDLHasParity` function
      * :oe:func:`OEChem::OEMDLSetParity` and :oe:func:`OEChem::OEMDLGetParity` functions
      * :oe:func:`OEChem::OEMDLClearParity` function
      * :oe:func:`OEChem::OE3DToInternalStereo` function
      * :oe:func:`OEChem::OE3DToAtomStereo` function
