.. _lexichem_section_examples_nam2mol:

Converting Names to Molecules
=============================

Converts a file of chemical names (specified by the *-in* option) of a
specific language (*-language* option) into a file of chemical structures
(specified by the *-out* option).

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

.. oe:language:: python

   .. code-block:: console

      prompt> python nam2mol_example.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java Nam2Mol_example --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> Nam2Mol_example --help


will generate the following output:

.. code-block:: console

   Simple parameter list

     nam2mol
       I/O
         -in : Input filename
         -out : Output filename

       Lexichem
         -language : Language for input names.
         -tag : Set name as SD data with tag
         -empty : Output an empty molecule for unparseable names
         -charset : Choose charset/encoding for input names.

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`nam2mol_example.py <../../../../wrappers/python/examples/iupac/nam2mol_example.py>`

   ..   literalinclude:: ../../../../wrappers/python/examples/iupac/nam2mol_example.py

   .. only:: oepdf

      .. oe:source:: nam2mol_example.py
         :language: python


.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

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

      with interface file

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

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`Nam2Mol_example.java <../../../../wrappers/java/examples/openeye/examples/oeiupac/Nam2Mol_example.java>`
         and
         :download:`Nam2Mol_example.txt <../../../../wrappers/java/examples/openeye/examples/oeiupac/Nam2Mol_example.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: Nam2Mol_example.java
         :language: java

      with interface file

      .. oe:source:: Nam2Mol_example.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`Nam2Mol_example.cs <../../../../wrappers/csharp/Csharp-Examples/OEIUPAC/Nam2Mol_example.cs>`

   .. only:: oepdf

      .. oe:source:: Nam2Mol_example.cs
         :language: csharp
