.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEAssignImplicitHydrogens

.. oe:function:: OEAssignImplicitHydrogens


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

      .. oe:api::

         bool OEAssignImplicitHydrogens(OEAtomBase* atm)

   .. oe:language:: python

      .. oe:api:: python

         OEAssignImplicitHydrogens(atm: OEAtomBase) -> bool

   Sets the implicit hydrogen count property of an atom
   based upon a **OpenEye valence model**.  This function assumes that the
   formal charges may be incorrect or haven't been assigned yet.  This
   function should be followed with a call to the function
   :oe:func:`OEChem::OEAssignFormalCharges`.  This function calls the
   :oe:meth:`OEChem::OEAtomBase::SetImplicitHCount` method on the atom
   with the value returned by :oe:func:`OEChem::OEDefaultImplicitHCount`.

   This function returns ``true`` if the implicit hydrogen count of the atom
   is changed.

   The assigned implicit hydrogen count can be accessed by
   :oe:meth:`OEChem::OEAtomBase::GetImplicitHCount` method.

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

      .. oe:api::

         bool OEAssignImplicitHydrogens(OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEAssignImplicitHydrogens(mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

   Sets the implicit hydrogen count property of each atom in the molecule
   by calling :oe:func:`OEAssignImplicitHydrogens(OEAtomBase *)<OEChem::OEAssignImplicitHydrogens>`.

   This function returns ``true`` if the implicit hydrogen count of any atom in the
   molecule is changed. It returns ``false`` if none of the atoms in the molecule has the
   implicit hydrogen count changed.

   The assigned implicit hydrogen count can be accessed by
   :oe:meth:`OEChem::OEAtomBase::GetImplicitHCount` method.

   .. note::

      If the charge state is correctly set on each atom, you should call the
      :oe:func:`OEChem::OEAssignMDLHydrogens` function instead.

   .. seealso::

      * :ref:`section_valence_openeye` section
      * :oe:func:`OEChem::OEDefaultImplicitHCount` function
      * :oe:func:`OEChem::OEAssignFormalCharges` function
