
.. include:: ../substitutions

.. oe:namespace:: OEProton

.. meta::
   :keywords: OEAssignPartialCharges, AssignPartialCharges

.. oe:function:: OEAssignPartialCharges


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

      .. oe:api::

         bool OEAssignPartialCharges(OEChem::OEMolBase& mol,
                                     unsigned int method = OECharges::Default,
                                     bool noHydrogen = false,
                                     bool debug = false, bool epsilon2 = false)
         bool OEAssignPartialCharges(OEChem::OEMCMolBase& mol,
                                     unsigned int method = OECharges::Default,
                                     bool noHydrogen = false,
                                     bool debug = false, bool epsilon2 = false)

   .. oe:language:: python

      .. oe:api:: python

         OEAssignPartialCharges(mol: Union[OEGraphMol,OEQMol], method: int,
                                noHydrogen: bool = False, debug: bool = False,
                                epsilon2: bool = False) -> bool
         OEAssignPartialCharges(mol: OEMol, method: int,
                                noHydrogen: bool = False, debug: bool = False,
                                epsilon2: bool = False) -> bool

   .. note::

      This deprecated function will not be developed further. It is being replaced by
      :oe:func:`OEAssignCharges<OEProton::OEAssignCharges>` which provides
      more control and greater expandability.

   This function sets the partial charge value of each atom in a
   molecule.  The molecule to be charged is passed as the first
   argument.  The second argument is the charge model to be used.
   These values should be selected from the
   :oe:constns:`OEProton::OECharges` namespace.  The third argument is
   a boolean for whether the final molecule should have explicit
   hydrogens.  If ``noHydrogen`` is set to true, all hydrogens will be
   made implicit, and the charge on each heavy atom with attached
   hydrogens will be adjusted to be the sum of its original partial
   charge and all of the attached hydrogen partial charges.  The
   ``debug`` flag controls the volume of debug information written to
   standard error.  This function returns a boolean value evaluating
   the success of the calculation.

   This function is overloaded to accept an ``OEMolBase`` or an
   ``OEMCMolBase``.  Currently, only ``AM1`` and ``AM1BCC`` charges
   have specialized multiconformer implementations in the
   ``OEMCMolBase`` overload.  For all other charges, the
   ``OEMCMolBase`` and ``OEMolBase`` implementations are identical.
   The ``epsilon2`` flag selects an alternative parameterization of the
   AM1-BCC charge model when set to ``true``. [default = false]

   .. seealso::

      * :oe:func:`OEProton::OEAssignCharges` function
