.. oe:namespace:: OEMedChem

.. meta::
   :keywords: OEMCSTverskySim, MCSTverskySim


.. _OEMedChem_OEMCSTverskySim:

.. oe:class:: OEMCSTverskySim

   .. oe:api::

      class OEMCSTverskySim : public OEMedChem::OEMCSSimFuncBase

   This class represents :ref:`OEMCSTverskySim <OEMedChem_OEMCSTverskySim>` that
   calculates the :oe:const:`Tversky<OEGraphSim::OESimMeasure::Tversky>`
   similarity score.

   **Formula:**

     :math:`Sim_{Tversky}(A,B) = \frac{bothAB}{\alpha * onlyA + \beta * onlyB + bothAB}`

   The following methods are publicly inherited from :ref:`OEMCSSimFuncBase <OEMedChem_OEMCSSimFuncBase>`:

   ================================================================================ ================================================================================ ================================================================================
   :oe:meth:`operator()<OEMedChem::OEMCSSimFuncBase::operator()>`                   :oe:meth:`CreateCopy<OEMedChem::OEMCSSimFuncBase::CreateCopy>`                   :oe:meth:`GetMCSSimTypeString<OEMedChem::OEMCSSimFuncBase::GetMCSSimTypeString>`
   ================================================================================ ================================================================================ ================================================================================

   .. ################################################################
      #
      ################################################################

   .. oe:method:: Constructors

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

         .. oe:api::

            OEMCSTverskySim()
            OEMCSTverskySim(const OEMCSTverskySim& ref)

      .. oe:language:: python

         .. oe:api:: python

            OEMCSTverskySim(ref: OEMCSTverskySim) -> OEMCSTverskySim

      Default constructor (:math:`\alpha = 0.95`, :math:`\beta = 0.05`)

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

         .. oe:api::

            OEMCSTverskySim(double tvAlpha = 0.95, double tvBeta = 0.05)

      .. oe:language:: python

         .. oe:api:: python

            OEMCSTverskySim(tvAlpha: float = 0.95, tvBeta: float = 0.05) -> OEMCSTverskySim

      Constructor with arbitrary :math:`\alpha` and :math:`\beta` parameters.


   .. ################################################################
      #
      ################################################################

   .. oe:method:: operator()

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

         .. oe:api::

            double operator() (unsigned int commonAB, unsigned int totalA,  unsigned totalB) const

      .. oe:language:: python

         .. oe:api:: python

            __call__(commonAB: int, totalA: int, totalB: int) -> float

      Returns the :oe:const:`Tversky<OEGraphSim::OESimMeasure::Tversky>`
      similarity coefficient based on the fragment core counts for the
      fragment core, query molecule and indexed molecule.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEMedChem::OEMCSSimFuncBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEMCSTverskySim

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

   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetAlpha

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

         .. oe:api::

            double GetAlpha() const

      .. oe:language:: python

         .. oe:api:: python

            GetAlpha() -> float

      Returns the :math:`\alpha` parameter from the
      :ref:`OEMCSTverskySim <OEMedChem_OEMCSTverskySim>` class.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetBeta

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

         .. oe:api::

            double GetBeta() const

      .. oe:language:: python

         .. oe:api:: python

            GetBeta() -> float

      Returns the :math:`\beta` parameter from the
      :ref:`OEMCSTverskySim <OEMedChem_OEMCSTverskySim>` class.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetMCSSimTypeString

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

         .. oe:api::

            std::string GetMCSSimTypeString() const

      .. oe:language:: python

         .. oe:api:: python

            GetMCSSimTypeString() -> str

      Returns a string representation of the
      :ref:`OEMCSTverskySim <OEMedChem_OEMCSTverskySim>` class.

