.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEKekulize

.. oe:function:: OEKekulize

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

      .. oe:api::

         bool OEKekulize(OEMolBase &)

   .. oe:language:: python

      .. oe:api:: python

         OEKekulize(arg1: Union[OEGraphMol,OEMol,OEQMol]) -> bool

   Determine a valid |Kekule| form for a molecule.  On input, the integer
   bond types of each bond should be set to ``1`` for single, ``2`` for double, ``3``
   for triple, ``4`` for quadruple and ``5`` for an aromatic (or resonant bond).
   On output, the bond order property of each bond is set to the integer
   bond types, except for bonds marked type ``5``, which are assigned as
   either single or double as required.  The formal charges and implicit
   hydrogen counts of each atom must be correctly specified prior to
   calling this function. The
   :oe:func:`OEChem::OEKekulize` function returns false and throws a warning
   if the integer bond types are not set correctly. Newly created bonds will
   have their integer types set to ``0``    by default. These will need to be
   set to the appropriate values before calling :oe:func:`OEChem::OEKekulize`;
   see the :ref:`section_kekule_assignment_of_new_bonds` section for examples.

   Note that this function will not clear the aromatic flags associated
   with atoms and bonds.  These flags may affect resulting output
   (*e.g.* :term:`SMILES`) or downstream processing.  So, if these effects are not
   desired, the function :oe:func:`OEChem::OEClearAromaticFlags` should be
   used.

.. seealso::

  .. oe:language:: c++

      * Example program :ref:`cansmi.cpp<section_example_oechem_cansmi>`

  .. oe:language:: python

      * Example program :ref:`cansmi.py<section_example_oechem_cansmi>`

  .. oe:language:: java

      * Example program :ref:`CanSmi.java<section_example_oechem_cansmi>`

  .. oe:language:: csharp

      * Example program :ref:`CanSmi.cs<section_example_oechem_cansmi>`

.. ################################################################
   #
   ################################################################

