.. ################################################################
   # version0_9_6
   ################################################################

.. oe:namespace:: OEMedChem

.. meta::
   :keywords: OEWriteMatchedPairAnalyzer WriteMatchedPairAnalyzer serialize

.. oe:function:: OEWriteMatchedPairAnalyzer

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEWriteMatchedPairAnalyzer(const std::string& fname,
                                         const OEMatchedPairAnalyzer& mmpindex)
         bool OEWriteMatchedPairAnalyzer(OEPlatform::oeostream& ofs,
                                         const OEMatchedPairAnalyzer& mmpindex)

   .. oe:language:: python

      .. oe:api:: python

         OEWriteMatchedPairAnalyzer(fname: str, mmpindex: OEMatchedPairAnalyzer) -> bool
         OEWriteMatchedPairAnalyzer(ofs: oeostream,
                                    mmpindex: OEMatchedPairAnalyzer) -> bool

   This function serializes the state of the :ref:`OEMatchedPairAnalyzer <OEMedChem_OEMatchedPairAnalyzer>` instance argument
   to a file or stream as below:

   .. oe:source:: SerializeIndex.cpp
      :language: c++
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-SERIALIZE-INDEX

   .. oe:source:: SerializeIndex.py
      :language: python
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-SERIALIZE-INDEX

   .. oe:source:: SerializeIndex.java
      :language: java
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-SERIALIZE-INDEX

   .. oe:source:: SerializeIndex.cs
      :language: csharp
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-SERIALIZE-INDEX

   If the matched pair index information being exported is complete in the sense that additional structures are *not*
   intended to be added to the index upon a subsequent deserialization, significant savings in output file size is
   possible by suppressing the export of singleton nodes - those index nodes which do not contain any matched pairs.
   Conversely, if the exported index must be able to support adding additional structures to the index after
   deserialization, export compression should be avoided, otherwise significant matched pairs may be missed.
   To *enable* export compression (by default, *disabled*), see the following:

   .. oe:source:: SerializeIndex.cpp
      :language: c++
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-MMP

   .. oe:source:: SerializeIndex.cpp
      :language: c++
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-OPTS

   .. oe:source:: SerializeIndex.py
      :language: python
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-MMP

   .. oe:source:: SerializeIndex.py
      :language: python
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-OPTS

   .. oe:source:: SerializeIndex.java
      :language: java
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-MMP

   .. oe:source:: SerializeIndex.java
      :language: java
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-OPTS

   .. oe:source:: SerializeIndex.cs
      :language: csharp
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-MMP

   .. oe:source:: SerializeIndex.cs
      :language: csharp
      :frag:     SNIPPET-MATCHEDPAIRANALYZER-EXPORT-COMPRESS-OPTS

   .. seealso::

      * :oe:func:`OEMedChem::OEIsWriteableMatchedPairAnalyzer`
      * :oe:func:`OEMedChem::OEReadMatchedPairAnalyzer`


