:orphan:

.. _section_example_fastrocs_shapedatabasechunker:

Shape Database Chunker
================================

Split a database into n_servers chunks. Due to the nature of the
OEShapeDatabase the chunking is performed based upon the number of
heavy atoms in each molecule. The OEShapeDatabase will actually triage
molecules by heavy atom counts, so it is better to keep molecules with
similar heavy atom counts together.

The chunker also takes the opportunity to cache a self shape term into
the OEB file using the OESetCachedSelfShape function. This
significantly improves (~5x) database load time.

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

.. oe:language:: c++

   .. code-block:: console

      prompt> shapedatabasechunker <database> <prefix> <n_servers>

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

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

.. oe:language:: python

   .. code-block:: console

      prompt> ShapeDatabaseChunker.py <database> <prefix> <n_servers>
   
   .. only:: oehtml

      .. admonition:: Download code

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

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

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



   .. only:: oepdf

      .. oe:source:: ShapeDatabaseChunker.py
         :language: python

.. oe:language:: java

   .. code-block:: console

      prompt> ShapeDatabaseChunker <database> <prefix> <n_servers>

   .. only:: oehtml

      .. admonition:: Download code

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

   .. only:: oepdf

      .. oe:source:: ShapeDatabaseChunker.java
         :language: java

