.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEDetermineAromaticRingSystems

.. oe:function:: OEDetermineAromaticRingSystems

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

      .. oe:api::

         unsigned int OEDetermineAromaticRingSystems(const OEMolBase& mol,
                                                     unsigned int* rings)

   .. oe:language:: python

      .. oe:api:: python

         OEDetermineAromaticRingSystems(mol: Union[OEGraphMol,OEMol,OEQMol]) -> Tuple[int, List[int]]

   Determines the aromatic ring systems of a molecule.  The return
   value is the number of aromatic ring systems found in the molecule.
   If the molecule is acyclic or there is no aromatic ring system in
   the molecule, the return value is zero.  The 'rings' array must
   contain at least :oe:meth:`OEChem::OEMolBase::GetMaxAtomIdx`
   elements, and upon return it contains a mapping indexed by
   :oe:meth:`OEChem::OEAtomBase::GetIdx` of which aromatic ring system
   each atom is in.  The aromatic ring systems are numbered from one,
   up to an including the return value of the function.  Atoms that
   aren't contained in an aromatic ring, *i.e.* for which
   :oe:meth:`OEChem::OEAtomBase::IsInRing` or
   :oe:meth:`OEChem::OEAtomBase::IsAromatic` returns ``false``, are
   mapped to the value zero.

   .. warning::

      It is necessary to call :oe:func:`OEChem::OEFindRingAtomsAndBonds` and
      :oe:func:`OEChem::OEAssignAromaticFlags` functions prior to calling
      :oe:func:`OEChem::OEDetermineAromaticRingSystems` function.

   .. seealso::

      * :ref:`section_ring_system_identification` section

