.. include:: ../common/cookbook/cookbook-hyperlinks

.. _section_examples_summary_searchfastfp:

Searching fast fingerprint database
=========================================================

A program that initializes a fast fingerprint database with
the fingerprint file generated from the previous example and
then performs a fingerprint search to identify molecules which
are similar to a given query molecule.

.. figure:: images/searchfastfp.*
   :align:  center
   :width:  400pt

   **Schematic representation of fast fingerprint search process**

.. seealso::

   * Example code in the :ref:`section_examples_summary_makefastfp` section
   * `Rapid Similarity Searching of Large Molecule File`_ OpenEye Python Cookbook 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> searchfastfp --help

.. oe:language:: python

   .. code-block:: console

      prompt> python searchfastfp.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java SearchFastFP --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> SearchFastFP --help


will generate the following output:

.. code-block:: console

   Simple parameter list

    fingerprint database options
      -memorytype : Fingerprint database memory type

    fingerprint database search options
      -cutoff : Similarity cutoff value
      -descending : Order of similarity scores
      -limit : Maximum number of similarity scores
      -simfunc : Similarity measure

    input/output options
      -fpdbfname : Input fast fingerprint database filename
      -molfname : Input molecule filename
      -out : Output molecule filename
      -query : Input query filename


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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`searchfastfp.py <../../../../wrappers/python/examples/graphsim/searchfastfp.py>`

   .. :ref:`Full listing. <listing-searchfastfp.py>`

   ..   literalinclude:: ../../../../wrappers/python/examples/graphsim/searchfastfp.py


   .. only:: oepdf

      .. oe:source:: searchfastfp.py
         :language: python


.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

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

      with interface file

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

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SearchFastFP.java <../../../../wrappers/java/examples/openeye/examples/oegraphsim/SearchFastFP.java>`
         and
         :download:`SearchFastFP.txt <../../../../wrappers/java/examples/openeye/examples/oegraphsim/SearchFastFP.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: SearchFastFP.java
         :language: java

      with interface file

      .. oe:source:: SearchFastFP.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SearchFastFP.cs <../../../../wrappers/csharp/Csharp-Examples/OEGraphSim/SearchFastFP.cs>`

   .. only:: oepdf

      .. oe:source:: SearchFastFP.cs
         :language: csharp


.. seealso::

   * :ref:`OEFPDatabaseOptions <OEGraphSim_OEFPDatabaseOptions>` class
   * :oe:func:`OEGraphSim::OEConfigureFPDatabaseOptions` and
     :oe:func:`OEGraphSim::OESetupFPDatabaseOptions` functions
   * :oe:func:`OEGraphSim::OEConfigureFPDatabaseMemoryType` and
     :oe:func:`OEGraphSim::OEGetFPDatabaseMemoryType` function
   * :ref:`OEMolDatabase <OEChem_OEMolDatabase>` class in **OEChem TK** manual
   * :oe:constns:`OEGraphSim::OEFastFPDatabaseMemoryType` namespace
   * :ref:`OEFastFPDatabase <OEGraphSim_OEFastFPDatabase>` class
   * :oe:func:`OEGraphSim::OEAreCompatibleDatabases` function
