.. oe:namespace:: OEPB



.. meta::
   :keywords: OEBind, Bind


.. _OEPB_OEBind:

.. oe:class:: OEBind

   .. oe:api::


      class OEBind

   Calculates protein-ligand binding properties.  The protein may either be
   passed in as an argument during construction or set with
   :oe:meth:`OEPB::OEBind::SetProtein`.  The ligand is passed in as an
   argument to :oe:meth:`OEPB::OEBind::Bind` as well as an
   :ref:`OEBindResults <OEPB_OEBindResults>` instance.
   
   .. oe:method:: Constructors

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

         .. oe:api::

            OEBind()
            OEBind(const OEBind& rhs)
            OEBind(const OEChem::OEMolBase& protein)

      .. oe:language:: python

         .. oe:api:: python

            OEBind() -> OEBind
            OEBind(rhs: OEBind) -> OEBind
            OEBind(protein: Union[OEGraphMol,OEMol,OEQMol]) -> OEBind

      Default and copy constructors.  Besides the default and copy
      constructors, OEBind includes a constructor that takes the protein
      to be used in binding calculations. Constructing an OEBind object
      with the protein is identical to using the default constructor and
      then calling :oe:meth:`OEPB::OEBind::SetProtein`.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEBind &operator=(const OEBind &rhs)


      Assignment operator. 

   .. oe:method:: Bind

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

         .. oe:api::

            bool Bind(const OEChem::OEMolBase& ligand, OEBindResults& results)
            OESystem::OEIterBase<OEBindResults>* Bind(const OEChem::OEMCMolBase& ligand)

      .. oe:language:: python

         .. oe:api:: python

            Bind(ligand: Union[OEGraphMol,OEMol,OEQMol], results: OEBindResults) -> bool
            Bind(ligand: OEMol) -> OEBindResultsIter


      Calculate full binding results, including Coulombic terms. For a
      single molecule, pass in the molecule and the :ref:`OEBindResults <OEPB_OEBindResults>` class
      will be filled in.  The following is a simple example of how `Bind`
      is used.

      .. oe:source:: OEBind.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEBind
         :caption:  Example of using the OEBind object

      .. oe:source:: OEBind.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEBind
         :caption:  Example of using the OEBind object

      .. oe:language:: python

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

      .. oe:source:: OEBind.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEBind
         :caption:  Example of using the OEBind object

      .. oe:source:: OEBind.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEBind
         :caption:  Example of using the OEBind object

   .. oe:method:: GetZap

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

         .. oe:api::

            OEZap& GetZap()
            const OEZap& GetZap() const

      .. oe:language:: python

         .. oe:api:: python

            GetZap() -> OEZap

      Get a reference to the internal :ref:`OEZap <OEPB_OEZap>` object
      contained in an OEBind instance.  With the non-const version, you
      can adjust :ref:`OEZap <OEPB_OEZap>` parameters that affect the
      :ref:`OEBind <OEPB_OEBind>` calculation. For example, to use an
      :ref:`OEBind <OEPB_OEBind>` instance with a specific grid spacing:

      .. oe:source:: OEBind.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEBind-SetGridSpacing
         :caption:  Example of setting the grid spacing of a OEBind object

      .. oe:source:: OEBind.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEBind-SetGridSpacing
         :caption:  Example of setting the grid spacing of a OEBind object

      .. oe:language:: python

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


      .. oe:source:: OEBind.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEBind-SetGridSpacing
         :caption:  Example of setting the grid spacing of a OEBind object

      .. oe:source:: OEBind.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEBind-SetGridSpacing
         :caption:  Example of setting the grid spacing of a OEBind object

      Note that some properties of the :ref:`OEZap <OEPB_OEZap>` object are
      not controllable via this mechanism.

   .. oe:method:: SetProtein

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

         .. oe:api::

            bool SetProtein(const OEChem::OEMolBase& protein)

      .. oe:language:: python

         .. oe:api:: python

            SetProtein(protein: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      Set the protein molecule to be used by the :ref:`OEBind <OEPB_OEBind>` object. Note that the protein
      should have radii and partial charges pre-calculated before passing to 
      :oe:meth:`OEPB::OEBind::SetProtein`.

   .. oe:method:: SetZap

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

         .. oe:api::

            bool SetZap(const OEZap& zap)

      .. oe:language:: python

         .. oe:api:: python

            SetZap(zap: OEZap) -> bool

      Update the internal OEZap object.  Note that some properties of the OEZap 
      object are not controllable via this mechanism.

   .. oe:method:: SimpleBind

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

         .. oe:api::

            bool SimpleBind(const OEChem::OEMolBase& ligand,
                            OESimpleBindResults& results)
            OESystem::OEIterBase<OESimpleBindResults>* SimpleBind(const OEChem::OEMCMolBase& ligand)

      .. oe:language:: python

         .. oe:api:: python

            SimpleBind(ligand: Union[OEGraphMol,OEMol,OEQMol],
                       results: OESimpleBindResults) -> bool
            SimpleBind(ligand: OEMol) -> OESimpleBindResultsIter

      Calculate simple binding results, without the Coulombic terms.
      See the discussion in :ref:`section_bindingenergies` about the differences
      between :oe:meth:`OEPB::OEBind::Bind` and :oe:meth:`OEPB::OEBind::SimpleBind`.  See
      :ref:`OESimpleBindResults <OEPB_OESimpleBindResults>` to see all the values available.

      Additionally, both the `SimpleBind` and :oe:meth:`OEPB::OEBind::Bind` methods
      calculate area contributions.
