.. _section_examples_summary_mdlreaction2img:

Depicting MDL Reaction
================================================================================

A program that converts an MDL reaction into an image file.


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> mdlreaction2img --help

.. oe:language:: python

   .. code-block:: console

      prompt> python mdlreaction2img.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java MDLReaction2Img --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> MDLReaction2Img --help


will generate the following output:

.. code-block:: console

   Simple parameter list

    image options :
      -height : Height of output image
      -width : Width of output image

    input/output options :
      -in : Input filename
      -out : Output filename

    molecule display options :
      -aromstyle : Aromatic ring display style
      -atomcolor : Atom coloring style
      -atomlabelfontscale : Atom label font scale
      -atomprop : Atom property display
      -atomstereostyle : Atom stereo display style
      -bondcolor : Bond coloring style
      -bondprop : Bond property display
      -bondstereostyle : Bond stereo display style
      -hydrstyle : Hydrogen display style
      -linewidth : Default bond line width
      -protgroupdisp : Protective group display style
      -scale : Scaling of the depicted molecule
      -superdisp : Super atom display style
      -titleloc : Location of the molecule title

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

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`mdlreaction2img.cpp <../../../../sublibs/tklibs/depict/examples/mdlreaction2img.cpp>`
         and
         :download:`mdlreaction2img.txt <../../../../sublibs/tklibs/depict/examples/mdlreaction2img.txt>`
         interface file

   .. only:: oepdf

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

      with interface file

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`mdlreaction2img.py <../../../../wrappers/python/examples/depict/mdlreaction2img.py>`

      .. literalinclude:: ../../../../wrappers/python/examples/depict/mdlreaction2img.py


   .. only:: oepdf

      .. oe:source:: mdlreaction2img.py
         :language: python


.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MDLReaction2Img.java <../../../../wrappers/java/examples/openeye/examples/oedepict/MDLReaction2Img.java>`
         and
         :download:`MDLReaction2Img.txt <../../../../wrappers/java/examples/openeye/examples/oedepict/MDLReaction2Img.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: MDLReaction2Img.java
         :language: java

      with interface file

      .. oe:source:: MDLReaction2Img.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MDLReaction2Img.cs <../../../../wrappers/csharp/Csharp-Examples/OEDepict/MDLReaction2Img.cs>`

   .. only:: oepdf

      .. oe:source:: MDLReaction2Img.cs
         :language: csharp


.. seealso::

   * :ref:`chapter_mdlreaction` chapter

   * :oe:func:`OEDepict::OEConfigureImageOptions` function
   * :oe:func:`OEDepict::OEConfigure2DMolDisplayOptions` function
   * :oe:func:`OEDepict::OEIsRegisteredImageFile` function
   * :oe:func:`OEChem::OEReadMDLReactionQueryFile` function
   * :oe:func:`OEDepict::OEPrepareDepiction` function
   * :oe:func:`OEDepict::OEGetImageWidth` and :oe:func:`OEDepict::OEGetImageHeight` functions
   * :ref:`OE2DMolDisplayOptions <OEDepict_OE2DMolDisplayOptions>` class
   * :oe:func:`OEDepict::OESetup2DMolDisplayOptions` function
   * :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` class
   * :oe:func:`OEDepict::OERenderMolecule` function


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

.. oe:language:: c++

   .. code-block:: console

      prompt> mdlreaction2img -in mdlreaction.sdf -out image.png

.. oe:language:: python

   .. code-block:: console

      prompt> python mdlreaction2img.py -in mdlreaction.sdf -out image.png

.. oe:language:: java

   .. code-block:: console

      prompt> java MDLReaction2Img -in mdlreaction.sdf -out image.png

.. oe:language:: csharp

   .. code-block:: console

      prompt> MDLReaction2Img -in mdlreaction.sdf -out image.png

will generate the following image:
:ref:`Figure: Example of depicting an MDL reaction<figure_mdlreaction2img_1>`

.. _figure_mdlreaction2img_1:

.. figure:: images/mdlreaction2img-01.*
   :align:  center

   **Example of depicting an MDL reaction**

.. -----------------------------------------------------------------------------

.. oe:language:: c++

   .. code-block:: console

      prompt> mdlreaction2img -in mdlreaction.sdf -out image.png -atomprop MapIdx

.. oe:language:: python

   .. code-block:: console

      prompt> python mdlreaction2img.py -in mdlreaction.sdf -out image.png -atomprop MapIdx

.. oe:language:: java

   .. code-block:: console

      prompt> java MDLReaction2img -in mdlreaction.sdf -out image.png -atomprop MapIdx

.. oe:language:: c++

   .. code-block:: console

      prompt> MDLReaction2Img -in mdlreaction.sdf -out image.png -atomprop MapIdx

will generate the following image:
:ref:`Figure: Example of depicting an MDL reaction with atom map indices<figure_mdlreaction2img_2>`

.. _figure_mdlreaction2img_2:

.. figure:: images/mdlreaction2img-02.*
   :align:  center

   **Example of depicting an MDL reaction with atom map indices**

.. -----------------------------------------------------------------------------

.. seealso::

  * :ref:`chapter_mdlreaction` chapter
