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

.. oe:namespace:: OESpruce

..  _OESpruce_oemakedesignunitfrompocket:

.. oe:function:: OEMakeDesignUnitFromPocket

   .. attention::

      |TWOLANGUAGE|

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

      .. oe:api::

         bool OEMakeDesignUnitFromPocket(OEBio::OEDesignUnit& du,
                                         const OEBio::OEDesignUnit& designUnit,
                                         const OESpruce::OEPocket& pocket)

   .. oe:language:: python

      .. oe:api:: python

         OEMakeDesignUnitFromPocket(du: OEDesignUnit, designUnit: OEDesignUnit,
                                    pocket: OEPocket) -> bool

   Takes an existing :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object (`designunit`) and
   generates a new :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object (`du`), based on the input pocket.
   If the input designunit has a binding site defined, it will be reset in the output designunit (du)
   and switched to the site specified by the pocket.

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

      .. oe:api::

         bool OEMakeDesignUnitFromPocket(OEBio::OEDesignUnit& du,
                                         const OEChem::OEMolBase& mol,
                                         const OESpruce::OEPocket& pocket)

   .. oe:language:: python

      .. oe:api:: python

         OEMakeDesignUnitFromPocket(du: OEDesignUnit,
                                    mol: Union[OEGraphMol,OEMol,OEQMol],
                                    pocket: OEPocket) -> bool

   Takes an existing :ref:`OEMolBase <OEChem_OEMolBase>` object (`mol`) and
   generates a new :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object (`du`), based on the input pocket. The molecule
   is not split into components but is placed as the 'protein' component of the design unit.

.. note::

  This method is intended to be used for un-liganded pockets on a design unit.

.. seealso::

  * :ref:`OEPocket <OESpruce_OEPocket>` class
  * :oe:func:`OESpruce::OEFindPockets` function
  * :oe:func:`OESpruce::OEMakeDesignUnits` function
  * :oe:func:`OESpruce::OEMakeBioDesignUnits` function
  * :oe:func:`OESpruce::OEMakeDesignUnit` function
