.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEBio

.. meta::
   :keywords: OEReceptor, Receptor


.. _OEBio_OEReceptor:

.. oe:class:: OEReceptor

   .. oe:api::

      class OEReceptor

   The :ref:`OEReceptor <OEBio_OEReceptor>` represents a receptor as used in a
   **OEDocking** or **POSIT** calculation.

   The :ref:`OEReceptor <OEBio_OEReceptor>` class defines the following public methods:
    * :oe:meth:`AddProteinConstraint<OEBio::OEReceptor::AddProteinConstraint>`
    * :oe:meth:`Clear<OEBio::OEReceptor::Clear>`
    * :oe:meth:`ClearCustomConstraints<OEBio::OEReceptor::ClearCustomConstraints>`
    * :oe:meth:`ClearProteinConstraint<OEBio::OEReceptor::ClearProteinConstraint>`
    * :oe:meth:`ClearProteinConstraints<OEBio::OEReceptor::ClearProteinConstraints>`
    * :ref:`GetCustomConstraints <OEBio_OEReceptor_GetCustomConstraints>`
    * :oe:meth:`GetInnerContourLevel<OEBio::OEReceptor::GetInnerContourLevel>`
    * :oe:meth:`GetNegativeImageGrid<OEBio::OEReceptor::GetNegativeImageGrid>`
    * :oe:meth:`GetOuterContourLevel<OEBio::OEReceptor::GetOuterContourLevel>`
    * :oe:meth:`GetOuterContourVolume<OEBio::OEReceptor::GetOuterContourVolume>`
    * :oe:meth:`GetInnerContourVolume<OEBio::OEReceptor::GetInnerContourVolume>`
    * :oe:meth:`NumProteinConstraints(<OEBio::OEReceptor::NumProteinConstraints>`
    * :oe:meth:`GetProteinConstraints<OEBio::OEReceptor::GetProteinConstraints>`
    * :oe:meth:`GetTargetMask<OEBio::OEReceptor::GetTargetMask>`
    * :oe:meth:`GetTargetPred<OEBio::OEReceptor::GetTargetPred>`
    * :oe:meth:`IsValid<OEBio::OEReceptor::IsValid>`
    * :oe:meth:`HasCustomConstraints<OEBio::OEReceptor::HasCustomConstraints>`
    * :oe:meth:`HasInnerContourLevel<OEBio::OEReceptor::HasInnerContourLevel>`
    * :oe:meth:`HasNegativeImageGrid<OEBio::OEReceptor::HasNegativeImageGrid>`
    * :oe:meth:`HasOuterContourLevel<OEBio::OEReceptor::HasOuterContourLevel>`
    * :oe:meth:`HasProteinConstraints<OEBio::OEReceptor::HasProteinConstraints>`
    * :oe:meth:`SetCustomConstraints<OEBio::OEReceptor::SetCustomConstraints>`
    * :oe:meth:`SetInnerContourLevel<OEBio::OEReceptor::SetInnerContourLevel>`
    * :oe:meth:`SetOuterContourLevel<OEBio::OEReceptor::SetOuterContourLevel>`


   .. oe:method:: Constructor

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

         .. oe:api::

            OEReceptor()
            OEReceptor(const OEReceptor &)

      .. oe:language:: python

         .. oe:api:: python

            OEReceptor() -> OEReceptor
            OEReceptor(arg2: OEReceptor) -> OEReceptor

   Default and copy constructors.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEReceptor &operator=(const OEReceptor &)

   .. _OEBio_OEReceptor_AddProteinConstraint:

      Assignment operator.


   .. oe:method:: AddProteinConstraint

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

         .. oe:api::

            bool AddProteinConstraint(const OEReceptorProteinConstraint&)

      .. oe:language:: python

         .. oe:api:: python

            AddProteinConstraint(arg2: OEReceptorProteinConstraint) -> bool

      Adds a protein constraint. If the receptor already has a constraint on the specified atom the constraint 
      will be replaced, otherwise a new one will be created.

   .. _OEBio_OEReceptor_Clear:

   .. oe:method:: Clear


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

         .. oe:api::

            bool Clear()

      .. oe:language:: python

         .. oe:api:: python

            Clear() -> bool

      Clear all receptor information from receptor, and makes it an invalid receptor.

   .. _OEBio_OEReceptor_ClearCustomConstraints:


   .. oe:method:: ClearCustomConstraints


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

         .. oe:api::

            bool ClearCustomConstraints()

      .. oe:language:: python

         .. oe:api:: python

            ClearCustomConstraints() -> bool

      Clear all custom constraints from the receptor.
 
    .. _OEBio_OEReceptor_ClearProteinConstraint:


   .. oe:method:: ClearProteinConstraint


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

         .. oe:api::

            bool ClearProteinConstraint(const OEReceptorProteinConstraint*)

      .. oe:language:: python

         .. oe:api:: python

            ClearProteinConstraint(arg2: OEReceptorProteinConstraint) -> bool

      Remove the specified protein constraint from the receptor.

    .. _OEBio_OEReceptor_ClearProteinConstraints:


   .. oe:method:: ClearProteinConstraints


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

         .. oe:api::

            bool ClearProteinConstraints()

      .. oe:language:: python

         .. oe:api:: python

            ClearProteinConstraints() -> bool

      Clear all protein constraint from the receptor.

    .. _OEBio_OEReceptor_GetCustomConstraints:


   .. oe:method:: GetCustomConstraints


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

         .. oe:api::

            const OEReceptorCustomConstraints& GetCustomConstraints() const
            OEReceptorCustomConstraints& GetCustomConstraints()

      .. oe:language:: python

         .. oe:api:: python

            GetCustomConstraints() -> OEReceptorCustomConstraints

      Return a copy of the receptor’s custom constraints.

    .. _OEBio_OEReceptor_GetInnerContourLevel:


   .. oe:method:: GetInnerContourLevel


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

         .. oe:api::

            float GetInnerContourLevel() const

      .. oe:language:: python

         .. oe:api:: python

            GetInnerContourLevel() -> float

      Return the inner contour level of the receptor

    .. _OEBio_OEReceptor_GetNegativeImageGrid:


   .. oe:method:: GetNegativeImageGrid


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

         .. oe:api::

            OESystem::OEGrid<float> GetNegativeImageGrid() const

      .. oe:language:: python

         .. oe:api:: python

            GetNegativeImageGrid() -> OEFloatGrid

      Return a copy of the receptor's negative image potential grid.

    .. _OEBio_OEReceptor_GetOuterContourLevel:


   .. oe:method:: GetOuterContourLevel


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

         .. oe:api::

            float GetOuterContourLevel() const

      .. oe:language:: python

         .. oe:api:: python

            GetOuterContourLevel() -> float

      Return the outer contour level of the receptor

   .. _OEBio_OEReceptor_GetOuterContourVolume:


   .. oe:method:: GetOuterContourVolume


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

         .. oe:api::

            float GetOuterContourVolume() const

      .. oe:language:: python

         .. oe:api:: python

            GetOuterContourVolume() -> float

      Return the volume of the outer contour of the receptor at the set contour level. 
      Will return zero if the contour is not set or has a negative value.

   .. _OEBio_OEReceptor_GetInnerContourVolume:


   .. oe:method:: GetInnerContourVolume


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

         .. oe:api::

            float GetInnerContourVolume() const

      .. oe:language:: python

         .. oe:api:: python

            GetInnerContourVolume() -> float

      Return the volume of the inner contour of the receptor at the set contour level
      Will return zero if the contour is not set or has a negative value.

   .. _OEBio_OEReceptor_NumProteinConstraints:

   .. oe:method:: NumProteinConstraints

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

         .. oe:api::

            unsigned int NumProteinConstraints(bool enabledOnly = true) const

      .. oe:language:: python

         .. oe:api:: python

            NumProteinConstraints(enabledOnly: bool = True) -> int

      Returns the number of :ref:`OEReceptorProteinConstraint <OEBio_OEReceptorProteinConstraint>` objects contained by this
      class.  

      If *enabledOnly* is true then only :ref:`OEReceptorProteinConstraint <OEBio_OEReceptorProteinConstraint>` objects
      for which the method :oe:meth:`OEBio::OEReceptorProteinConstraint::GetEnabled` returns true will
      be counted.

    .. _OEBio_OEReceptor_GetProteinConstraints:


   .. oe:method:: GetProteinConstraints


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

         .. oe:api::

            OESystem::OEIterBase<const OEReceptorProteinConstraint>* GetProteinConstraints(bool enabledOnly = true) const
            OESystem::OEIterBase<OEReceptorProteinConstraint>* GetProteinConstraints(bool enabledOnly = true)

      .. oe:language:: python

         .. oe:api:: python

            GetProteinConstraints(enabledOnly: bool = True) -> Iterable[OEReceptorProteinConstraint]

      Returns an iterator over the receptor’s protein constraints. If ``enabledOnly`` is ``true`` then only 
      enabled constraints will be returned.

    .. _OEBio_OEReceptor_GetTargetMask:


   .. oe:method:: GetTargetMask


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

         .. oe:api::

            unsigned GetTargetMask() const

      .. oe:language:: python

         .. oe:api:: python

            GetTargetMask() -> int

      Return the target mask corresponding to the receptor. The mask and predicate, can be used with
      the :oe:meth:`OEBio::OEDesignUnit::GetComponents` method to generate the molecule used in receptor generation. 

    .. _OEBio_OEReceptor_GetTargetPred:


   .. oe:method:: GetTargetPred


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

         .. oe:api::

            OEBio::OEAtomMatchResidue GetTargetPred() const

      .. oe:language:: python

         .. oe:api:: python

            GetTargetPred() -> OEAtomMatchResidue

      Returns the residue based :ref:`OEAtomMatchResidue <OEBio_OEAtomMatchResidue>` predicate used with the corresponding
      target mask to generate the receptor. The mask and predicate, can be used with the 
      :oe:meth:`OEBio::OEDesignUnit::GetComponents` method to generate the molecule used in receptor generation. 

      .. seealso::

         * :ref:`OEAtomMatchResidue <OEBio_OEAtomMatchResidue>` class
         * :oe:meth:`OEBio::OEDesignUnit::GetComponents` method

    .. _OEBio_OEReceptor_IsValid:


   .. oe:method:: IsValid


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

         .. oe:api::

            bool IsValid() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns if the this is a valid receptor, and ready to be used for **OEDocking** or **POSIT** calculation.

    .. _OEBio_OEReceptor_HasCustomConstraints:


   .. oe:method:: HasCustomConstraints


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

         .. oe:api::

            bool HasCustomConstraints(const bool enabledOnly = true) const

      .. oe:language:: python

         .. oe:api:: python

            HasCustomConstraints(enabledOnly: bool = True) -> bool

      Returns true if receptor has custom constraints. If ``enabledOnly`` is ``true`` then at least one of the 
      constraints must be enabled.

    .. _OEBio_OEReceptor_HasInnerContourLevel:


   .. oe:method:: HasInnerContourLevel


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

         .. oe:api::

            bool HasInnerContourLevel() const

      .. oe:language:: python

         .. oe:api:: python

            HasInnerContourLevel() -> bool

      Returns true if the receptor has an inner contour level set.

    .. _OEBio_OEReceptor_HasNegativeImageGrid:


   .. oe:method:: HasNegativeImageGrid


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

         .. oe:api::

            bool HasNegativeImageGrid() const

      .. oe:language:: python

         .. oe:api:: python

            HasNegativeImageGrid() -> bool

      Returns true if the receptor has negative image potential grid.  A receptor is invalid without
      the negative image potential grid.

    .. _OEBio_OEReceptor_HasOuterContourLevel:


   .. oe:method:: HasOuterContourLevel


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

         .. oe:api::

            bool HasOuterContourLevel() const

      .. oe:language:: python

         .. oe:api:: python

            HasOuterContourLevel() -> bool

      Returns true if the receptor has an outer contour level set.

    .. _OEBio_OEReceptor_HasProteinConstraints:


   .. oe:method:: HasProteinConstraints


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

         .. oe:api::

            bool HasProteinConstraints(const bool enabledOnly = true) const

      .. oe:language:: python

         .. oe:api:: python

            HasProteinConstraints(enabledOnly: bool = True) -> bool

      Returns true if receptor has protein constraints. If ``enabledOnly`` is ``true`` then at least one of the 
      constraints must be enabled.

    .. _OEBio_OEReceptor_SetCustomConstraints:


   .. oe:method:: SetCustomConstraints


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

         .. oe:api::

            bool SetCustomConstraints(const OEReceptorCustomConstraints&)

      .. oe:language:: python

         .. oe:api:: python

            SetCustomConstraints(arg2: OEReceptorCustomConstraints) -> bool

      Set **custom constraints** to the receptor. Returns ``true`` is set. 

    .. _OEBio_OEReceptor_SetInnerContourLevel:


   .. oe:method:: SetInnerContourLevel


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

         .. oe:api::

            bool SetInnerContourLevel(const float level)

      .. oe:language:: python

         .. oe:api:: python

            SetInnerContourLevel(level: float) -> bool

      Set **inner contour level** to the receptor. Returns ``true`` is set. 

    .. _OEBio_OEReceptor_SetOuterContourLevel:


   .. oe:method:: SetOuterContourLevel


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

         .. oe:api::

            bool SetOuterContourLevel(const float level)

      .. oe:language:: python

         .. oe:api:: python

            SetOuterContourLevel(level: float) -> bool

      Set **outer contour level** to the receptor. Returns ``true`` is set.
