.. include:: ../substitutions

.. oe:namespace:: OEMolProp

.. meta::
   :keywords: OEGetHBondAcceptorCount

.. _OEMolProp_OEGetHBondAcceptorCount:

.. oe:function:: OEGetHBondAcceptorCount

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

      .. oe:api::

         unsigned int OEGetHBondAcceptorCount(const OEChem::OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEGetHBondAcceptorCount(mol: Union[OEGraphMol,OEMol,OEQMol]) -> int

   Returns the number of hydrogen-bond acceptors in a molecule based on
   the definition in the work of Mills and Dean ([Mills-Dean-1996]_)
   and also in the book by Jeffrey ([Jeffrey-1997]_). It is defined
   to be the number of atoms which match any of the following:

   * degree 2, aromatic, non-positive nitrogens. An example is shown below.

   .. figure:: ../../../common/images/molprop/acceptorDef1.*
      :width:  200pt
      :align:  center

   * electron rich or negative, valence less than 4, non-aromatic nitrogens.
     An example is shown below.

   .. figure:: ../../../common/images/molprop/acceptorDef2.*
      :width:  200pt
      :align:  center

   * negatively charged or not electron withdrawn, neutral, non-aromatic oxygens.
     An example is shown below.

   .. figure:: ../../../common/images/molprop/acceptorDef3.*
      :width:  200pt
      :align:  center

   * degree 1, double bonded, electron rich, non-aromatic sulfur. An example
     is shown below.

   .. figure:: ../../../common/images/molprop/acceptorDef4.*
      :width:  200pt
      :align:  center

   .. seealso::

      * :oe:func:`OEMolProp::OEGetHBondDonorCount` function
      * :oe:func:`OEMolProp::OEGetLipinskiAcceptorCount` function
      * :ref:`molprops_lipinski` section
      * :ref:`filter_files_hbond_acceptor` subsection describing filter files

   **Example**

   The :oe:func:`OEMolProp::OEGetHBondAcceptorCount` function returns ``3`` for the molecule below.

   .. figure:: ../../../common/images/molprop/HBAcceptor.*
      :width:  300pt
      :align:  center



