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

.. oe:namespace:: OEBio


.. _OEBio_OEInteractionHintContainer:

.. oe:class:: OEInteractionHintContainer

   .. oe:api::

      class OEInteractionHintContainer

   This class represents :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>`, a read only class
   that stores molecules, the fragments of those molecules (:ref:`OEInteractionHintFragment <OEBio_OEInteractionHintFragment>`), and the typed interactions (:ref:`OEInteractionHint <OEBio_OEInteractionHint>`) between the fragments.

   .. only:: oehtml

      .. figure:: ../images/interactionhint.svg
         :width: 600
         :align: center

         **Schematic representation of interaction hint container**

   .. seealso::

      * :ref:`OEInteractionHintFragment <OEBio_OEInteractionHintFragment>` class
      * :ref:`OEInteractionHint <OEBio_OEInteractionHint>` class
      * :ref:`OEPerceiveInteractionOptions <OEBio_OEPerceiveInteractionOptions>` class

   .. seealso::

      This class is used by **OEChem TK** and **Grapheme TK**
      to visualize protein-ligand interactions.

      * :oe:func:`OEBio::OEPerceiveInteractionHints` function in the **OEChem TK** manual
      * :oe:func:`OEGrapheme::OERenderActiveSite` function in the **Grapheme TK** manual
      * :oe:func:`OEGrapheme::OERenderUnpairedInteractionMap` function in the **Grapheme TK** manual

   .. admonition:: Code Examples

      * :ref:`section_example_oebio_printinteractions` **OEChem TK** example
      * :ref:`section_examples_summary_complex2img` **Grapheme TK** example
      * `Accessing Interaction Hint Information`_ **OpenEye Python Cookbook** recipe


   .. ################################################################
      #
      ################################################################

   .. _OEBio_OEInteractionHintContainer_Constructors:

   .. oe:method:: Constructors

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

         .. oe:api::

            OEInteractionHintContainer()

      .. oe:language:: python

         .. oe:api:: python

            OEInteractionHintContainer() -> OEInteractionHintContainer

      Constructs an empty :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.

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

         .. oe:api::

            OEInteractionHintContainer(const OEChem::OEMolBase& protein,
                                       const OEChem::OEMolBase& ligand)

      .. oe:language:: python

         .. oe:api:: python

            OEInteractionHintContainer(protein: Union[OEGraphMol,OEMol,OEQMol],
                                       ligand: Union[OEGraphMol,OEMol,OEQMol]) -> OEInteractionHintContainer

      Initializes an :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object with the two
      given molecules. The first molecule will be added to the
      container with the :ref:`OEProteinInteractionHintComponent <OEBio_OEProteinInteractionHintComponent>` type
      while the second molecule will be added with the
      :ref:`OELigandInteractionHintComponent <OEBio_OELigandInteractionHintComponent>` type.

      To perceive only intramolecular interactions within one component, pass an
      empty molecule for the other component. For example, to perceive only
      intramolecular interactions within the protein, pass an empty molecule as
      the ``ligand`` argument. Similarly, to perceive only intramolecular
      interactions within the ligand, pass an empty molecule as the ``protein``
      argument.

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

         .. oe:api::

            OEInteractionHintContainer(const OEBio::OEDesignUnit& du,
                                       const unsigned receptorMask = OEBio::OEDesignUnitComponents::TargetComplex)

      .. oe:language:: python

         .. oe:api:: python

            OEInteractionHintContainer(du: OEDesignUnit, receptorMask: int) -> OEInteractionHintContainer

      Initializes an :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>`
      from an :oe:cls:`OEBio::OEDesignUnit`. The receptor component is assembled
      from all design unit components matching ``receptorMask`` (default:
      :oe:const:`OEBio::OEDesignUnitComponents::TargetComplex`). If the design
      unit has a ligand, it is added with the
      :ref:`OELigandInteractionHintComponent <OEBio_OELigandInteractionHintComponent>` type.
      If the design unit has site residues but no ligand, an empty ligand
      molecule is used so that only intramolecular interactions within the
      receptor are perceived.

      .. seealso::

         * :oe:const:`OEBio::OEDesignUnitComponents::TargetComplex` constant
         * :ref:`OEDesignUnit <OEBio_OEDesignUnit>` class
         * :oe:func:`OEBio::OEConstructInteractionHintContainer` function


   .. ################################################################
      #
      ################################################################

   .. oe:method:: operator bool

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

         .. oe:api::

            operator bool() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Same as the :oe:meth:`OEBio::OEInteractionHintContainer::IsValid` method.


   .. ################################################################
      #
      ################################################################

   .. oe:method:: AddMolecule

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

         .. oe:api::

            const OEChem::OEMolBase* AddMolecule(const OEChem::OEMolBase& mol,
                                                 const OEInteractionHintComponentTypeBase& itype)

      .. oe:language:: python

         .. oe:api:: python

            AddMolecule(mol: Union[OEGraphMol,OEMol,OEQMol],
                        itype: OEInteractionHintComponentTypeBase) -> OEGraphMol

      Adds a molecule the :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` with a given
      type. It returns the pointer of the molecule that is the copied molecule
      stored inside the interaction container or returns a NULL pointer if
      adding the molecule with the given type was unsuccessful.

      .. seealso::

         The following built-in component types are available:

         * :ref:`OELigandInteractionHintComponent <OEBio_OELigandInteractionHintComponent>`
         * :ref:`OEProteinInteractionHintComponent <OEBio_OEProteinInteractionHintComponent>`

   .. ################################################################
      #
      ################################################################

   .. oe:method:: DeleteInteraction

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

         .. oe:api::

            bool DeleteInteraction(const OEInteractionHint* inter)

      .. oe:language:: python

         .. oe:api:: python

            DeleteInteraction(arg2: OEInteractionHint) -> bool

      Deletes the given interaction with the corresponding interaction
      fragments from the :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>`
      object.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: DeleteInteractions

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

         .. oe:api::

            bool DeleteInteractions()

      .. oe:language:: python

         .. oe:api:: python

            DeleteInteractions() -> bool

      Deletes all interactions.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetInteractions

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

         .. oe:api::

            OESystem::OEIterBase<const OEInteractionHint>* GetInteractions() const

      .. oe:language:: python

         .. oe:api:: python

            GetInteractions() -> Iterable[OEInteractionHint]

      Returns an iterator over all of the interactions stored in the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.

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

         .. oe:api::

            OESystem::OEIterBase<const OEInteractionHint>* GetInteractions(const OESystem::OEUnaryPredicate<OEInteractionHint>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            GetInteractions(pred: OEUnaryInteractionHintPred) -> Iterable[OEInteractionHint]

      Returns an iterator over all of the interactions of the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object that
      match the specified interaction predicate.

      .. seealso::

         The following built-in interaction predicates are available:

         * :ref:`OEHasInteractionHint <OEBio_OEHasInteractionHint>`
         * :ref:`OEHasInteractionHintType <OEBio_OEHasInteractionHintType>`
         * :ref:`OEHasResidueInteractionHint <OEBio_OEHasResidueInteractionHint>`

         * :ref:`OEIsCationPiInteractionHint <OEBio_OEIsCationPiInteractionHint>`
         * :ref:`OEIsChelatorInteractionHint <OEBio_OEIsChelatorInteractionHint>`
         * :ref:`OEIsClashInteractionHint <OEBio_OEIsClashInteractionHint>`
         * :ref:`OEIsContactInteractionHint <OEBio_OEIsContactInteractionHint>`
         * :ref:`OEIsCovalentInteractionHint <OEBio_OEIsCovalentInteractionHint>`
         * :ref:`OEIsHalogenBondInteractionHint <OEBio_OEIsHalogenBondInteractionHint>`
         * :ref:`OEIsHBondInteractionHint <OEBio_OEIsHBondInteractionHint>`
         * :ref:`OEIsInterInteractionHint <OEBio_OEIsInterInteractionHint>`
         * :ref:`OEIsIntermolecularCationPiInteractionHint <OEBio_OEIsIntermolecularCationPiInteractionHint>`
         * :ref:`OEIsIntermolecularHalogenBondInteractionHint <OEBio_OEIsIntermolecularHalogenBondInteractionHint>`
         * :ref:`OEIsIntermolecularHBondInteractionHint <OEBio_OEIsIntermolecularHBondInteractionHint>`
         * :ref:`OEIsIntermolecularSaltBridgeInteractionHint <OEBio_OEIsIntermolecularSaltBridgeInteractionHint>`
         * :ref:`OEIsIntermolecularStackingInteractionHint <OEBio_OEIsIntermolecularStackingInteractionHint>`

         * :ref:`OEIsIntraInteractionHint <OEBio_OEIsIntraInteractionHint>`
         * :ref:`OEIsIntramolecularCationPiInteractionHint <OEBio_OEIsIntramolecularCationPiInteractionHint>`
         * :ref:`OEIsIntramolecularChelatorInteractionHint <OEBio_OEIsIntramolecularChelatorInteractionHint>`
         * :ref:`OEIsIntramolecularHalogenBondInteractionHint <OEBio_OEIsIntramolecularHalogenBondInteractionHint>`
         * :ref:`OEIsIntramolecularHBondInteractionHint <OEBio_OEIsIntramolecularHBondInteractionHint>`
         * :ref:`OEIsIntramolecularSaltBridgeInteractionHint <OEBio_OEIsIntramolecularSaltBridgeInteractionHint>`
         * :ref:`OEIsIntramolecularStackingInteractionHint <OEBio_OEIsIntramolecularStackingInteractionHint>`
         * :ref:`OEIsNonIdealHBondInteractionHint <OEBio_OEIsNonIdealHBondInteractionHint>`
         * :ref:`OEIsSaltBridgeInteractionHint <OEBio_OEIsSaltBridgeInteractionHint>`
         * :ref:`OEIsStackingInteractionHint <OEBio_OEIsStackingInteractionHint>`

         * :ref:`OEIsClashingHBondInteractionHint <OEBio_OEIsClashingHBondInteractionHint>`
         * :ref:`OEIsUnpairedInteractionHint <OEBio_OEIsUnpairedInteractionHint>`
         * :ref:`OEIsUnpairedLigandInteractionHint <OEBio_OEIsUnpairedLigandInteractionHint>`
         * :ref:`OEIsUnpairedProteinInteractionHint <OEBio_OEIsUnpairedProteinInteractionHint>`


   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetMolecule

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

         .. oe:api::

            const OEChem::OEMolBase* GetMolecule(const OEInteractionHintComponentTypeBase& itype) const

      .. oe:language:: python

         .. oe:api:: python

            GetMolecule(itype: OEInteractionHintComponentTypeBase) -> OEGraphMol

      Returns the first molecule stored in the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object
      with the given type.

      .. seealso::

         The following built-in component types are available:

         * :ref:`OELigandInteractionHintComponent <OEBio_OELigandInteractionHintComponent>`
         * :ref:`OEProteinInteractionHintComponent <OEBio_OEProteinInteractionHintComponent>`


   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetMolecules

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

         .. oe:api::

            OESystem::OEIterBase<const OEChem::OEMolBase>* GetMolecules() const

      .. oe:language:: python

         .. oe:api:: python

            GetMolecules() -> Iterable[OEMolBase]

      Returns an iterator over all the molecule of the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.

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

         .. oe:api::

            OESystem::OEIterBase<const OEChem::OEMolBase>* GetMolecules(const OEInteractionHintComponentTypeBase& itype) const

      .. oe:language:: python

         .. oe:api:: python

            GetMolecules(itype: OEInteractionHintComponentTypeBase) -> Iterable[OEMolBase]

      Returns an iterator over all the molecule with the given type
      of the :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.

      .. seealso::

         The following built-in component types are available:

         * :ref:`OELigandInteractionHintComponent <OEBio_OELigandInteractionHintComponent>`
         * :ref:`OEProteinInteractionHintComponent <OEBio_OEProteinInteractionHintComponent>`


   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetTitle

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

         .. oe:api::

            const std::string& GetTitle() const

      .. oe:language:: python

         .. oe:api:: python

            GetTitle() -> str

      Returns the 'title' of the :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.


   .. ################################################################
      #
      ################################################################

   .. oe:method:: HasInteraction

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

         .. oe:api::

            bool HasInteraction(const OESystem::OEUnaryPredicate<OEInteractionHint>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            HasInteraction(pred: OEUnaryInteractionHintPred) -> bool

      Returns `true` if there is at least one interaction stored
      in the :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object that
      matches the given predicate.


   .. ################################################################
      #
      ################################################################

   .. oe:method:: IsValid

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

         .. oe:api::

            bool IsValid() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns whether there is at least one molecule that is stored in the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.

      .. seealso::

         * :oe:func:`OEBio::OEIsValidActiveSite` function


   .. ################################################################
      #
      ################################################################

   .. oe:method:: NumFragments

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

         .. oe:api::

            unsigned int NumFragments() const

      .. oe:language:: python

         .. oe:api:: python

            NumFragments() -> int

      Returns the number of fragments stored in the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object


   .. ################################################################
      #
      ################################################################

   .. oe:method:: NumInteractions

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

         .. oe:api::

            unsigned int NumInteractions() const

      .. oe:language:: python

         .. oe:api:: python

            NumInteractions() -> int

      Returns the number of interactions stored in the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.

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

         .. oe:api::

            unsigned NumInteractions(const OESystem::OEUnaryPredicate<OEInteractionHint>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            NumInteractions(pred: OEUnaryInteractionHintPred) -> int

      Returns the number of interactions stored in the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object that satisfies
      the given predicate.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: NumMolecules

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

         .. oe:api::

            unsigned int NumMolecules() const

      .. oe:language:: python

         .. oe:api:: python

            NumMolecules() -> int

      Returns the number of molecules stored in the
      :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object


   .. ################################################################
      #
      ################################################################

   .. oe:method:: SetTitle

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

         .. oe:api::

            void SetTitle(const std::string& title)

      .. oe:language:: python

         .. oe:api:: python

            SetTitle(title: str) -> None

      Sets the 'title' of the :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object.
