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

.. oe:namespace:: OEBioisostere

.. meta::
   :keywords: OEBroodClusterBuilder, BroodClusterBuilder


.. _OEBioisostere_OEBroodClusterBuilder:

.. oe:class:: OEBroodClusterBuilder

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OEBroodClusterBuilder

   This class builds and organizes bioisosteric hits into clusters based on
   structural similarity and optionally ranks them by calculated interest scores.
   See the :ref:`cluster <section_examples_cluster>` example.

   The :ref:`OEBroodClusterBuilder <OEBioisostere_OEBroodClusterBuilder>` class defines the following public methods:
    * :oe:meth:`Add<OEBioisostere::OEBroodClusterBuilder::Add>`
    * :oe:meth:`GetClusters<OEBioisostere::OEBroodClusterBuilder::GetClusters>`
    * :oe:meth:`Rank<OEBioisostere::OEBroodClusterBuilder::Rank>`



   .. _OEBioisostere_OEBroodClusterBuilder_Constructors:
   .. oe:method:: Constructors

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

         .. oe:api::

            OEBroodClusterBuilder(const OEChem::OEMolBase& molQuery,
                                  const bool fragment = false)
            OEBroodClusterBuilder(const OEBroodQuery& query)

      .. oe:language:: python

         .. oe:api:: python

            OEBroodClusterBuilder(query: OEBroodQuery) -> OEBroodClusterBuilder
            OEBroodClusterBuilder(molQuery: Union[OEGraphMol,OEMol,OEQMol],
                                  fragment: bool = False) -> OEBroodClusterBuilder

      This method constructs an :ref:`OEBroodClusterBuilder <OEBioisostere_OEBroodClusterBuilder>`
      from either a query molecule or an :ref:`OEBroodQuery <OEBioisostere_OEBroodQuery>`.
      The ``fragment`` flag controls clustering mode: fragment-centric
      (``true``) or full-molecule-centric (``false``).


   .. _OEBioisostere_OEBroodClusterBuilder_Add:

   .. oe:method:: Add

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

         .. oe:api::

            bool Add(const std::vector<OEBroodHit>& vecHits)

      .. oe:language:: python

         .. oe:api:: python

            Add(vecHits: OEBroodHitVector) -> bool

      This method adds one or more hits to the cluster builder. The builder groups similar hits
      into clusters as they are added.


   .. _OEBioisostere_OEBroodClusterBuilder_GetClusters:

   .. oe:method:: GetClusters

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

         .. oe:api::

            const std::vector<OEBroodCluster>& GetClusters() const

      .. oe:language:: python

         .. oe:api:: python

            GetClusters() -> OEBroodClusterVector

      This method returns a reference to the vector of clusters created by the builder.


   .. _OEBioisostere_OEBroodClusterBuilder_Rank:

   .. oe:method:: Rank

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

         .. oe:api::

            bool Rank()

      .. oe:language:: python

         .. oe:api:: python

            Rank() -> bool

      This method computes cluster priority scores and assigns final cluster ranks.
      Call this method before consuming ranked output from
      :oe:meth:`GetClusters<OEBioisostere::OEBroodClusterBuilder::GetClusters>`.

