.. include:: ../../common/cookbook/cookbook-hyperlinks
.. include:: ../substitutions

.. oe:namespace:: OEGrapheme

.. oe:function:: OERenderUnpairedInteractionMap

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

      .. oe:api::

         bool OERenderUnpairedInteractionMap(OEDepict::OEImageBase& image,
                                             const OE2DActiveSiteDisplay& adisp)

   .. oe:language:: python

      .. oe:api:: python

         OERenderUnpairedInteractionMap(image: OEImageBase,
                                        adisp: OE2DActiveSiteDisplay) -> bool

   Renders the protein-ligand map with clash and unpaired interactions.

   *image*
      The image in which the active site is drawn.

   *adisp*
      The :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object that holds the
      data necessary to depict the interactions of an active site.

   The :oe:func:`OEGrapheme::OERenderUnpairedInteractionMap` function
   currently visualizes the following interactions:

   * Atom **clash** interaction (see :ref:`OEClashInteractionHint <OEBio_OEClashInteractionHint>` class)
   * **Unpaired** and **clash** types of the **hydrogen bonding** interaction
     (see :ref:`OEHBondInteractionHint <OEBio_OEHBondInteractionHint>` class :oe:constns:`OEBio::OEHBondInteractionHintType` namespace)
   * **Unpaired** types of the **salt-bridge** interaction
     (see :ref:`OESaltBridgeInteractionHint <OEBio_OESaltBridgeInteractionHint>` class and :oe:constns:`OEBio::OESaltBridgeInteractionHintType` namespace)

   The following code snippet shows how to use the :oe:func:`OEGrapheme::OERenderUnpairedInteractionMap`
   function. The image created is shown in
   :ref:`Figure: Example of using the OERenderUnpairedInteraction function<figure_RenderUnpairedMap>`.

   .. oe:source:: RenderUnpairedMap.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-RENDER-UNPAIREDMAP

   .. oe:source:: RenderUnpairedMap.py
      :language: python
      :noindent:
      :frag:     SNIPPET-RENDER-UNPAIREDMAP

   .. oe:source:: RenderUnpairedMap.java
      :language: java
      :noindent:
      :frag:     SNIPPET-RENDER-UNPAIREDMAP

   .. oe:source:: RenderUnpairedMap.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-RENDER-UNPAIREDMAP

   .. _figure_RenderUnpairedMap:

     .. only:: oehtml

      .. raw:: html

         <p align="center">
         <object data="../../_images/RenderUnpairedMap.svg" type="image/svg+xml"  width = "600" ></object>
         <p>

         <p align="center">
         <b>Example of using the OERenderUnpairedInteraction function</b>
         <p>

      .. image:: ../images/RenderUnpairedMap.svg
         :width: 1pt

   .. only:: oepdf

      .. figure:: ../images/RenderUnpairedMap.pdf
         :align: center

         **Example of using the OERenderUnpairedInteraction function**

   .. note::

       Please note that unpaired interactions have no direction in 3D,
       therefore the *linker* representing these unpaired interactions
       in 2D have no real spatial meaning either.  Ligand linkers are
       directed away from the ligand, while protein linkers are
       directed towards the ligand when rendered in 2D.

   .. seealso::

      * :oe:func:`OEGrapheme::OEDrawUnpairedInteractionMapLegend` function
      * :oe:func:`OEGrapheme::OERenderActiveSite` function
      * :oe:func:`OEGrapheme::OERenderActiveSiteMaps` function
      * :oe:func:`OEGrapheme::OERenderContactMap` function
      * :oe:func:`OEGrapheme::OERenderBFactorMap` function

   .. admonition:: Code Example

      * `Visualizing Protein-Ligand Unpaired Interactions`_ **OpenEye Python Cookbook** recipe
