.. # split from OEBioFunctions.rst:164

.. include:: ../substitutions

.. oe:namespace:: OEBio

.. meta::
   :keywords: OEGetMolComplexComponents

.. oe:function:: OEGetMolComplexComponents

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

      .. oe:api::

         OESystem::OEIterBase<OEChem::OEMolBase>* OEGetMolComplexComponents(const OEChem::OEMolBase& mol,
                                                                            const OESplitMolComplexOptions& opt = OESplitMolComplexOptions())
         OESystem::OEIterBase<OEChem::OEMolBase>* OEGetMolComplexComponents(const OEChem::OEMolBase& mol,
                                                                            const OESplitMolComplexOptions& opt,
                                                                            const OESystem::OEUnaryPredicate<OESystem::OERoleSet>& filter)

   .. oe:language:: python

      .. oe:api:: python

         OEGetMolComplexComponents(mol: Union[OEGraphMol,OEMol,OEQMol],
                                   opt: OESplitMolComplexOptions = OESplitMolComplexOptions()) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]
         OEGetMolComplexComponents(mol: Union[OEGraphMol,OEMol,OEQMol],
                                   opt: OESplitMolComplexOptions,
                                   filter: OEUnaryRoleSetPred) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]


   Returns an iterator of connected components within
   the specified :ref:`OEMolBase <OEChem_OEMolBase>`.
   The optional :ref:`OESplitMolComplexOptions <OEBio_OESplitMolComplexOptions>` object
   controls this process. If an explicit ``filter`` is not provided,
   the filter returned by the :ref:`OESplitMolComplexOptions <OEBio_OESplitMolComplexOptions>` method
   :oe:meth:`GetCombinedFilter<OEBio::OESplitMolComplexOptions::GetCombinedFilter>`
   will be used.

   Any molecules returned in the iterator have been given titles.
   Protein chains are given a shortened version of the input title
   combined with the chain ID. Small molecule titles are
   residue names. Molecules with more than one residue are combined
   with a ``-``. A two residue molecule might have the title ``XYZ-ABC``.
   Output molecules also have one or more *SD Tags* to describe the functional roles.

   .. warning::

      The input molecule should contain *PDB*
      :ref:`residue information<section_biopolymer_residues>`
      such as residue name, which is used during the
      classification process, either from a PDB format file or
      through :oe:func:`residue perception<OEChem::OEPerceiveResidues>`.
      Molecular complexes read from files in formats that lack this
      information (for example *SDF*) may be split inappropriately unless
      residues are perceived after input.

   .. seealso::

      * :ref:`section_split_mol_complex` section
      * :ref:`OEIter <OESystem_OEIter>` class
      * :ref:`OESplitMolComplexOptions <OEBio_OESplitMolComplexOptions>` class
      * :ref:`OEMolComplexFilter <OEBio_OEMolComplexFilter>` class
      * :oe:func:`OEBio::OESplitMolComplex` function
