.. oe:namespace:: OESz

.. meta::
   :keywords: OEFlexProteinLigandOptimizer, FlexProteinLigandOptimizer


.. _OESz_OEFlexProteinLigandOptimizer:

.. oe:class:: OEFlexProteinLigandOptimizer

   .. oe:api::

      class OEFlexProteinLigandOptimizer

   This class provides an interface to optimize a ligand in a protein active site, where the
   protein can be treated a partially flexible. The protein active site can be defined
   either by using a :ref:`OEDesignUnit <OEBio_OEDesignUnit>` or by simple passing in a protein
   molecule.

   The :ref:`OEFlexProteinLigandOptimizer <OESz_OEFlexProteinLigandOptimizer>` class defines the following public methods:
    * :oe:meth:`Energy<OESz::OEFlexProteinLigandOptimizer::Energy>`
    * :oe:meth:`Optimize<OESz::OEFlexProteinLigandOptimizer::Optimize>`

   .. oe:method:: Constructor

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

         .. oe:api::

            OEFlexProteinLigandOptimizer(const OEProteinLigandOptOptions& opts = OEProteinLigandOptOptions())
            OEFlexProteinLigandOptimizer(const OEFlexProteinLigandOptimizer &)

      .. oe:language:: python

         .. oe:api:: python

            OEFlexProteinLigandOptimizer(opts: OEProteinLigandOptOptions = OEProteinLigandOptOptions()) -> OEFlexProteinLigandOptimizer
            OEFlexProteinLigandOptimizer(arg2: OEFlexProteinLigandOptimizer) -> OEFlexProteinLigandOptimizer

      Default and copy constructors.

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

      .. oe:api::

         OEFlexProteinLigandOptimizer &operator=(const OEFlexProteinLigandOptimizer &)

.. _OESz_OEFlexProteinLigandOptimizer_Energy:

      Assignment operator.


   .. oe:method:: Energy

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

         .. oe:api::

            unsigned Energy(OEFF::OEComplexEnergies& res,
                            const OEBio::OEDesignUnit& du,
                            const unsigned proteinMask,
                            const unsigned ligandMask,
                            const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& protFlexPred,
                            const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& proteinPred = OEChem::OEIsTrueAtom()) const
            unsigned Energy(OEFF::OEComplexEnergies& res,
                            const OEBio::OEDesignUnit& du,
                            const unsigned proteinMask,
                            const unsigned ligandMask,
                            const OEProteinFlexOptions& flexOpts,
                            const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& proteinPred = OEChem::OEIsTrueAtom()) const
            unsigned Energy(OEFF::OEComplexEnergies& res,
                            const OEChem::OEMolBase& protein,
                            const OEChem::OEMolBase& ligand,
                            const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& protFlexPred) const
            unsigned Energy(OEFF::OEComplexEnergies& res,
                            const OEChem::OEMolBase& protein,
                            const OEChem::OEMolBase& ligand,
                            const OEProteinFlexOptions& flexOpts) const

      .. oe:language:: python

         .. oe:api:: python

            Energy(res: OEComplexEnergies, du: OEDesignUnit, proteinMask: int,
                   ligandMask: int, protFlexPred: OEUnaryAtomPred,
                   proteinPred: OEUnaryAtomPred = OEIsTrueAtom()) -> int
            Energy(res: OEComplexEnergies, du: OEDesignUnit, proteinMask: int,
                   ligandMask: int, flexOpts: OEProteinFlexOptions,
                   proteinPred: OEUnaryAtomPred = OEIsTrueAtom()) -> int
            Energy(res: OEComplexEnergies,
                   protein: Union[OEGraphMol,OEMol,OEQMol],
                   ligand: Union[OEGraphMol,OEMol,OEQMol],
                   protFlexPred: OEUnaryAtomPred) -> int
            Energy(res: OEComplexEnergies,
                   protein: Union[OEGraphMol,OEMol,OEQMol],
                   ligand: Union[OEGraphMol,OEMol,OEQMol],
                   flexOpts: OEProteinFlexOptions) -> int

      Calculate the single point energy of the protein ligand complex.  Only the flexible portion
      of the intra-molecular protein energy components are considered by this method.  In the first 
      four overloads, the ``proteinMask`` define the portion of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` 
      that should be used as the target protein active site. An optional ``proteinPred`` can be also 
      provided along with the mask, to define additional residue components to be part of the target.
      The methods return a value from the :oe:constns:`OESz::OESzybkiReturnCode` namespace reporting the 
      success or failure of the calculation.

.. _OESz_OEFlexProteinLigandOptimizer_Optimize:


   .. oe:method:: Optimize

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

         .. oe:api::

            unsigned Optimize(OESz::OEProteinLigandOptResults& res,
                              OEBio::OEDesignUnit& du,
                              const unsigned proteinMask,
                              const unsigned ligandMask,
                              const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& protFlexPred,
                              const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& proteinPred = OEChem::OEIsTrueAtom()) const
            unsigned Optimize(OESz::OEProteinLigandOptResults& res,
                              OEBio::OEDesignUnit& du,
                              const unsigned proteinMask,
                              const unsigned ligandMask,
                              const OEProteinFlexOptions& flexOpts,
                              const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& proteinPred = OEChem::OEIsTrueAtom()) const
            unsigned Optimize(OESz::OEProteinLigandOptResults& res,
                              OEChem::OEMolBase& protein,
                              OEChem::OEMolBase& ligand,
                              const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& protFlexPred) const
            unsigned Optimize(OESz::OEProteinLigandOptResults& res,
                              OEChem::OEMolBase& protein,
                              OEChem::OEMolBase& ligand,
                              const OEProteinFlexOptions& flexOpts) const

      .. oe:language:: python

         .. oe:api:: python

            Optimize(res: OEProteinLigandOptResults, du: OEDesignUnit,
                     proteinMask: int, ligandMask: int,
                     protFlexPred: OEUnaryAtomPred,
                     proteinPred: OEUnaryAtomPred = OEIsTrueAtom()) -> int
            Optimize(res: OEProteinLigandOptResults, du: OEDesignUnit,
                     proteinMask: int, ligandMask: int,
                     flexOpts: OEProteinFlexOptions,
                     proteinPred: OEUnaryAtomPred = OEIsTrueAtom()) -> int
            Optimize(res: OEProteinLigandOptResults,
                     protein: Union[OEGraphMol,OEMol,OEQMol],
                     ligand: Union[OEGraphMol,OEMol,OEQMol],
                     protFlexPred: OEUnaryAtomPred) -> int
            Optimize(res: OEProteinLigandOptResults,
                     protein: Union[OEGraphMol,OEMol,OEQMol],
                     ligand: Union[OEGraphMol,OEMol,OEQMol],
                     flexOpts: OEProteinFlexOptions) -> int

      Optimize the protein ligand complex.  Only the flexible portion
      of the intra-molecular protein energy components are considered by this method.  In the first 
      four overloads, the ``proteinMask`` define the portion of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` 
      that should be used as the target protein active site. An optional ``proteinPred`` can be also 
      provided along with the mask, to define additional residue components to be part of the target.
      The methods return a value from the :oe:constns:`OESz::OESzybkiReturnCode` namespace reporting 
      the success or failure of the calculation.
