.. _section_examples_summary_searchfp:

Building and searching fingerprint database
=========================================================

A program that builds a fingerprint database on-the-fly and
then performs fingerprint search to identify molecules which
are similar to a given query molecule

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

.. oe:language:: python

   .. code-block:: console

      prompt> python searchfp.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java SearchFP --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> SearchFP --help


will generate the following output:

.. code-block:: console

   Simple parameter list

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

    fingerprint options
      -atomtype : Fingerprint atom type
      -bondtype : Fingerprint bond type
      -fptype : Fingerprint type
      -maxdistance : Maximum number of bonds/radius in path/circular/tree
      -mindistance : Minimum number of bonds/radius in path/circular/tree
      -numbits : Size of bitvector

    input/output options
      -molfname : Input molecule filename
      -out : Output molecule filename
      -query : Input query filename

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

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

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

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


   .. only:: oepdf

      .. oe:source:: searchfp.py
         :language: python


.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

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

      with interface file

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

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: SearchFP.java
         :language: java

      with interface file

      .. oe:source:: SearchFP.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: SearchFP.cs
         :language: csharp

.. seealso::

   * :ref:`OEFPDatabaseOptions <OEGraphSim_OEFPDatabaseOptions>` class
   * :oe:func:`OEGraphSim::OEConfigureFPDatabaseOptions` and
     :oe:func:`OEGraphSim::OESetupFPDatabaseOptions` functions
   * :oe:func:`OEGraphSim::OEConfigureFingerPrint` and
     :oe:func:`OEGraphSim::OESetupFingerPrint` functions
   * :ref:`OEMolDatabase <OEChem_OEMolDatabase>` class in **OEChem TK** manual
   * :ref:`OEFPDatabase <OEGraphSim_OEFPDatabase>` class

