.. _lexichem_section_examples_mol2nam:

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

Converts a file of chemical structures (specified by *-in* option) into
chemical names (*-out* option), in a choice of language (*-language* option),
encodings (*-encoding* option) and styles (*-style* 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> mol2nam_example --help

.. oe:language:: python

   .. code-block:: console

      prompt> python mol2nam_example.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java Mol2Nam_example --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> Mol2Nam_example --help


will generate the following output:

.. code-block:: console

   Simple parameter list

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

       Lexichem
         -language : Language for output names.
         -style : Style of output names
         -capitalize : Capitalize output names.
         -tag : Set name as SD data with tag
         -delim : Append name to title using "delim"
         -charset : Choose charset/encoding for output names.

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

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

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

   .. only:: oepdf

      .. oe:source:: mol2nam_example.py
         :language: python


.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

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

      with interface file

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

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: Mol2Nam_example.java
         :language: java

      with interface file

      .. oe:source:: Mol2Nam_example.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: Mol2Nam_example.cs
         :language: csharp
