:orphan:

.. _section_example_fastrocs_shapeclustering:

Shape Clustering
================

Uses the OEShapeDatabase to cluster the input database into shape
clusters based on a rudimentary clustering algorithm. The output is an
OEB file with members of each cluster attached as children to the
cluster head molecule.

.. note::

   Conformers from the same molecule may be
   assigned to two separate clusters. No attempt is made to deal with
   this problem as the solution is dependent on what the clustering will
   be used for. This is supposed to just show the feasibility of shape
   clustering.

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

.. oe:language:: c++

   .. code-block:: console

      prompt> sphereexclusionclustering <database> <clusters.oeb> [shape tanimoto cutoff = 0.75]

   .. only:: oehtml

      .. admonition:: Download code

         :download:`sphereexclusionclustering.cpp <../../../../../sublibs/tklibs/fastrocs/examples/sphereexclusionclustering.cpp>`

   .. only:: oepdf

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

.. oe:language:: python

   .. code-block:: console

      prompt> SphereExclusionClustering.py <database> <clusters.oeb> [shape tanimoto cutoff = 0.75]

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SphereExclusionClustering.py <../../../../../wrappers/python/examples/fastrocs/SphereExclusionClustering.py>`

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

      .. literalinclude:: ../../../../../wrappers/python/examples/fastrocs/SphereExclusionClustering.py



   .. only:: oepdf

      .. oe:source:: SphereExclusionClustering.py
         :language: python

.. oe:language:: java

   .. code-block:: console

      prompt> SphereExclusionClustering.java <database> <clusters.oeb> [shape tanimoto cutoff = 0.75]

   .. only:: oehtml

      .. admonition:: Download code

         :download:`SphereExclusionClustering.java <../../../../../wrappers/java/examples/openeye/examples/oefastrocs/SphereExclusionClustering.java>`

   .. only:: oepdf

      .. oe:source:: SphereExclusionClustering.java
         :language: java

