.. oe:namespace:: OEChem



.. meta::
   :keywords: OEMCSMaxBonds, MCSMaxBonds


.. _OEChem_OEMCSMaxBonds:

.. oe:class:: OEMCSMaxBonds

   .. oe:api::


      class OEMCSMaxBonds : public OEMCSFunc

   This class represents `OEMCSMaxBonds`.

   The :ref:`OEMCSMaxBonds <OEChem_OEMCSMaxBonds>` class is an implementation of
   :ref:`OEMCSFunc <OEChem_OEMCSFunc>` designed to order maximum common
   substructure matches by the maximum number of bonds included in the
   graph match. If two common structure matches have the same number
   of bonds, ties are split based on the number of atoms contained in
   the match.

   .. seealso::

      * :ref:`section_patternmatch_mcss_score` section
      * :oe:meth:`OEChem::OEMCSSearch::SetMCSFunc` method
      * :oe:meth:`OEChem::OECliqueSearch::SetMCSFunc` method

   The following methods are publicly inherited from :ref:`OEMCSFunc <OEChem_OEMCSFunc>`:

   ==================================================== ==================================================== ===================================================
   :oe:meth:`operator()<OEChem::OEMCSFunc::operator()>` :oe:meth:`CreateCopy<OEChem::OEMCSFunc::CreateCopy>`                                                    
   ==================================================== ==================================================== ===================================================


   .. oe:method:: operator()

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

         .. oe:api::

            double operator()(const OEMolBase &, const OEMolBase &, OEAtomBase **, OEBondBase **)

      .. oe:language:: python

         .. oe:api:: python

            __call__(arg2: Union[OEGraphMol,OEMol,OEQMol],
                     arg3: Union[OEGraphMol,OEMol,OEQMol], arg4: OEAtomBase,
                     arg5: OEBondBase) -> float

      This method is called by its parent :ref:`OEMCSSearch <OEChem_OEMCSSearch>`
      or :ref:`OECliqueSearch <OEChem_OECliqueSearch>` object.
      The method is called with the pattern molecule, target molecule,
      and arrays and atoms and bonds containing the correspondences
      found for the a common structure match.
      The method computes a value based on the number of atoms and
      bonds in the common structure match which is used to determine
      the maximum common structure match.

      **Scoring function:**

      :math:`num.\ of\ mapped\ bonds + \frac{num.\ of\ mapped\ atoms}{100}`


   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEMCSFunc * CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEMCSFunc

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEMCSMaxBonds <OEChem_OEMCSMaxBonds>`
      object is dynamically allocated and owned by the caller.

      .. oe:language:: c++

         The returned copy should be deallocated using C++
         delete operator in order to prevent a memory leak.
