.. oe:namespace:: OEMedChem


.. meta::
   :keywords: OEMatchedPairTransform, MatchedPairTransform


.. _OEMedChem_OEMatchedPairTransform:

.. oe:class:: OEMatchedPairTransform

   .. oe:api::

      class OEMatchedPairTransform

   This class embodies a unique transformation that relates one or more matched molecular pairs.

   .. oe:method:: Constructors

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

         .. oe:api::

            OEMatchedPairTransform()
            OEMatchedPairTransform(const OEMatchedPairTransform& rhs)
            OEMatchedPairTransform(const std::string& xformString,
                                   int context = OEMatchedPairContext::Default)
            OEMatchedPairTransform(const std::string& ForwardXForm,
                                   const std::string& ReverseXForm,
                                   int context = OEMatchedPairContext::Default)

      .. oe:language:: python

         .. oe:api:: python

            OEMatchedPairTransform() -> OEMatchedPairTransform
            OEMatchedPairTransform(xformstr: str, context: int) -> OEMatchedPairTransform
            OEMatchedPairTransform(ForwardXForm: str, ReverseXForm: str,
                                   context: int) -> OEMatchedPairTransform
            OEMatchedPairTransform(rhs: OEMatchedPairTransform) -> OEMatchedPairTransform

      Constructs an object from the passed arguments.

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

      .. oe:api::

         OEMatchedPairTransform &operator=(const OEMatchedPairTransform &rhs)

      Assignment operator that copies the data of the 'rhs' :ref:`OEMatchedPairTransform <OEMedChem_OEMatchedPairTransform>` object.

      Assignment operator.


   .. oe:method:: AddMatchedPair

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

         .. oe:api::

            bool AddMatchedPair(const OEMatchedPair& mmp)
            bool AddMatchedPair(unsigned int fromIndex,
                                const std::string& fromSmiles,
                                unsigned int toIndex,
                                const std::string& toSmiles)

      .. oe:language:: python

         .. oe:api:: python

            AddMatchedPair(molpair: OEMatchedPair) -> bool
            AddMatchedPair(fromIndex: int, fromSmiles: str, toIndex: int,
                           toSmiles: str) -> bool

      This method links a specific from and to structure to the transform.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEMatchedPairTransform* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEMatchedPairTransform

   .. oe:method:: GetMatchedPairContext

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

         .. oe:api::

            int GetMatchedPairContext() const

      .. oe:language:: python

         .. oe:api:: python

            GetMatchedPairContext() -> int

      Returns the chemistry context type for the transformation.

      .. seealso::

         * :oe:constns:`OEMedChem::OEMatchedPairContext`

   .. oe:method:: GetMatchedPairs

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

         .. oe:api::

            OESystem::OEIterBase<OEMatchedPair>* GetMatchedPairs() const
            OESystem::OEIterBase<OEMatchedPair>* GetMatchedPairs(unsigned int fromORtoIndex) const
            OESystem::OEIterBase<OEMatchedPair>* GetMatchedPairs(unsigned int fromIndex,
                                                                 unsigned int toIndex) const

      .. oe:language:: python

         .. oe:api:: python

            GetMatchedPairs() -> Iterable[OEMatchedPair]
            GetMatchedPairs(FromOrToIndex: int) -> Iterable[OEMatchedPair]
            GetMatchedPairs(fromIndex: int, toIndex: int) -> Iterable[OEMatchedPair]

      Returns an iterator of the all the matched pairs associated with this transformation, or restricts the returned
      matched pairs that meeting the from or to index constraint.

      .. seealso::

         * :ref:`OEMatchedPair <OEMedChem_OEMatchedPair>`

   .. oe:method:: GetMolecule

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

         .. oe:api::

            bool GetMolecule(unsigned int index, std::string& molsmi) const
            std::string GetMolecule(unsigned int index) const

      .. oe:language:: python

         .. oe:api:: python

            GetMolecule(molindex: int) -> str

      This method retrieves the molecule of the specified molecule id from the transform.

   .. oe:method:: GetMoleculeTitle

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

         .. oe:api::

            bool GetMoleculeTitle(unsigned int molindex, std::string& name) const
            std::string GetMoleculeTitle(unsigned int molindex) const

      .. oe:language:: python

         .. oe:api:: python

            GetMoleculeTitle(molindex: int) -> str

      This method returns a molecule title for the passed molecule index.

   .. oe:method:: GetTransform

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

         .. oe:api::

            const std::string& GetTransform() const

      .. oe:language:: python

         .. oe:api:: python

            GetTransform() -> str

      Returns the reaction transformation string that can be used to instantiate a OEUniMolecularRxn object.

   .. oe:method:: HasMatchedPair

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

         .. oe:api::

            bool HasMatchedPair(unsigned int FromOrToIndex) const
            bool HasMatchedPair(unsigned int fromIndex, unsigned int toIndex) const

      .. oe:language:: python

         .. oe:api:: python

            HasMatchedPair(FromOrToIndex: int) -> bool
            HasMatchedPair(fromIndex: int, toIndex: int) -> bool

      Returns a boolean to indicate if the specific molecule pair is registered with this transformation.

   .. oe:method:: Invert

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

         .. oe:api::

            bool Invert()

      .. oe:language:: python

         .. oe:api:: python

            Invert() -> bool

      Reverses the direction of the transform and the matched pair information for the transformation.

      .. warning::

         If the transform was extracted with SMART query qualifiers for use in molecule transformation activities,
         the inversion of the transform will result in the query features moved to the product side of the reaction.
         Inverting transformations is only meaningful when using the :oe:const:`OEMedChem::OEMatchedPairTransformExtractMode::NoSMARTS`
         extraction option.

   .. oe:method:: NumMatchedPairs

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

         .. oe:api::

            unsigned int NumMatchedPairs() const

      .. oe:language:: python

         .. oe:api:: python

            NumMatchedPairs() -> int

      Returns a count of the number of matched molecular pairs registered with this transformation.

   .. oe:method:: SetMoleculeTitle

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

         .. oe:api::

            bool SetMoleculeTitle(unsigned int index, const std::string& name)

      .. oe:language:: python

         .. oe:api:: python

            SetMoleculeTitle(molindex: int, name: str) -> bool

      This method set the molecule title for the passed molecule index.

   .. oe:method:: SetTransform

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

         .. oe:api::

            bool SetTransform(const std::string& xform,
                              int context = OEMatchedPairContext::Default)
            bool SetTransform(const std::string& ForwardXForm,
                              const std::string& ReverseXForm,
                              int context = OEMatchedPairContext::Default)

      .. oe:language:: python

         .. oe:api:: python

            SetTransform(xform: str, context: int) -> bool
            SetTransform(ForwardXForm: str, ReverseXForm: str, context: int) -> bool

      Sets the internal reaction transformation string.

