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

.. oe:namespace:: OESpruce

..  _OESpruce_OEFindPockets:

.. oe:function:: OEFindPockets

   .. attention::

      |TWOLANGUAGE|

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

      .. oe:api::

         OESystem::OEIterBase<OESpruce::OEPocket>* OEFindPockets(OEBio::OEDesignUnit& designUnit,
                                                                 const unsigned componentMask = OEBio::OEDesignUnitComponents::MacroMolComponents,
                                                                 const OEPocketOptions& opts = OESpruce::OEPocketOptions(),
                                                                 const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& restrictPred = OESystem::OEIsTrue<OEChem::OEAtomBase>())
         OESystem::OEIterBase<OESpruce::OEPocket>* OEFindPockets(OEChem::OEMolBase& mol,
                                                                 const OEPocketOptions& opts = OESpruce::OEPocketOptions(),
                                                                 const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& restrictPred = OESystem::OEIsTrue<OEChem::OEAtomBase>())

   .. oe:language:: python

      .. oe:api:: python

         OEFindPockets(designUnit: OEDesignUnit, componentMask: int,
                       opts: OEPocketOptions = OEPocketOptions(),
                       restrictPred: OEUnaryAtomPred = OEIsTrueAtom()) -> Iterable[OEPocket]
         OEFindPockets(mol: Union[OEGraphMol,OEMol,OEQMol],
                       opts: OEPocketOptions = OEPocketOptions(),
                       restrictPred: OEUnaryAtomPred = OEIsTrueAtom()) -> Iterable[OEPocket]

   Return an iterator over all :ref:`OEPocket <OESpruce_OEPocket>` objects
   that can be found from the input :ref:`OEMolBase <OEChem_OEMolBase>` or :ref:`OEDesignUnit <OEBio_OEDesignUnit>` input structure. For design units, a mask can be supplied to determine,
   which of the internal components should be used for the pocket detection.
   The options input defines some parameters of the output pockets.
   If a specific pocket is required an atom based predicate can be supplied, the requirement is then that the one of the atom(s) in the predicate, is associated with
   the surface of the discovered pocket.

The input structure must have 3D coordinates assigned.

.. seealso::

  * :ref:`OEPocketOptions <OESpruce_OEPocketOptions>` class
  * :ref:`OEPocket <OESpruce_OEPocket>` class
  * :ref:`OEMakeDesignUnitFromPocket <OESpruce_OEMakeDesignUnitFromPocket>` function
