.. oe:namespace:: OEBio



.. meta::
   :keywords: OEMolComplexCategorizer, MolComplexCategorizer


.. _OEBio_OEMolComplexCategorizer:

.. oe:class:: OEMolComplexCategorizer

   .. oe:api::


      class OEMolComplexCategorizer : public OEMolComplexCategorizerBase

   Concrete class functor used by :oe:func:`OEBio::OESplitMolComplex` and
   :oe:func:`OEBio::OEGetMolComplexComponents` to assign
   functional roles to molecular fragments.
   The :ref:`OESplitMolComplexOptions <OEBio_OESplitMolComplexOptions>` class holds a
   `OEMolComplexCategorizer` object by default.

   The following methods are publicly inherited from :ref:`OEMolComplexCategorizerBase <OEBio_OEMolComplexCategorizerBase>`:

   =============================================================================================== ===============================================================================================
   :oe:meth:`operator()<OEBio::OEMolComplexCategorizerBase::operator()>`                           :oe:meth:`GetBundleCofactors<OEBio::OEMolComplexCategorizerBase::GetBundleCofactors>`
   :oe:meth:`CreateCopy<OEBio::OEMolComplexCategorizerBase::CreateCopy>`                           :oe:meth:`UsingExplicitLigandName<OEBio::OEMolComplexCategorizerBase::UsingExplicitLigandName>`
   :oe:meth:`GetResidueCategoryData<OEBio::OEMolComplexCategorizerBase::GetResidueCategoryData>`
   =============================================================================================== ===============================================================================================

   .. oe:method:: Constructors

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

         .. oe:api::

            OEMolComplexCategorizer(const OEMolComplexCategorizer& rhs)
            OEMolComplexCategorizer(const std::string& ligName = std::string())

      .. oe:language:: python

         .. oe:api:: python

            OEMolComplexCategorizer(ligName: str = str()) -> OEMolComplexCategorizer
            OEMolComplexCategorizer(rhs: OEMolComplexCategorizer) -> OEMolComplexCategorizer

      Constructor and copy constructor. If ``ligName`` is specified
      in the call to the constructor, the method
      :oe:meth:`UsingExplicitLigandName<OEBio::OEMolComplexCategorizer::UsingExplicitLigandName>`
      will return ``true`` and components will be recognized as ligands if and only if
      they have a matching residue name string.

      .. seealso::

         * :oe:meth:`OEBio::OEMolComplexCategorizer::AddLigandName`

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEMolComplexCategorizer &operator=(const OEMolComplexCategorizer &rhs)

      Assignment operator.

   .. oe:method:: operator()

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

         .. oe:api::

            std::string operator() (OESystem::OERoleSet& roles, OEMolComplexResCounts& counts, const OEChem::OEAtomBondSet& frag, bool isCovalent = false) const

      .. oe:language:: python

         .. oe:api:: python

            __call__(roles: OERoleSet, counts: OEMolComplexResCounts,
                     frag: OEAtomBondSet, isCovalent: bool = False) -> str

      Method to examine the :ref:`OEAtomBondSet <OEChem_OEAtomBondSet>` ``frag``
      and return three things
      required by :oe:func:`OEBio::OESplitMolComplex` and
      :oe:func:`OEBio::OEGetMolComplexComponents` to process the component:

      * a new title string
      * a :ref:`OERoleSet <OESystem_OERoleSet>` containing the functional roles
        associated with this fragment (see :oe:constns:`OEBio::OEMolComplexFilterCategory`)
      * an updated map of how many times a residue has been seen to date

      If ``isCovalent`` is true, additional tests may be performed to determine
      whether the fragment might be considered a (covalent) ligand which is indicated
      with the :oe:const:`OEBio::OEMolComplexFilterCategory::Ligand` :ref:`OERole <OESystem_OERole>`
      in ``roles``.

   .. oe:method:: AddLigandName

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

         .. oe:api::

            void AddLigandName(const std::string& ligName)

      .. oe:language:: python

         .. oe:api:: python

            AddLigandName(ligName: str) -> None

      Store an additional ligand name in the :ref:`OEResidueCategoryData <OEBio_OEResidueCategoryData>`
      associated with this object. Method
      :oe:meth:`UsingExplicitLigandName<OEBio::OEMolComplexCategorizer::UsingExplicitLigandName>`
      will return ``true`` and components will be recognized as ligands if and only if
      they have a residue name string matching one of the
      :oe:const:`OEBio::OEResidueDatabaseCategory::Ligand` entries.

      .. seealso::

         * :oe:meth:`OEBio::OEMolComplexCategorizer::Constructors`
         * :oe:meth:`OEBio::OEMolComplexCategorizer::SetResidueCategoryData`

   .. oe:method:: ClearLigandSubSearch

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

         .. oe:api::

            void ClearLigandSubSearch()

      .. oe:language:: python

         .. oe:api:: python

            ClearLigandSubSearch() -> None

      Clear any ligand subsearch pattern.

      .. seealso::

         * :oe:meth:`OEBio::OEMolComplexCategorizer::GetLigandSubSearch`
         * :oe:meth:`OEBio::OEMolComplexCategorizer::SetLigandSubSearch`

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEMolComplexCategorizerBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEMolComplexCategorizerBase

      CreateCopy method.

   .. oe:method:: GetBundleCofactors

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

         .. oe:api::

            bool GetBundleCofactors() const

      .. oe:language:: python

         .. oe:api:: python

            GetBundleCofactors() -> bool

      Returns ``true`` if cofactors (other than metals) are associated with
      the category :oe:const:`OEBio::OEMolComplexFilterCategory::ProtComplex`.

   .. oe:method:: GetLigandSubSearch

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

         .. oe:api::

            OEChem::OESubSearch GetLigandSubSearch() const

      .. oe:language:: python

         .. oe:api:: python

            GetLigandSubSearch() -> OESubSearch

      Return the subsearch pattern used to identify the ligand by graph.

      .. seealso::

         * :ref:`section_patternmatch_sss` section
         * :oe:meth:`OEBio::OEMolComplexCategorizer::SetLigandSubSearch`
         * :oe:meth:`OEBio::OEMolComplexCategorizer::ClearLigandSubSearch`

   .. oe:method:: GetMaxLigAtoms

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

         .. oe:api::

            unsigned GetMaxLigAtoms() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxLigAtoms() -> int

      Return the maximum number of non-hydrogen atoms in a ligand.

      .. seealso::

         * :oe:meth:`OEBio::OEMolComplexCategorizer::SetMaxLigAtoms`

   .. oe:method:: GetMaxLigResidues

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

         .. oe:api::

            unsigned GetMaxLigResidues() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxLigResidues() -> int

      .. seealso::

         * :oe:meth:`OEBio::OEMolComplexCategorizer::SetMaxLigResidues`

      Return the maximum number of residues in a ligand.

   .. oe:method:: GetMaxPeptideResidues

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

         .. oe:api::

            unsigned GetMaxPeptideResidues() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxPeptideResidues() -> int

      Return the maximum number of residues in a peptide.

   .. oe:method:: GetMaxProteinAtoms

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

         .. oe:api::

            unsigned GetMaxProteinAtoms() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxProteinAtoms() -> int

      Return the maximum number of non-hydrogen atoms in a protein.

   .. oe:method:: GetMinLigAtoms

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

         .. oe:api::

            unsigned GetMinLigAtoms() const

      .. oe:language:: python

         .. oe:api:: python

            GetMinLigAtoms() -> int

      Return the minimum number of non-hydrogen atoms in a ligand.

      .. seealso::

         * :oe:meth:`OEBio::OEMolComplexCategorizer::SetMinLigAtoms`

   .. oe:method:: GetResidueCategoryData

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

         .. oe:api::

            OEResidueCategoryData* GetResidueCategoryData() const

      .. oe:language:: python

         .. oe:api:: python

            GetResidueCategoryData() -> OEResidueCategoryData

      Return a new copy of the :ref:`OEResidueCategoryData <OEBio_OEResidueCategoryData>`
      object used to define all the molecular components that
      are *not* ligands.

      .. oe:language:: c++

         To avoid a memory leak in C++, the returned pointer should be
         stored in a variable of the
         :ref:`OEOwnedPtr <OESystem_OEOwnedPtr>` template class
         or deallocated with the ``delete`` operator.

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

         .. oe:api::

            OEResidueCategoryData& GetResidueCategoryData()

      .. oe:language:: python

         .. oe:api:: python

            GetResidueCategoryData() -> OEResidueCategoryData

      Returns a reference to the :ref:`OEResidueCategoryData <OEBio_OEResidueCategoryData>`
      object used to define all the molecular components that
      are *not* ligands.

   .. oe:method:: SetBundleCofactors

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

         .. oe:api::

            void SetBundleCofactors(bool bundle = true)

      .. oe:language:: python

         .. oe:api:: python

            SetBundleCofactors(bundle: bool = True) -> None

      Controls whether cofactors (other than metals) should be associated with
      the category :oe:const:`OEBio::OEMolComplexFilterCategory::ProtComplex`.

   .. oe:method:: SetLigandSubSearch

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

         .. oe:api::

            void SetLigandSubSearch(const char* smarts)
            void SetLigandSubSearch(const OEChem::OESubSearch& ss)

      .. oe:language:: python

         .. oe:api:: python

            SetLigandSubSearch(smarts: str) -> None
            SetLigandSubSearch(ss: OESubSearch) -> None

      Define a subsearch pattern used to identify the ligand by graph.

      .. seealso::

         * :ref:`section_patternmatch_sss` section
         * :oe:meth:`OEBio::OEMolComplexCategorizer::GetLigandSubSearch`
         * :oe:meth:`OEBio::OEMolComplexCategorizer::ClearLigandSubSearch`

   .. oe:method:: SetMaxLigAtoms

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

         .. oe:api::

            void SetMaxLigAtoms(unsigned n)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxLigAtoms(n: int) -> None

      Set the maximum number of non-hydrogen atoms in a ligand.
      Default = 70.

      .. note::

         When no ligand is found, other molecules such as peptides,
         nucleic acids, or sugars may be treated as ligands. If this
         occurs, this restriction will not apply.

   .. oe:method:: SetMaxLigResidues

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

         .. oe:api::

            void SetMaxLigResidues(unsigned n)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxLigResidues(n: int) -> None

      Set the maximum number of residues in a ligand.
      Default = 3.

      .. note::

         When no ligand is found, other molecules such as peptides,
         nucleic acids, or sugars may be treated as ligands. If this
         occurs, this restriction will not apply.

   .. oe:method:: SetMaxPeptideResidues

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

         .. oe:api::

            void SetMaxPeptideResidues(unsigned n)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxPeptideResidues(n: int) -> None

      Set the maximum number of residues to be considered a peptide.
      Default = 49.

   .. oe:method:: SetMaxProteinAtoms

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

         .. oe:api::

            void SetMaxProteinAtoms(unsigned n)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxProteinAtoms(n: int) -> None

      Set the maximum number of non-hydrogen atoms in a protein.
      Default = 0, meaning unlimited.

   .. oe:method:: SetMinLigAtoms

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

         .. oe:api::

            void SetMinLigAtoms(unsigned n)

      .. oe:language:: python

         .. oe:api:: python

            SetMinLigAtoms(n: int) -> None

      Set the minimum number of non-hydrogen atoms in a ligand.
      Default = 4.

      .. note::

         When no ligand is found, other molecules such as peptides,
         nucleic acids, or sugars may be treated as ligands. If this
         occurs, this restriction will not apply.

   .. oe:method:: SetResidueCategoryData

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

         .. oe:api::

            void SetResidueCategoryData(const OEResidueCategoryData& db)

      .. oe:language:: python

         .. oe:api:: python

            SetResidueCategoryData(db: OEResidueCategoryData) -> None

      Set the :ref:`OEResidueCategoryData <OEBio_OEResidueCategoryData>` object used to
      define all the molecular components that are *not* ligands.

   .. oe:method:: UsingExplicitLigandName

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

         .. oe:api::

            bool UsingExplicitLigandName() const

      .. oe:language:: python

         .. oe:api:: python

            UsingExplicitLigandName() -> bool

      Returns ``true`` if an explicit ligand residue name is being used
      to identify the ligand.
