.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OERGroupsToHydrogens

.. oe:function:: OERGroupsToHydrogens

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

      .. oe:api::

         bool OERGroupsToHydrogens(OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

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

   Converts terminal R-groups (atoms with atomic number 0) in a molecule to hydrogen atoms.
   The terminal requirement means it can only and must be be connected to one heavy atom.
   Additionally, it R-group atoms implicit hydrogen count must be zero.
   The function attempts to be consistent with the input molecule,
   such that molecules with only implicit hydrogens will stay that way after the conversion.
   If a molecule has explicit hydrogens, the function will convert the R-group to an explicit
   hydrogen atom. For a molecule in 3D, the new hydrogen will have 3D coordinates, either retaining
   the coordinates of the R-group atom, of that was places at (0,0,0) the hydrogen will be assigned
   proper 3D coordinates.

   .. seealso::

      * :oe:func:`OEChem::OESet3DHydrogenGeom` that assigned proper 3D geometry to the hydrogen atom if needed.
