.. include:: ../common/cookbook/cookbook-hyperlinks

.. _section_examples_summary_complex2img:

Depicting Active Site Interactions
===================================================================================

A program that depicts receptor-ligand interactions.

.. seealso::

   * `Visualizing Protein-Ligand Interactions`_ OpenEye Python Cookbook example


Command Line Interface
-----------------------------------------------------------------------------------

A description of the command line interface can be obtained by
executing the program with the --help argument.

.. oe:language:: c++

   .. code-block:: console

      prompt> complex2img --help

.. oe:language:: python

   .. code-block:: console

      prompt> python complex2img.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java Complex2Img --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> Complex2Img --help


will generate the following output:

.. code-block:: console

    [-complex] <input> [-out] <output image>

    Simple parameter list
        -height : Height of output image
        -width : Width of output image

        SplitMolComplex options :
          -ligandname : Ligand name

        input/output options
          -complex : Input filename of the protein complex
          -out : Output filename

        molecule display options
          -aromstyle : Aromatic ring display style

Code
--------------------------------------------------------------------------------

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`complex2img.py <../../../../wrappers/python/examples/grapheme/complex2img.py>`

      .. literalinclude:: ../../../../wrappers/python/examples/grapheme/complex2img.py

   .. only:: oepdf

      .. oe:source:: complex2img.py
         :language: python

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`complex2img.cpp <../../../../sublibs/tklibs/grapheme/examples/complex2img.cpp>`
         and
         :download:`complex2img.txt <../../../../sublibs/tklibs/grapheme/examples/complex2img.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: complex2img.cpp
         :language: c++

      With the complex2img.txt interface file

      .. oe:source:: complex2img.txt
         :language: c++

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`Complex2Img.java <../../../../wrappers/java/examples/openeye/examples/oegrapheme/Complex2Img.java>`
         and
         :download:`Complex2Img.txt <../../../../wrappers/java/examples/openeye/examples/oegrapheme/Complex2Img.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: Complex2Img.java
         :language: java

      With the Complex2Img.txt interface file

      .. oe:source:: Complex2Img.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`Complex2Img.cs <../../../../wrappers/csharp/Csharp-Examples/OEGrapheme/Complex2Img.cs>`

   .. only:: oepdf

      .. oe:source:: Complex2Img.cs
         :language: csharp

.. seealso::

   * :oe:func:`OEBio::OESplitMolComplex` function in **OEChem TK**
   * :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` class in **OEChem TK**
   * :oe:func:`OEBio::OEPerceiveInteractionHints` function in **OEChem TK**
   * :oe:func:`OEGrapheme::OEPrepareActiveSiteDepiction` function
   * :ref:`OE2DActiveSiteDisplayOptions <OEGrapheme_OE2DActiveSiteDisplayOptions>` class
   * :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` class and
     :oe:func:`OEGrapheme::OERenderActiveSite` function
   * :oe:func:`OEGrapheme::OEDrawActiveSiteLegend` function


Examples
-----------------------------------------------------------------------------------

.. oe:language:: c++

   .. code-block:: console

      prompt> complex2img -complex pdb1br6.ent -out 1br6-PT1.png

.. oe:language:: python

   .. code-block:: console

      prompt> python complex2img.py -complex pdb1br6.ent -out 1br6-PT1.png

.. oe:language:: java

   .. code-block:: console

      prompt> java Complex2Img complex2img.py -complex pdb1br6.ent -out 1br6-PT1.png

.. oe:language:: csharp

   .. code-block:: console

      prompt> Complex2Img complex2img.py -complex pdb1br6.ent -out 1br6-PT1.png


will generate the image shown in
:ref:`Figure: Example of depicting the receptor-ligand interaction (PDB: 1br6)<figure_complex2img_1br6_PT1>`.

.. _figure_complex2img_1br6_PT1:

.. figure:: images/complex2img-1br6-PT1.*
   :align:  center

   **Example of depicting the receptor-ligand interactions (PDB: 1br6)**

.. #################################################################################################################

.. oe:language:: c++

   .. code-block:: console

      prompt> complex2img -complex pdb1eoc.ent -out 1eoc-4NC.png

.. oe:language:: python

   .. code-block:: console

      prompt> python complex2img.py -complex pdb1eoc.ent -out 1eoc-4NC.png

.. oe:language:: java

   .. code-block:: console

      prompt> java Complex2Img.py -complex pdb1eoc.ent -out 1eoc-4NC.png

.. oe:language:: csharp

   .. code-block:: console

      prompt> Complex2Img.py -complex pdb1eoc.ent -out 1eoc-4NC.png

will generate the image shown in
:ref:`Figure: Example of depicting the receptor-ligand interaction (PDB: 1eoc)<figure_complex2img_1eoc_4NC>`.

.. _figure_complex2img_1eoc_4NC:

.. figure:: images/complex2img-1eoc-4NC.*
   :align:  center

   **Example of depicting the receptor-ligand interactions (PDB: 1eoc)**


