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

.. oe:namespace:: OEBioisostere

.. meta::
   :keywords: OESimilarity, Similarity


.. _OEBioisostere_OESimilarity:

.. oe:class:: OESimilarity

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OESimilarity

   This class is a container for overlap-derived similarity components and
   derivative metrics. :ref:`OEBroodScore <OEBioisostere_OEBroodScore>` consists of
   multiple instances of :ref:`OESimilarity <OEBioisostere_OESimilarity>` of
   various types.

   The :ref:`OESimilarity <OEBioisostere_OESimilarity>` class defines the following public methods:
    * :oe:meth:`Add<OEBioisostere::OESimilarity::Add>`
    * :oe:meth:`GetFitScore<OEBioisostere::OESimilarity::GetFitScore>`
    * :oe:meth:`GetOverlap<OEBioisostere::OESimilarity::GetOverlap>`
    * :oe:meth:`GetRefScore<OEBioisostere::OESimilarity::GetRefScore>`
    * :oe:meth:`GetScaledScore<OEBioisostere::OESimilarity::GetScaledScore>`
    * :oe:meth:`GetTanimoto<OEBioisostere::OESimilarity::GetTanimoto>`
    * :oe:meth:`Load<OEBioisostere::OESimilarity::Load>`
    * :oe:meth:`ToRecord<OEBioisostere::OESimilarity::ToRecord>`



   .. _OEBioisostere_OESimilarity_Constructors:
   .. oe:method:: Constructors

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

         .. oe:api::

            OESimilarity(const double refScore = 0.0,
                         const double fitScore = 0.0,
                         const double ovScore = 0.0,
                         const unsigned type = OEBroodScoreType::ROCS)
            OESimilarity(const OESimilarity&)

      .. oe:language:: python

         .. oe:api:: python

            OESimilarity(refScore: float = 0.0, fitScore: float = 0.0,
                         ovScore: float = 0.0, type: int) -> OESimilarity
            OESimilarity(arg2: OESimilarity) -> OESimilarity

      Default and copy constructors.

      The ``type`` argument selects the scoring mode used when deriving the
      Tanimoto and scaled metrics. It accepts one of the following values from
      the :oe:constns:`OEBioisostere::OEBroodScoreType` namespace:

       * :oe:const:`OEBioisostere::OEBroodScoreType::ROCS` - shape and color based scoring.
       * :oe:const:`OEBioisostere::OEBroodScoreType::ET` - shape and electrostatics based scoring.

      The default value is :oe:const:`OEBioisostere::OEBroodScoreType::ROCS`.


   .. _OEBioisostere_OESimilarity_operator=:

   .. oe:method:: operator=

      .. oe:language:: c++

         .. oe:api::

            OESimilarity& operator=(const OESimilarity&)

      Assignment operator.


   .. _OEBioisostere_OESimilarity_Add:

   .. oe:method:: Add

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

         .. oe:api::

            bool Add(const OESimilarity&)

      .. oe:language:: python

         .. oe:api:: python

            Add(arg2: OESimilarity) -> bool

      This method adds the scores from another :ref:`OESimilarity <OEBioisostere_OESimilarity>` object
      to this object and recalculates the combined Tanimoto score.


   .. _OEBioisostere_OESimilarity_GetFitScore:

   .. oe:method:: GetFitScore

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

         .. oe:api::

            double GetFitScore() const

      .. oe:language:: python

         .. oe:api:: python

            GetFitScore() -> float

      This method returns the fit score component of the similarity calculation.


   .. _OEBioisostere_OESimilarity_GetOverlap:

   .. oe:method:: GetOverlap

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

         .. oe:api::

            double GetOverlap() const

      .. oe:language:: python

         .. oe:api:: python

            GetOverlap() -> float

      This method returns the overlap score component of the similarity calculation.


   .. _OEBioisostere_OESimilarity_GetRefScore:

   .. oe:method:: GetRefScore

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

         .. oe:api::

            double GetRefScore() const

      .. oe:language:: python

         .. oe:api:: python

            GetRefScore() -> float

      This method returns the reference score component of the similarity calculation.


   .. _OEBioisostere_OESimilarity_GetScaledScore:

   .. oe:method:: GetScaledScore

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

         .. oe:api::

            double GetScaledScore() const

      .. oe:language:: python

         .. oe:api:: python

            GetScaledScore() -> float

      This method returns the scaled score, calculated as the ratio of overlap to reference score.


   .. _OEBioisostere_OESimilarity_GetTanimoto:

   .. oe:method:: GetTanimoto

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

         .. oe:api::

            double GetTanimoto() const

      .. oe:language:: python

         .. oe:api:: python

            GetTanimoto() -> float

      This method returns the calculated Tanimoto coefficient based on the similarity scores.


   .. _OEBioisostere_OESimilarity_Load:

   .. oe:method:: Load

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

         .. oe:api::

            bool Load(const OEDataFlow::OERecord&)

      .. oe:language:: python

         .. oe:api:: python

            Load(arg2: OERecord) -> bool

      This method loads the similarity scores from an :ref:`OERecord <OEDataFlow_OERecord>`.


   .. _OEBioisostere_OESimilarity_ToRecord:

   .. oe:method:: ToRecord

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

         .. oe:api::

            bool ToRecord(OEDataFlow::OERecord&) const

      .. oe:language:: python

         .. oe:api:: python

            ToRecord(arg2: OERecord) -> bool

      This method stores the similarity scores onto an :ref:`OERecord <OEDataFlow_OERecord>`.

