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

.. oe:namespace:: OEShape

.. meta::
   :keywords: OEFlexiOverlay, FlexiOverlay


.. _OEShape_OEFlexiOverlay:

.. oe:class:: OEFlexiOverlay

   .. oe:api::

      class OEFlexiOverlay
   
   The :ref:`OEFlexiOverlay <OEShape_OEFlexiOverlay>` class provides an interface for flexible overlay optimization
   between the reference molecule and a fit molecule conformers.

   The :ref:`OEFlexiOverlay <OEShape_OEFlexiOverlay>` class defines the following public methods:
    * :oe:meth:`SetupRef<OEShape::OEFlexiOverlay::SetupRef>`
    * :oe:meth:`Overlay<OEShape::OEFlexiOverlay::Overlay>`
    * :oe:meth:`SortedOverlay<OEShape::OEFlexiOverlay::SortedOverlay>`
    * :oe:meth:`BestOverlay<OEShape::OEFlexiOverlay::BestOverlay>`

   .. oe:method:: Constructor

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

         .. oe:api::

            OEFlexiOverlay(const OEFlexiOverlayOptions& options = OEFlexiOverlayOptions())
            OEFlexiOverlay(const OEFlexiOverlay& func)

      .. oe:language:: python

         .. oe:api:: python

            OEFlexiOverlay(options: OEFlexiOverlayOptions = OEFlexiOverlayOptions()) -> OEFlexiOverlay
            OEFlexiOverlay(func: OEFlexiOverlay) -> OEFlexiOverlay

      Default and copy constructors.

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

      .. oe:api::

         OEFlexiOverlay &operator=(const OEFlexiOverlay&)

.. _OEShape_OEFlexiOverlay_SetupRef:

      Assignment operator.


   .. oe:method:: SetupRef

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

         .. oe:api::

            bool SetupRef(const OEChem::OEMolBase&)
            bool SetupRef(const OEShape::OEShapeQueryBase&)

      .. oe:language:: python

         .. oe:api:: python

            SetupRef(refmol: Union[OEGraphMol,OEMol,OEQMol]) -> bool
            SetupRef(refSQ: OEShapeQueryBase) -> bool

      This method defines the interface for setting up the reference system for the 
      :ref:`OEFlexiOverlay <OEShape_OEFlexiOverlay>` using a molecule or a shape query 
      for flexible overlay optimization process. 

.. _OEShape_OEFlexiOverlay_Overlay:

   .. oe:method:: Overlay

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

         .. oe:api::

            OESystem::OEIterBase<OEFlexiOverlapResults>* Overlay(OEChem::OEMCMolBase&)

      .. oe:language:: python

         .. oe:api:: python

            Overlay(fitmol: OEMol) -> Iterable[OEFlexiOverlapResults]

      This method optimizes the shape and chemical similarity between the fit molecule conformers
      and a reference molecule, along with intra-molecular forcefield energies 
      of the fit molecule. The reference molecule must be set using 
      :oe:meth:`SetupRef<OEShape::OEFlexiOverlay::SetupRef>` method.

.. _OEShape_OEFlexiOverlay_SortedOverlay:

   .. oe:method:: SortedOverlay

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

         .. oe:api::

            OESystem::OEIterBase<OEFlexiOverlapResults>* SortedOverlay(OEChem::OEMCMolBase&)

      .. oe:language:: python

         .. oe:api:: python

            SortedOverlay(fitmol: OEMol) -> Iterable[OEFlexiOverlapResults]

      This method optimizes the shape and chemical similarity between the fit molecule conformers
      and a reference molecule, along with intra-molecular forcefield energies 
      of the fit molecule. The reference molecule must be set using 
      :oe:meth:`SetupRef<OEShape::OEFlexiOverlay::SetupRef>` method. This method returns an 
      iterator over :ref:`OEFlexiOverlapResults <OEShape_OEFlexiOverlapResults>` which are sorted based on the
      TanimotoCombo similarity of that conformer and the reference molecule. 

.. _OEShape_OEFlexiOverlay_BestOverlay:

   .. oe:method:: BestOverlay

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

         .. oe:api::

            bool BestOverlay(OEFlexiOverlapResults&, OEChem::OEMCMolBase&)

      .. oe:language:: python

         .. oe:api:: python

            BestOverlay(result: OEFlexiOverlapResults, fitMol: OEMol) -> bool

      This method optimizes the shape and chemical similarity between the fit molecule conformers
      and a reference molecule, along with intra-molecular forcefield energies 
      of the fit molecule. This method returns the best result only 
      which is the conformer with the highest TanimotoCombo similarity to the reference molecule.
      The reference molecule must be set using 
      :oe:meth:`SetupRef<OEShape::OEFlexiOverlay::SetupRef>` method.
