
.. include:: ../substitutions

.. oe:namespace:: OEProton

.. meta::
   :keywords: OERemoveFormalCharge

.. _OEProton_OERemoveFormalCharge:

.. oe:function:: OERemoveFormalCharge

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

      .. oe:api::

         bool OERemoveFormalCharge(OEChem::OEMolBase& mol)
         bool OERemoveFormalCharge(OEChem::OEMCMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

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

   This function will attempt to remove all formal charges from ``mol`` in
   a manner that is consistent with adding and removing implicit or explicit
   protons.  This method will not create radicals and will not attach more
   protons to an atom than is acceptable in that atom's standard valence form.
   The formal charge of quaternary amines is not removed because removing it
   would create a hypervalent nitrogen.
