.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEPrepareMultiAlignedDepiction

.. _OEDepict_OEPrepareMultiAlignedDepiction:


.. oe:function:: OEPrepareMultiAlignedDepiction


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

      .. oe:api::

         bool OEPrepareMultiAlignedDepiction(OEChem::OEMolBase& fitmol,
                                             const OEChem::OEMolBase& refmol,
                                             OESystem::OEIter<OEChem::OEMatchBase>& miter)
         bool OEPrepareMultiAlignedDepiction(OEChem::OEMolBase& fitmol,
                                             const OEChem::OEMolBase& refmol,
                                             OESystem::OEIterBase<OEChem::OEMatchBase>* miter)

   .. oe:language:: python

      .. oe:api:: python

         OEPrepareMultiAlignedDepiction(fitmol: Union[OEGraphMol,OEMol,OEQMol],
                                        refmol: Union[OEGraphMol,OEMol,OEQMol],
                                        miter: OEMatchBaseIter) -> bool

   Generates the 2D coordinates of a molecule by maximizing its overlay
   with a reference 2D molecule based on multiple overlaps between the
   two molecules.

   *fitmol*
      The molecule being fitted to be aligned to the reference molecule.

   *refmol*
      The reference molecule of which 2D coordinates are remain unchanged.

   *miter*
      The iterator that stores the matches on which the molecule
      alignment is based on.

   .. _figure_OEPrepareMultiAlignedDepiction:

   .. figure:: ../images/OEPrepareMultiAlignedDepiction.*
      :align:  center

      **Example of the molecule alignment based on multiple fragments**

      (left) - depiction of a reference molecule
      (middle) - default depiction of a fit molecule
      (right) - depiction of the fit molecule aligned to the reference based on multiple fragments

   .. hint::

      The overlap between two molecules can be generated by the
      :oe:func:`OEGraphSim::OEGetFPOverlap` function of  **GraphSim TK**.
      The :oe:func:`OEGraphSim::OEGetFPOverlap` returns matched fragments
      of two molecules that are considered equivalent based on a specific
      fingerprint type.

      .. figure:: ../images/OEPrepareMultiAlignedDepictionVisualize.*
         :align:  center

      The Python script that visualizes molecule similarity based on fingerprints
      can be downloaded from the
      `OpenEye Python Cookbook <http://docs.eyesopen.com/python_modules/cookbook/depiction/simcalc.html>`_

   .. seealso::

      * :ref:`chapter_molalign` chapter
      * :ref:`chapter_overlap` chapter in **GraphSim TK**
      * :oe:func:`OEDepict::OEPrepareAlignedDepiction` function
      * :oe:src:`Listing 3<SNIPPET-FINGERPRINT-ALIGN-FPAlign>` example code in :ref:`chapter_molalign` chapter
