.. _section_example_oechem_makefastss:

Generate database for fast substructure search
================================================================================

A program that generates a binary file for fast substructure search.
For more explanation, see :oe:func:`OEChem::OECreateSubSearchDatabaseFile` function.

.. figure:: ../images/FastSSGeneration.*
   :width: 350 pt
   :align: center

   **Schematic representation of substructure search database file generation process**

.. admonition:: Code Example

   * :ref:`section_example_oechem_searchfastss` example

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

.. oe:language:: python

   .. code-block:: console

      prompt> python makefastss.py --help

will generate the following output:

.. code-block:: console

   Simple parameter list
    input/output options
      -in : Input molecule filename
      -out : Output substructure database filename

    other options
      -keep-title : Whether to keep the title of the molecule as unique
                    identifier
      -nrthreads : Number of processors used (zero means all available)
      -screentype : Screen type generated
      -sort : Whether to sort the molecules based on their screen bit counts.

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

.. oe:language:: c++

   .. code-block:: console

      prompt> makefastss -in dataset.ism -out ss-search-dataset-SMARTS.oeb -stype SMARTS

.. oe:language:: python

   .. code-block:: console

      prompt> makefastss.py -in dataset.ism -out sss-search-dataset-SMARTS.oeb -stype SMARTS


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

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

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

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


   .. only:: oepdf

      .. oe:source:: makefastss.py
         :language: python

.. seealso::

   * :ref:`OECreateSubSearchDatabaseOptions <OEChem_OECreateSubSearchDatabaseOptions>` class
   * :ref:`OESubSearchScreenTypeBase <OEChem_OESubSearchScreenTypeBase>` class
   * :ref:`OEConsoleProgressTracer <OESystem_OEConsoleProgressTracer>` class
   * :oe:func:`OEChem::OEGetSubSearchScreenType` function
   * :oe:func:`OEChem::OECreateSubSearchDatabaseFile` function
   * :oe:func:`OEChem::OECreateSubSearchDatabaseOptions` function
