.. oe:namespace:: OEChem



.. meta::
   :keywords: OEMCSMaxAtomsCompleteCycles, MCSMaxAtomsCompleteCycles


.. _OEChem_OEMCSMaxAtomsCompleteCycles:

.. oe:class:: OEMCSMaxAtomsCompleteCycles

   .. oe:api::


      class OEMCSMaxAtomsCompleteCycles : public OEMCSFunc

   This class represents `OEMCSMaxAtomsCompleteCycles`.

   The :ref:`OEMCSMaxAtomsCompleteCycles <OEChem_OEMCSMaxAtomsCompleteCycles>` class is an
   implementation of :ref:`OEMCSFunc <OEChem_OEMCSFunc>` designed to order
   maximum substructure matches by the maximum number of atoms
   included in the graph match, with a variable priority given to
   matches which contain complete cycles common to both pattern and
   target.

   .. 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:: Constructors

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

         .. oe:api::

            OEMCSMaxAtomsCompleteCycles(double a = 1.0)

      .. oe:language:: python

         .. oe:api:: python

            OEMCSMaxAtomsCompleteCycles(a: float = 1.0) -> OEMCSMaxAtomsCompleteCycles

      The constructor takes a 'penalty' argument, with a default value
      of ``1.0``.
      The penalty (or scaling) factor is used to subtract from the
      total score composed of matching atoms and bonds the number of
      pattern ring bonds that are not matches by a target bond 
      (see scoring function below).
      This has the affect of scoring matches more highly when pattern
      ring atoms are matched.

   .. 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\ atoms + \frac{num.\ of\ mapped\ bonds}{100} - penalty \times num.\ of\ unmapped\ cyclic\ query\ bonds`

      The default penalty for each unmapped cyclic query bond is ``1.0``.

   .. 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:`OEMCSMaxAtomsCompleteCycles <OEChem_OEMCSMaxAtomsCompleteCycles>`
      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.
