.. # split from OEMolPropFunctions.rst:12

.. include:: ../substitutions

.. oe:namespace:: OEMolProp

.. meta::
   :keywords: OEGet2dPSA

.. _OEMolProp_OEGet2dPSA:

.. oe:function:: OEGet2dPSA

   .. oe:language:: c++

      .. oe:api:: c++

         bool OEGet2dPSA(const OEChem::OEMolBase& mol, float& psa,
                         float* atomPSA = 0, bool SandP = false)

   .. oe:language:: python

      .. oe:api:: python

         OEGet2dPSA(mol: Union[OEGraphMol,OEMol,OEQMol],
                    atomPSA: OEFloatArray = None, SandP: bool = False) -> bool

   .. oe:language:: java

      .. oe:api:: java

         float OEGet2dPSA(OEMolBase mol, OEFloatArray atomPSA, boolean SandP)
         float OEGet2dPSA(OEMolBase mol, OEFloatArray atomPSA)
         float OEGet2dPSA(OEMolBase mol)

   Returns the topological polar surface area for a given molecule as
   described in the :ref:`molprops_polar_surface_area` section. The
   ``SandP`` parameter controls whether sulfur and phosphorus should be
   counted towards the total surface area.
   See example in :ref:`Figure: Example of depicting the atom contributions of
   the polar surface area <figure_OEGet2dPSA>`.

   .. note::

      TPSA values are mildly sensitive to the protonation state of a
      molecule.

   The ``atomPSA`` parameter can be used to retrieve the contribution
   of each atom to the total polar surface area as shown in
   :oe:src:`Listing 1<PSAAtomContributions>`.

   .. oe:source:: PSAAtomContributions.cpp
      :language: c++
      :frag:     SNIPPET-ATOMS
      :caption: Example of retrieving individual atom contributions to PSA
      :refnum: 1

   .. oe:source:: PSAAtomContributions.py
      :language: python
      :frag:     SNIPPET-ATOMS
      :caption:  Example of retrieving individual atom contributions to PSA.
      :refnum:   1

   ..   oe:language:: python

        :ref:`Full listing. <listing-PSAAtomContributions.py>`

   .. oe:source:: PSAAtomContributions.java
      :language: java
      :noindent:
      :frag:     SNIPPET-ATOMS
      :caption:  Example of retrieving individual atom contributions to PSA
      :refnum:   1

   .. oe:source:: PSAAtomContributions.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-ATOMS
      :caption:  Example of retrieving individual atom contributions to PSA
      :refnum:   1

   .. _figure_OEGet2dPSA:

   .. figure:: ../../../common/images/molprop/OEGet2dPSA.*
      :align:  center

      **Example of depicting the atom contributions of the polar surface area (ignoring S and P atoms)**

      (Darker colors and longer spikes indicate larger PSA atom contributions)

   .. _figure_OEGet2dPSA_SAndP:

   .. figure:: ../../../common/images/molprop/OEGet2dPSA-SAndP.*
      :align:  center

      **Example of depicting the atom contributions of the polar surface area (considering S and P atoms)**

      (Darker colors and longer spikes indicate larger PSA atom contributions)

   .. seealso::

      * :ref:`molprops_polar_surface_area` section
      * `OpenEye Python Cookbook — PSA depiction <http://docs.eyesopen.com/toolkits/cookbook/python/depiction/psa.html>`__

