.. # split by hand

.. include:: ../substitutions

.. oe:namespace:: OEBio

.. meta::
   :keywords: OEFilterMolComplexFragments

.. oe:function:: OEFilterMolComplexFragments

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

      .. oe:api::

         OESystem::OEIterBase<OEChem::OEMolBase>* OEFilterMolComplexFragments(const std::vector<OEChem::OEAtomBondSet>& frags,
                                                                              const OESplitMolComplexOptions& opt = OESplitMolComplexOptions())
         OESystem::OEIterBase<OEChem::OEMolBase>* OEFilterMolComplexFragments(const std::vector<OEChem::OEAtomBondSet>& frags,
                                                                              const OESplitMolComplexOptions& opt,
                                                                              const OESystem::OEUnaryPredicate<OESystem::OERoleSet>& filter)

   .. oe:language:: python

      .. oe:api:: python

         OEFilterMolComplexFragments(frags: OEAtomBondSetVector,
                                     opt: OESplitMolComplexOptions = OESplitMolComplexOptions()) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]
         OEFilterMolComplexFragments(frags: OEAtomBondSetVector,
                                     opt: OESplitMolComplexOptions,
                                     filter: OEUnaryRoleSetPred) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]


   Returns an iterator of connected components within
   the input :ref:`OEAtomBondSet <OEChem_OEAtomBondSet>` vector ``frags``.
   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>`
   method 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.


   .. seealso::

      * :ref:`section_split_mol_complex` section
      * :oe:func:`OEBio::OEGetMolComplexFragments` function
      * :ref:`OEAtomBondSet <OEChem_OEAtomBondSet>` class
      * :ref:`OEIter <OESystem_OEIter>` class
      * :ref:`OESplitMolComplexOptions <OEBio_OESplitMolComplexOptions>` class
      * :ref:`OEMolComplexFilter <OEBio_OEMolComplexFilter>` class
      * :oe:meth:`OEBio::OESplitMolComplexOptions::GetCombinedFilter` method
      * :oe:meth:`OEBio::OESplitMolComplexOptions::GetLigandFilter` method
      * :oe:meth:`OEBio::OESplitMolComplexOptions::GetProteinFilter` method
      * :oe:meth:`OEBio::OESplitMolComplexOptions::GetWaterFilter` method
      * :oe:meth:`OEBio::OESplitMolComplexOptions::GetOtherFilter` method
      * :oe:func:`OEBio::OESplitMolComplex` function
      * :oe:func:`OEBio::OEGetMolComplexComponents` function
      * :oe:func:`OEBio::OECombineMolComplexFragments` function
