.. _section_examples_summary_mdlquery2img:

Depicting MDL Query
================================================================================

A program that converts an MDL query structure 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> mdlquery2img --help

.. oe:language:: python

   .. code-block:: console

      prompt> python mdlquery2img.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java MDLQuery2Img --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> MDLQuery2Img --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:`mdlquery2img.cpp <../../../../sublibs/tklibs/depict/examples/mdlquery2img.cpp>`
         and
         :download:`mdlquery2img.txt <../../../../sublibs/tklibs/depict/examples/mdlquery2img.txt>`
         interface file

   .. only:: oepdf

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

      with interface file

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

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

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


   .. only:: oepdf

      .. oe:source:: mdlquery2img.py
         :language: python


.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: MDLQuery2Img.java
         :language: java

      with interface file

      .. oe:source:: MDLQuery2Img.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: MDLQuery2Img.cs
         :language: csharp


.. seealso::

   * :ref:`chapter_mdlquery` chapter

   * :oe:func:`OEDepict::OEConfigureImageOptions` function
   * :oe:func:`OEDepict::OEConfigure2DMolDisplayOptions` function
   * :oe:func:`OEDepict::OEIsRegisteredImageFile` function
   * :oe:func:`OEChem::OEReadMDLQueryFile` 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> mdlquery2img -in mdlquery.mol -out image.png

.. oe:language:: python

   .. code-block:: console

      prompt> python mdlquery2img.py -in mdlquery.mol -out image.png

.. oe:language:: java

   .. code-block:: console

      prompt> java MDLQuery2Img -in mdlquery.mol -out image.png

.. oe:language:: c++

   .. code-block:: console

      prompt> MDLQuery2Img -in mdlquery.mol -out image.png


will generate the image shown in
:ref:`Figure: Example of depicting an MDL query<figure_mdlquery2img>`

.. _figure_mdlquery2img:

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

   **Example of depicting an MDL query**

.. seealso::

  * :ref:`chapter_mdlquery` chapter
