.. oe:namespace:: OESiteHopper


.. oe:function:: OEMakePatchFromDesignUnit

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

       .. oe:api::

          bool OEMakePatchFromDesignUnit(OEChem::OEMolBase& patch,
                                         const OEBio::OEDesignUnit& du,
                                         const OESiteHopperPatchOptions& opts = OESiteHopperPatchOptions())
          bool OEMakePatchFromDesignUnit(OEChem::OEMolBase& patch,
                                         OESpicoli::OESurface& outSurface,
                                         const OEBio::OEDesignUnit& du,
                                         const OESiteHopperPatchOptions& opts = OESiteHopperPatchOptions())

    .. oe:language:: python

       .. oe:api:: python

          OEMakePatchFromDesignUnit(patch: Union[OEGraphMol,OEMol,OEQMol],
                                    du: OEDesignUnit,
                                    opts: OESiteHopperPatchOptions = OESiteHopperPatchOptions()) -> bool
          OEMakePatchFromDesignUnit(patch: Union[OEGraphMol,OEMol,OEQMol],
                                    outSurface: OESurface, du: OEDesignUnit,
                                    opts: OESiteHopperPatchOptions = OESiteHopperPatchOptions()) -> bool

    Create a new SiteHopper patch from *du*. The design unit must have valid
    3D atomic coordinates and atom types assigned (as produced by Spruce TK
    protein preparation). This function is not normally called directly — it is
    invoked internally during database creation and at search time.

    Two overloads are available:

    * The first overload writes only the patch into *patch*.
    * The second overload additionally writes the patch surface (the
      Connolly-style molecular surface used for shape comparison) into
      *outSurface*, which is useful for visualization.

    *patch*

       Output molecule that receives the SiteHopper patch representation.

    *outSurface*

       Output surface that receives the patch surface geometry (second
       overload only).

    *du*

       The design unit from which the patch is generated.

    *opts*

       Patch generation options. Defaults to
       :oe:cls:`OESiteHopper::OESiteHopperPatchOptions`.

    Returns true on success.

