.. _chapter_dockingexamples:
.. _oedocking_part_examples:

********************************************************************************
OEDocking Examples
********************************************************************************

The following table lists the currently available **OEDocking TK** examples:

.. oe:language:: c++

   .. list-table::
      :widths: 100 100
      :header-rows: 1

      * - Program
        - Description

      * - :ref:`docking<section_examples_docking>`
        - docking molecules

      * - :ref:`rescoring<section_examples_scoring>`
        - rescore docked molecules

      * - :ref:`shapefit<section_examples_shapefit>`
        - flexible fitting with OEShapeFit

      * - :ref:`posing<section_examples_posing>`
        - generating poses

      * - :ref:`posing_multi<section_examples_posing_multi>`
        - posing with multiple receptors

      * - :ref:`make_receptor<section_examples_make_receptor>`
        - making a receptor

      * - :ref:`contour_volume<section_examples_contour_volume>`
        - receptor contour volume

      * - :ref:`inner_contour<section_examples_inner_contour>`
        - toggle inner contour

      * - :ref:`outer_contour<section_examples_outer_contour>`
        - set outer contour

.. oe:language:: python

   .. list-table::
      :widths: 100 100
      :header-rows: 1

      * - Program
        - Description

      * - :ref:`docking<section_examples_docking>`
        - Docking molecules.

      * - :ref:`rescoring<section_examples_scoring>`
        - Rescore docked molecules.

      * - :ref:`shapefit<section_examples_shapefit>`
        - Flexible fitting with OEShapeFit.

      * - :ref:`posing<section_examples_posing>`
        - Generating poses.

      * - :ref:`posing_multi<section_examples_posing_multi>`
        - Posing with multiple receptors.

      * - :ref:`make_receptor<section_examples_make_receptor>`
        - Making a receptor.

      * - :ref:`contour_volume<section_examples_contour_volume>`
        - Receptor contour volume.

      * - :ref:`inner_contour<section_examples_inner_contour>`
        - Toggle inner contour.

      * - :ref:`outer_contour<section_examples_outer_contour>`
        - Set outer contour.

.. oe:language:: java

   .. list-table::
      :widths: 100 100
      :header-rows: 1

      * - Program
        - Description

      * - :ref:`docking<section_examples_docking>`
        - docking molecules

      * - :ref:`rescoring<section_examples_scoring>`
        - rescore docked molecules

      * - :ref:`posing<section_examples_posing>`
        - generating poses

      * - :ref:`posing_multi<section_examples_posing_multi>`
        - posing with multiple receptors

      * - :ref:`make_receptor<section_examples_make_receptor>`
        - making a receptor

      * - :ref:`contour_volume<section_examples_contour_volume>`
        - receptor contour volume

      * - :ref:`inner_contour<section_examples_inner_contour>`
        - toggle inner contour

      * - :ref:`outer_contour<section_examples_outer_contour>`
        - set outer contour

.. oe:language:: csharp

   .. list-table::
      :widths: 100 100
      :header-rows: 1

      * - Program
        - Description

      * - :ref:`docking<section_examples_docking>`
        - docking molecules

      * - :ref:`rescoring<section_examples_scoring>`
        - rescore docked molecules

      * - :ref:`posing<section_examples_posing>`
        - generating poses

      * - :ref:`posing_multi<section_examples_posing_multi>`
        - posing with multiple receptors

      * - :ref:`make_receptor<section_examples_make_receptor>`
        - making a receptor

      * - :ref:`contour_volume<section_examples_contour_volume>`
        - receptor contour volume

      * - :ref:`inner_contour<section_examples_inner_contour>`
        - toggle inner contour

      * - :ref:`outer_contour<section_examples_outer_contour>`
        - set outer contour


Docking and Scoring Examples
================================================================================

.. _section_examples_docking:

Docking Molecules
--------------------------------------------------------------------------------

The following code example shows how to perform docking using
the :ref:`OEDock <OEDocking_OEDock>` object.

.. seealso::

   * :ref:`OEDockOptions <OEDocking_OEDockOptions>` class
   * :ref:`OEDock <OEDocking_OEDock>` class
   * :ref:`OEHybrid <OEDocking_OEHybrid>` class


.. oe:source:: DockMolecules.cpp
   :language: c++
   :caption:  Docking Molecules
   :refnum:   1

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`DockMolecules.cpp <../../../../sublibs/tklibs/docking/examples/DockMolecules.cpp>`

.. oe:source:: DockMolecules.py
   :language: python
   :caption:  Docking Molecules
   :refnum:   1

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`DockMolecules.py <../../../../wrappers/python/examples/docking/DockMolecules.py>`

.. oe:source:: DockMolecules.java
   :language: java
   :caption:  Docking Molecules
   :refnum:   1

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`DockMolecules.java <../../../../wrappers/java/examples/openeye/examples/oedocking/DockMolecules.java>`


.. oe:source:: DockMolecules.cs
   :language: csharp
   :caption:  Docking Molecules
   :refnum:   1

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`DockMolecules.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/DockMolecules.cs>`


.. _section_examples_scoring:

Rescoring Docked Molecules
--------------------------------------------------------------------------------

The following code example shows how to rescore previously docked molecules,
using the :ref:`OEScore <OEDocking_OEScore>` object.

.. seealso::

   * :ref:`OEScore <OEDocking_OEScore>` class

.. oe:source:: RescorePoses.cpp
   :language: c++
   :caption:  Rescoring Docked Molecules
   :refnum:   2

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`RescorePoses.cpp <../../../../sublibs/tklibs/docking/examples/RescorePoses.cpp>`

.. oe:source:: RescorePoses.py
   :language: python
   :caption:  Rescoring Docked Molecules
   :refnum:   2

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`RescorePoses.py <../../../../wrappers/python/examples/docking/RescorePoses.py>`

.. oe:source:: RescorePoses.java
   :language: java
   :caption:  Rescoring Docked Molecules
   :refnum:   2


.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`RescorePoses.java <../../../../wrappers/java/examples/openeye/examples/oedocking/RescorePoses.java>`


.. oe:source:: RescorePoses.cs
   :language: csharp
   :caption:  Rescoring Docked Molecules
   :refnum:   2


.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`RescorePoses.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/RescorePoses.cs>`



OEShapeFit Examples
================================================================================

.. _section_examples_shapefit:

Flexible Overlay Optimization with OEShapeFit API
--------------------------------------------------------------------------------

The following code example shows how to flexibly fit input multi conformer 
molecules in the design unit that contains bound ligand and get the score using
the :oe:cls:`OEDocking::OEShapeFit` and :oe:cls:`OEDocking::OEShapeFitResults` 
objects.

.. seealso::

   * :oe:cls:`OEShape::OEFlexiOverlapFunc` class
   * :oe:cls:`OEShape::OEFlexiOverlayOptions` class

.. oe:source:: ShapeFit.cpp
   :language: c++
   :caption:  Flexible fitting with OEShapeFit
   :refnum:   3

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ShapeFit.cpp <../../../../sublibs/tklibs/docking/examples/ShapeFit.cpp>`


.. oe:source:: ShapeFit.py
   :language: python
   :caption:  Flexible fitting with OEShapeFit
   :refnum:   3


.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ShapeFit.py <../../../../wrappers/python/examples/docking/ShapeFit.py>`



**POSIT** Examples
================================================================================

.. _section_examples_posing:

Generating Poses with **POSIT**
--------------------------------------------------------------------------------

The following code example shows how to generate a single pose for each input ligand using
the :ref:`OEPosit <OEDocking_OEPosit>` object.

.. seealso::

   * :ref:`OEPositOptions <OEDocking_OEPositOptions>` class
   * :ref:`OEPosit <OEDocking_OEPosit>` class

.. oe:source:: PoseMolecules.cpp
   :language: c++
   :caption:  Generating Poses with POSIT
   :refnum:   4

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`PoseMolecules.cpp <../../../../sublibs/tklibs/docking/examples/PoseMolecules.cpp>`

.. oe:source:: PoseMolecules.py
   :language: python
   :caption:  Generating Poses with POSIT
   :refnum:   4


.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`PoseMolecules.py <../../../../wrappers/python/examples/docking/PoseMolecules.py>`

.. oe:source:: PoseMolecules.java
   :language: java
   :caption:  Generating Poses with POSIT
   :refnum:   4


.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`PoseMolecules.java <../../../../wrappers/java/examples/openeye/examples/oedocking/PoseMolecules.java>`


.. oe:source:: PoseMolecules.cs
   :language: csharp
   :caption:  Generating Poses with POSIT
   :refnum:   4


.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`PoseMolecules.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/PoseMolecules.cs>`


.. _section_examples_posing_multi:

Generating Multiple Poses with POSIT
--------------------------------------------------------------------------------

The following code example shows how to generate multiple poses for each input 
ligand, using the :ref:`OEPosit <OEDocking_OEPosit>` object.

.. seealso::

   * :ref:`OEPositOptions <OEDocking_OEPositOptions>` class
   * :ref:`OEPosit <OEDocking_OEPosit>` class


.. oe:source:: GenerateMultiplePose.cpp
   :language: c++
   :caption:  Posit for Generating Multiple Poses for each Ligand
   :refnum:   5

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`GenerateMultiplePose.cpp <../../../../sublibs/tklibs/docking/examples/GenerateMultiplePose.cpp>`


.. oe:source:: GenerateMultiplePose.py
   :language: python
   :caption:  Posit for Generating Multiple Poses for each Ligand
   :refnum:   5

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`GenerateMultiplePose.py <../../../../wrappers/python/examples/docking/GenerateMultiplePose.py>`

.. oe:source:: GenerateMultiplePose.java
   :language: java
   :caption:  Posit for Generating Multiple Poses for each Ligand
   :refnum:   5

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`GenerateMultiplePose.java <../../../../wrappers/java/examples/openeye/examples/oedocking/GenerateMultiplePose.java>`


.. oe:source:: GenerateMultiplePose.cs
   :language: csharp
   :caption:  Posit for Generating Multiple Poses for each Ligand
   :refnum:   5

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`GenerateMultiplePose.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/GenerateMultiplePose.cs>`


Receptor Examples
================================================================================

.. _section_examples_make_receptor:

Making a Receptor
--------------------------------------------------------------------------------

The following code example shows how to make a receptor.

.. seealso::

   * :ref:`OEMakeReceptorOptions <OEDocking_OEMakeReceptorOptions>` class
   * :oe:func:`OEDocking::OEMakeReceptor` method

.. oe:source:: MakeReceptor.cpp
   :language: c++
   :caption:  Making a Receptor
   :refnum:   6

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MakeReceptor.cpp <../../../../sublibs/tklibs/docking/examples/MakeReceptor.cpp>`


.. oe:source:: MakeReceptor.py
   :language: python
   :caption:  Making a Receptor
   :refnum:   6

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MakeReceptor.py <../../../../wrappers/python/examples/docking/MakeReceptor.py>`

.. oe:source:: MakeReceptor.java
   :language: java
   :caption:  Making a Receptor
   :refnum:   6

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MakeReceptor.java <../../../../wrappers/java/examples/openeye/examples/oedocking/MakeReceptor.java>`


.. oe:source:: MakeReceptor.cs
   :language: csharp
   :caption:  Making a Receptor
   :refnum:   6

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MakeReceptor.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/MakeReceptor.cs>`


.. _section_examples_contour_volume:

Receptor Contour Volume
--------------------------------------------------------------------------------

The following code example shows how to estimate a receptor
outer contour volume.

.. seealso::

   * :ref:`OEReceptor <OEBio_OEReceptor>` class
   * :ref:`OEDesignUnit <OEBio_OEDesignUnit>` class

.. oe:source:: ReceptorOuterContourVolume.cpp
   :language: c++
   :caption:  Receptor Contour Volume
   :refnum:   7

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ReceptorOuterContourVolume.cpp <../../../../sublibs/tklibs/docking/examples/ReceptorOuterContourVolume.cpp>`


.. oe:source:: ReceptorOuterContourVolume.py
   :language: python
   :caption:  Receptor Contour Volume
   :refnum:   7

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ReceptorOuterContourVolume.py <../../../../wrappers/python/examples/docking/ReceptorOuterContourVolume.py>`

.. oe:source:: ReceptorOuterContourVolume.java
   :language: java
   :caption:  Receptor Contour Volume
   :refnum:   7

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ReceptorOuterContourVolume.java <../../../../wrappers/java/examples/openeye/examples/oedocking/ReceptorOuterContourVolume.java>`


.. oe:source:: ReceptorOuterContourVolume.cs
   :language: csharp
   :caption:  Receptor Contour Volume
   :refnum:   7

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ReceptorOuterContourVolume.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/ReceptorOuterContourVolume.cs>`


.. _section_examples_inner_contour:

Toggle Receptor Inner Contour
--------------------------------------------------------------------------------

The following code example shows how to toggle receptor contour volume.

.. seealso::

   * * :ref:`OEReceptor <OEBio_OEReceptor>` class
   * :ref:`OEDesignUnit <OEBio_OEDesignUnit>` class

.. oe:source:: ToggleInnerContour.cpp
   :language: c++
   :caption:  Toggle Receptor Inner Contour
   :refnum:   8

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ToggleInnerContour.cpp <../../../../sublibs/tklibs/docking/examples/ToggleInnerContour.cpp>`


.. oe:source:: ToggleInnerContour.py
   :language: python
   :caption:  Toggle Receptor Inner Contour
   :refnum:   8

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ToggleInnerContour.py <../../../../wrappers/python/examples/docking/ToggleInnerContour.py>`

.. oe:source:: ToggleInnerContour.java
   :language: java
   :caption:  Toggle Receptor Inner Contour
   :refnum:   8

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ToggleInnerContour.java <../../../../wrappers/java/examples/openeye/examples/oedocking/ToggleInnerContour.java>`


.. oe:source:: ToggleInnerContour.cs
   :language: csharp
   :caption:  Toggle Receptor Inner Contour
   :refnum:   8

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ToggleInnerContour.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/ToggleInnerContour.cs>`


.. _section_examples_outer_contour:

Set Receptor Contour Volume
--------------------------------------------------------------------------------

The following code example shows how to change the receptor outer contour volume.

.. seealso::

   * * :ref:`OEReceptor <OEBio_OEReceptor>` class
   * :ref:`OEDesignUnit <OEBio_OEDesignUnit>` class

.. oe:source:: SetOuterContourVolume.cpp
   :language: c++
   :caption:  Set Receptor Contour Volume
   :refnum:   9

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SetOuterContourVolume.cpp <../../../../sublibs/tklibs/docking/examples/SetOuterContourVolume.cpp>`


.. oe:source:: SetOuterContourVolume.py
   :language: python
   :caption:  Set Receptor Contour Volume
   :refnum:   9

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SetOuterContourVolume.py <../../../../wrappers/python/examples/docking/SetOuterContourVolume.py>`

.. oe:source:: SetOuterContourVolume.java
   :language: java
   :caption:  Set Receptor Contour Volume
   :refnum:   9

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SetOuterContourVolume.java <../../../../wrappers/java/examples/openeye/examples/oedocking/SetOuterContourVolume.java>`



.. oe:source:: SetOuterContourVolume.cs
   :language: csharp
   :caption:  Set Receptor Contour Volume
   :refnum:   9

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SetOuterContourVolume.cs <../../../../wrappers/csharp/Csharp-Examples/OEDocking/SetOuterContourVolume.cs>`
