.. _oemedchem_examples_createmmpindexparallel:

Matched Pair analysis using a multi-process generation of an MMP index
================================================================================

.. oe:language:: c++

   A program that performs a multi-process matched pair analysis of a set of structures for
   indexing is available as a python-only utility.

.. oe:language:: java

   A program that performs a multi-process matched pair analysis of a set of structures for
   indexing is available as a python-only utility.

.. oe:language:: csharp

   A program that performs a multi-process matched pair analysis of a set of structures for
   indexing is available as a python-only utility.

.. oe:language:: python

   A program that performs a multi-process matched pair analysis of a set of structures for
   indexing and saves the generated index file for subsequent loading and querying.
   This example uses the python `multiprocessing <https://docs.python.org/3/library/multiprocessing.html>`_ module.

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

      **Schematic representation of the Matched Pair Analysis process**

   .. seealso::

      * :ref:`OEMatchedPairAnalyzer <OEMedChem_OEMatchedPairAnalyzer>` class
      * :ref:`OEMatchedPairAnalyzerOptions <OEMedChem_OEMatchedPairAnalyzerOptions>` class
      * :oe:func:`OEMedChem::OEMatchedPairApplyTransforms` function



Command Line Interface
----------------------

..  code-block:: console

    prompt> CreateMMPIndexParallel.py [ -pool num_processes ] index.sdf output.mmpidx


Code
----

..  oe:language:: python

    .. only:: oehtml

    ..  admonition:: Download code

        :download:`CreateMMPIndexParallel.py <../../../../wrappers/python/examples/medchem/CreateMMPIndexParallel.py>`

    ..  literalinclude:: ../../../../wrappers/python/examples/medchem/CreateMMPIndexParallel.py

..  only:: oepdf

    ..  oe:source:: CreateMMPIndexParallel.py
        :language: python

