.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEMolPotential

.. meta::
   :keywords: OEInterMolFunc1, MolFunc1


.. _OEMolPotential_OEInterMolFunc1:

.. oe:class:: OEInterMolFunc1

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::

      class OEInterMolFunc1 : public OEMolFunc1

   The :ref:`OEInterMolFunc1 <OEMolPotential_OEInterMolFunc1>` is an abstract base class. It extends
   :ref:`OEMolFunc1 <OEMolPotential_OEMolFunc1>` to the cases where a small molecule interacts
   with a macromolecule that is rigid or partially flexible.

   The following methods are publicly inherited from :ref:`OEFunc0 <OEOpt_OEFunc0>`:
    * :oe:meth:`operator()<OEOpt::OEFunc0::operator()>`
    * :oe:meth:`GetFComponents<OEOpt::OEFunc0::GetFComponents>`
    * :oe:meth:`NumVar<OEOpt::OEFunc0::NumVar>`

   The following methods are publicly inherited from :ref:`OEFunc1 <OEOpt_OEFunc1>`:
    * :oe:meth:`operator()<OEOpt::OEFunc1::operator()>`

   The following methods are publicly inherited from :ref:`OEMolFunc <OEMolPotential_OEMolFunc>`:
    * :oe:meth:`Clear<OEMolPotential::OEMolFunc::Clear>`
    * :oe:meth:`ClearPredicates<OEMolPotential::OEMolFunc::ClearPredicates>`
    * :oe:meth:`GetInteractions<OEMolPotential::OEMolFunc::GetInteractions>`
    * :oe:meth:`Set<OEMolPotential::OEMolFunc::Set>`
    * :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>`

   The :ref:`OEInterMolFunc1 <OEMolPotential_OEInterMolFunc1>` class defines the following public methods:
      * :oe:meth:`AdaptHostCoords<OEMolPotential::OEInterMolFunc1::AdaptHostCoords>`
      * :oe:meth:`GetVar<OEMolPotential::OEInterMolFunc1::GetVar>`
      * :oe:meth:`SetHostFlex<OEMolPotential::OEInterMolFunc1::SetHostFlex>`
      * :oe:meth:`SetupHost<OEMolPotential::OEInterMolFunc1::SetupHost>`

   The following classes derive from this class:   
    * :ref:`OEInterMolFunc2 <OEMolPotential_OEInterMolFunc2>`

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

      .. oe:api::

         OEInterMolFunc1 & operator=(const OEInterMolFunc1 &)

      Assignment operator.


  .. oe:method:: AdaptHostCoords

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

         .. oe:api::

            bool AdaptHostCoords(double* coords, const double* var) const

      .. oe:language:: python

         .. oe:api:: python

            AdaptHostCoords(coords: OEDoubleArray, var: OEDoubleArray) -> bool

      Produces the complete host coordinates (``coords``) from a set of
      host coordinates representing the flexible part of the host (``var``).

  .. oe:method:: GetVar

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

         .. oe:api::

            void GetVar(double* var, const double* x)

      .. oe:language:: python

         .. oe:api:: python

            GetVar(var: OEDoubleArray, x: OEDoubleArray) -> None

      Takes the complete set coordinates of the host-ligand system (``x``) and
      transforms them to a subset of coordinates to be optimized (``var``).

   .. oe:method:: SetHostFlex

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

         .. oe:api::

            bool SetHostFlex(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred)

      .. oe:language:: python

         .. oe:api:: python

            SetHostFlex(pred: OEUnaryAtomPred) -> bool

      Sets predicate (:ref:`OEUnaryPredicate <OESystem_OEUnaryPredicate>`) that defines the flexible atoms
      of the host molecule (usually a macromolecule). Host atoms that pass
      the predicate (:ref:`OEUnaryPredicate <OESystem_OEUnaryPredicate>`) will be subject to optimization
      along with the ligand atoms for which a :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>`
      method is called.

   .. oe:method:: SetupHost

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

         .. oe:api::

            bool SetupHost(const OEChem::OEMolBase& host)

      .. oe:language:: python

         .. oe:api:: python

            SetupHost(host: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      Sets a macromolecule as host.
