.. _section_example_oechem_uniqmol:

Write out unique molecules (canonical SMILES)
================================================================================

A program that loads a database of molecules and outputs those that
are unique. Uniqueness is defined by whether they have the same
canonical isomeric SMILES.

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

.. oe:language:: c++

   .. code-block:: console

      prompt> uniqmol dbase.oeb.gz output.oeb.gz

.. oe:language:: python

   .. code-block:: console

      prompt> uniqmol.py dbase.oeb.gz output.oeb.gz

.. oe:language:: java

   .. code-block:: console

      prompt> UniqMol dbase.oeb.gz output.oeb.gz

.. oe:language:: csharp

   .. code-block:: console

      prompt> UniqMol dbase.oeb.gz output.oeb.gz

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

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`uniqmol.cpp <../../../../../sublibs/tklibs/oechem/examples/uniqmol.cpp>`

   .. only:: oepdf

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`uniqmol.py <../../../../../wrappers/python/examples/oechem/uniqmol.py>`

      .. literalinclude:: ../../../../../wrappers/python/examples/oechem/uniqmol.py


   .. only:: oepdf

      .. oe:source:: uniqmol.py
         :language: python

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`UniqMol.java <../../../../../wrappers/java/examples/openeye/examples/oechem/UniqMol.java>`

   .. only:: oepdf

      .. oe:source:: UniqMol.java
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`UniqMol.cs <../../../../../wrappers/csharp/Csharp-Examples/OEChem/UniqMol.cs>`

   .. only:: oepdf

      .. oe:source:: UniqMol.cs
         :language: csharp


.. seealso::

   * :oe:func:`OEChem::OECreateIsoSmiString` function
   * :ref:`section_example_oechem_uniqinchi` section
