.. _section_examples_summary_depict:


Generating 2D coordinates
=========================

A program that assigns 2D coordinates to molecule(s).

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

.. oe:language:: python

   .. code-block:: console

      prompt> python depict.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java Depict --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> Depict --help


will generate the following output:

.. code-block:: console

   Simple parameter list
   input/output options :
      -in : Input filename
      -out : Output filename
      -ringdict : User-defined 2D ring dictionary

    prepare depiction options :
      -orientation : Set the preferred orientation of 2D coordinates
      -suppressH : Suppress explicit hydrogens of molecule(s)


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


.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

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

      with interface file

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

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

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

   .. only:: oepdf

      .. oe:source:: depict.py
         :language: python


.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: Depict.java
         :language: java

      with interface file

      .. oe:source:: Depict.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: Depict.cs
         :language: csharp

.. seealso::

   * :oe:func:`OEDepict::OEConfigurePrepareDepictionOptions` function
   * :oe:func:`OEChem::OEIs2DFormat` function
   * :ref:`OEPrepareDepictionOptions <OEDepict_OEPrepareDepictionOptions>` class
   * :oe:func:`OEDepict::OESetupPrepareDepictionOptions` function
   * :oe:func:`OEDepict::OEPrepareDepiction` function

Example
--------------------------------------------------------------------------------

.. oe:language:: c++

   .. code-block:: console

      prompt> depict .ism .mol

      C(=O)N

.. oe:language:: python

   .. code-block:: console

      prompt> python depict.py .ism .mol

      C(=O)N

.. oe:language:: java

   .. code-block:: console

      prompt> java Depict .ism .mol

      C(=O)N

.. oe:language:: csharp

   .. code-block:: console

      prompt> Depict .ism .mol

      C(=O)N

will generate the following output:

::

     -OEChem-07031123462D

     3  2  0     0  0  0  0  0  0999 V2000
       0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
       1.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
      -0.5000   -0.8660    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
     1  2  2  0  0  0  0
     1  3  1  0  0  0  0
   M  END

.. note::

   The above program can generate 2D coordinates with user-defined 2D ring layouts when using the
   **-ringdict** parameter.

   See also the :ref:`section_example_oechem_2D_coordinate_generation` section of
   the **OEChem TK** manual that shows examples about how to generate and
   utilize user-defined ring dictionaries.
