.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEExtractRingTemplates

.. oe:function:: OEExtractRingTemplates

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

      .. oe:api::

         OESystem::OEIterBase<OEMolBase> * OEExtractRingTemplates(const OEMolBase& mol)
         OESystem::OEIterBase<OEMolBase> * OEExtractRingTemplates(const OEMolBase& mol,
                                                                  const OEExtractRingTemplateOptions& opts)

   .. oe:language:: python

      .. oe:api:: python

         OEExtractRingTemplates(mol: Union[OEGraphMol,OEMol,OEQMol]) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]
         OEExtractRingTemplates(mol: Union[OEGraphMol,OEMol,OEQMol],
                                opts: OEExtractRingTemplateOptions) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]

   Returns an iterator over the anonymized ring systems of the given molecule.

   .. note::

      The :oe:func:`OEChem::OEExtractRingTemplates` function is used to extract
      potential new ring templates for the 2D coordinate generation system
      and it requires an input molecule with 2D coordinates.

      We recommend using the :ref:`OE2DRingDictionary <OEChem_OE2DRingDictionary>` class for generating a
      ring template dictionary.

   .. seealso::

      .. oe:language:: c++

         * :ref:`OEExtractRingTemplateOptions <OEChem_OEExtractRingTemplateOptions>` class
         * Example program :ref:`extractringtemplates.cpp<section_example_oechem_extractringtemplates>`

      .. oe:language:: python

         * :ref:`OEExtractRingTemplateOptions <OEChem_OEExtractRingTemplateOptions>` class
         * Example program :ref:`extractringtemplates.py<section_example_oechem_extractringtemplates>`

      .. oe:language:: java

         * :ref:`OEExtractRingTemplateOptions <OEChem_OEExtractRingTemplateOptions>` class
         * Example program :ref:`ExtractRingTemplates.java<section_example_oechem_extractringtemplates>`

      .. oe:language:: csharp

         * :ref:`OEExtractRingTemplateOptions <OEChem_OEExtractRingTemplateOptions>` class
         * Example program :ref:`ExtractRingTemplates.cs<section_example_oechem_extractringtemplates>`
