.. _oegraphsim_chapter_intro:
.. _GraphSim:

********************************************************************************
Introduction
********************************************************************************

This manual is to familiarize the user with the **GraphSim TK**
functionalities. It does not provide explanations
of basic **OEChem TK** classes and functions. Therefore reading the
**OEChem TK** manual beforehand is highly recommended.

The **GraphSim TK** library provides a facility for encoding 2D molecular
graph information into fingerprints.
The following basic fingerprint functionalities are available:

* Generation (see :ref:`chapter_fingerprint` chapter)
* Storage (see :ref:`chapter_storage` chapter)
* Comparison (see :ref:`chapter_measure` chapter)

Emphasis has been placed on speed, with attention to rapid in-memory
fingerprint search (see :ref:`chapter_database` chapter).

.. The **GraphSim TK** package includes functionality for generating
   fingerprints that encode 2D graph information, calculating
   molecular similarity from fingerprints and provides facility to
   perform rapid in-memory fingerprint search.

.. _oegraphsim_section_visualizing_molecule_similarity:

Visualizing Molecule Similarity
================================================================================

All images in this manual are generated utilizing the
`OEDepict TK <http://www.eyesopen.com/oedepict-tk>`_
and `Grapheme TK <http://www.eyesopen.com/oegrapheme-tk>`_ .

Molecule similarity based on fingerprints is visualized by the
following method:
(See example in :ref:`Figure: Example of depiction of molecule similarity based on fingerprints<figure_MoleculeSimilarity>`)

* The :oe:func:`OEGraphSim::OEGetFPOverlap` function is utilized to return all
  common fragments found between two molecules based on a given fingerprint type.
  These common fragments reveal the similar parts of the two molecules being compared.
*  A “yellow to dark green” linear color gradient is then used to color the
   molecules by their similarity.
   Where there is similarity detected between the two molecules *i.e.* there are common fragments,
   the color green is used to highlight the bonds. The color gets darker with
   increasing similarity *i.e.* as more fragments are shared by the two molecules.
*  Color pink indicates parts of the molecules that are not
   sharing any common fragments *i.e.* they are 2D dissimilar based on the
   given fingerprint type.

.. _figure_MoleculeSimilarity:

.. figure:: images/MoleculeSimilarity.*
   :align:  center

   **Example of depiction of molecule similarity based on fingerprints**

.. hint::

   Visualizing similarity of two molecules based on their fingerprints provides insight into
   molecule similarity beyond a single numerical score and reveals information about the underlying
   fingerprint methods.

.. seealso::

   The Python script that visualizes molecule similarity based on fingerprints
   can be downloaded from the
   `OpenEye Python Cookbook <https://docs.eyesopen.com/python_modules/cookbook/python/depiction/simcalc.html>`_

