.. oe:namespace:: OEProton

.. meta::
   :keywords: OETautomerOptions, TautomerOptions


.. _OEProton_OETautomerOptions:

.. oe:class:: OETautomerOptions

   .. oe:api::

      class OETautomerOptions

   This class is used for setting options during tautomer enumeration
   with :oe:func:`OEProton::OEEnumerateTautomers`.

   By default, :oe:func:`OEProton::OEEnumerateTautomers` will return
   the "canonical" tautomer, regardless of the tautomer submitted to
   the function. This "canonical" tautomer is extremely useful for
   efficient and reliable tautomer cheminformatics, such as database
   searching. The
   :oe:meth:`OEProton::OETautomerOptions::SetRankTautomers` method can
   be used to make :oe:func:`OEProton::OEEnumerateTautomers` generate a
   tautomer more "reasonable" for depiction for chemists.

   .. oe:method:: Constructors

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

         .. oe:api::

            OETautomerOptions(unsigned int maxGenerated = 4096,
                              bool rank = true, bool warts = false,
                              unsigned int level = 0, bool carbonHybrid = true,
                              bool saveStereo = false,
                              unsigned int maxZoneSize = 35,
                              unsigned int maxTautomericAtoms = 70,
                              float maxTime = 120, bool kekule = false,
                              bool clearCoords = false,
                              unsigned int hybridLevel = OEHybridizationLevel::EnolEnamine,
                              unsigned int maxToReturn = 256,
                              unsigned int racemicType = OERacemicType::LocalSampled)

      .. oe:language:: python

         .. oe:api:: python

            OETautomerOptions(maxGenerated: int = 4096, rank: bool = True,
                              warts: bool = False, level: int = 0,
                              carbonHybrid: bool = True,
                              saveStereo: bool = False, maxZoneSize: int = 35,
                              maxTautomericAtoms: int = 70,
                              maxTime: float = 120, kekule: bool = False,
                              clearCoords: bool = False, hybridLevel: int,
                              maxToReturn: int = 256, racemicType: int) -> OETautomerOptions

      Default constructor.

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

         .. oe:api::

            OETautomerOptions(const OETautomerOptions& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OETautomerOptions(rhs: OETautomerOptions) -> OETautomerOptions

      Copy constructor.

   .. oe:method:: GetApplyWarts

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

         .. oe:api::

            bool GetApplyWarts() const

      .. oe:language:: python

         .. oe:api:: python

            GetApplyWarts() -> bool

      Returns setting for warts application of {title}_1, {title}_2, etc., on tautomers.

   .. oe:method:: GetCarbonHybridization

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

         .. oe:api::

            bool GetCarbonHybridization() const

      .. oe:language:: python

         .. oe:api:: python

            GetCarbonHybridization() -> bool

      Returns setting for whether or not carbon hybridization changes
      are allowed.  Allowing sp2-sp3 changes of carbon atoms can
      significantly increase computation time.

   .. oe:method:: GetClearCoordinates

      .. oe:api::

         bool GetClearCoordinates() const

      Returns whether input coordinates are cleared.
      The default value is ``false``.

   .. oe:method:: GetHybridizationLevel

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

         .. oe:api::

            unsigned int GetHybridizationLevel() const

      .. oe:language:: python

         .. oe:api:: python

            GetHybridizationLevel() -> int

      Returns setting for the level of hybridization changes
      allowed when carbon hybridization is allowed.  Allowing carbon hybridization
      significantly increase computation time.
      The returned value is from the :oe:constns:`OEProton::OEHybridizationLevel`
      namespace.

      .. seealso::

         * :oe:constns:`OEProton::OEHybridizationLevel` namespace

   .. oe:method:: GetKekule

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

         .. oe:api::

            bool GetKekule() const

      .. oe:language:: python

         .. oe:api:: python

            GetKekule() -> bool

      Returns setting for whether or not generated tautomers are kekule or have aromaticity perceived.

   .. oe:method:: GetLevel

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

         .. oe:api::

            unsigned int GetLevel() const

      .. oe:language:: python

         .. oe:api:: python

            GetLevel() -> int

      Returns level for tautomerization.  Higher levels allow less
      likely atomic transitions to occur.

   .. oe:method:: GetMaxSearchTime

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

         .. oe:api::

            float GetMaxSearchTime() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxSearchTime() -> float

      Returns the maximum search time in seconds allowed for a molecule.

   .. oe:method:: GetMaxTautomericAtoms

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

         .. oe:api::

            unsigned int GetMaxTautomericAtoms() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxTautomericAtoms() -> int

      Returns the maximum number of tautomeric atoms allowed in a molecule.
      The default value is 70.

   .. oe:method:: GetMaxTautomersGenerated

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

         .. oe:api::

            unsigned int GetMaxTautomersGenerated() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxTautomersGenerated() -> int

      Returns setting for maximum number of tautomers that may be
      generated for each input molecule.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::GetMaxTautomersToReturn` method

   .. oe:method:: GetMaxTautomersToReturn

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

         .. oe:api::

            unsigned int GetMaxTautomersToReturn() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxTautomersToReturn() -> int

      Returns setting for maximum number of tautomers that may be
      returned for each input molecule.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::GetMaxTautomersGenerated` method

   .. oe:method:: GetMaxZoneSize

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

         .. oe:api::

            unsigned int GetMaxZoneSize() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxZoneSize() -> int

      Returns setting for maximum number of atoms allowed in a continuous tautomerization zone.
      The default zone size is 35.

   .. oe:method:: GetRacemicType

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

         .. oe:api::

            unsigned int GetRacemicType() const

      .. oe:language:: python

         .. oe:api:: python

            GetRacemicType() -> int

      Returns setting for the way to handle loss of stereocenters, if the
      :oe:meth:`OEProton::OETautomerOptions::GetSaveStereo` method returns ``false``.
      If the :oe:meth:`OEProton::OETautomerOptions::GetSaveStereo` method returns ``true``,
      this option is irrelevant.
      The returned value is from the :oe:constns:`OEProton::OERacemicType`
      namespace.
      The default value is :oe:const:`OEProton::OERacemicType::LocalSampled`.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::GetSaveStereo` method
         * :oe:constns:`OEProton::OERacemicType` namespace

   .. oe:method:: GetRankTautomers

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

         .. oe:api::

            bool GetRankTautomers() const

      .. oe:language:: python

         .. oe:api:: python

            GetRankTautomers() -> bool

      Returns setting for whether or not tautomers are ranked and
      ordered before being returned. By default, this is ``false``,
      i.e., the canonical tautomer is returned as the first molecule
      in the iterator. As opposed to the most "reasonable" tautomer
      being returned first.

   .. oe:method:: GetSaveStereo

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

         .. oe:api::

            bool GetSaveStereo() const

      .. oe:language:: python

         .. oe:api:: python

            GetSaveStereo() -> bool

      Returns setting for whether atoms and bonds with labeled
      stereochemistry are fixed or allowed to participate in
      tautomerization.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::GetRacemicType` method

.. _OEProton_OETautomerOptions_SetApplyWarts:

   .. oe:method:: SetApplyWarts

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

         .. oe:api::

            void SetApplyWarts(bool warts)

      .. oe:language:: python

         .. oe:api:: python

            SetApplyWarts(warts: bool) -> None

      Sets whether warts of {title}_1, {title}_2, etc., are added to tautomers.

.. _OEProton_OETautomerOptions_SetCarbonHybridization:

   .. oe:method:: SetCarbonHybridization

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

         .. oe:api::

            void SetCarbonHybridization(bool carbonHybrid)

      .. oe:language:: python

         .. oe:api:: python

            SetCarbonHybridization(carbonHybrid: bool) -> None

      Sets whether carbon hybridization changes are allowed.  Allowing
      sp2-sp3 changes of carbon atoms can significantly increase
      computation time.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::SetHybridizationLevel` method

   .. oe:method:: SetClearCoordinates

      .. oe:api::

         bool SetClearCoordinates(bool clear_coordinates)

      Sets whether input coordinates are cleared from generated tautomers.

   .. oe:method:: SetHybridizationLevel

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

         .. oe:api::

            void SetHybridizationLevel(unsigned int level)

      .. oe:language:: python

         .. oe:api:: python

            SetHybridizationLevel(level: int) -> None

      Sets level of hybridization changes allowed for carbon atoms
      if the :oe:meth:`OEProton::OETautomerOptions::GetCarbonHybridization` method returns ``true``.
      If the :oe:meth:`OEProton::OETautomerOptions::GetCarbonHybridization` method returns ``false``,
      this option is irrelevant.

      **level**
         This value has to be from the :oe:constns:`OEProton::OEHybridizationLevel`
         namespace.

      .. note::

         The level of hybridization can have significantly impact on the
         computation time.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::SetCarbonHybridization` method
         * :oe:constns:`OEProton::OEHybridizationLevel` namespace

   .. oe:method:: SetKekule

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

         .. oe:api::

            void SetKekule(bool kekule)

      .. oe:language:: python

         .. oe:api:: python

            SetKekule(kekule: bool) -> None

      Sets whether tautomers are returned in kekule format or have aromaticity perceived.

   .. oe:method:: SetLevel

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

         .. oe:api::

            void SetLevel(unsigned int level)

      .. oe:language:: python

         .. oe:api:: python

            SetLevel(level: int) -> None

      Sets level for tautomerization. Higher levels allow less likely
      atomic transitions to occur.

.. _OEProton_OETautomerOptions_SetMaxSearchTime:

   .. oe:method:: SetMaxSearchTime

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

         .. oe:api::

            void SetMaxSearchTime(float maxSearchTime)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxSearchTime(maxTime: float) -> None

      Sets the maximum search time in seconds allowed for a molecule.

.. _OEProton_OETautomerOptions_SetMaxTautomericAtoms:

   .. oe:method:: SetMaxTautomericAtoms

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

         .. oe:api::

            void SetMaxTautomericAtoms(unsigned int maxTautomerAtoms)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxTautomericAtoms(maxTautomericAtoms: int) -> None

      Sets the maximum number of tautomeric atoms allowed in a molecule.

.. _OEProton_OETautomerOptions_SetMaxTautomersGenerated:

   .. oe:method:: SetMaxTautomersGenerated

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

         .. oe:api::

            void SetMaxTautomersGenerated(unsigned int max)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxTautomersGenerated(max: int) -> None

      Sets the maximum number of tautomers that may be generated per input molecule.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::SetMaxTautomersToReturn` method

.. _OEProton_OETautomerOptions_SetMaxTautomersToReturn:

   .. oe:method:: SetMaxTautomersToReturn

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

         .. oe:api::

            void SetMaxTautomersToReturn(unsigned int max)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxTautomersToReturn(max: int) -> None

      Sets the maximum number of tautomers that may be returned per input molecule.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::SetMaxTautomersGenerated` method

.. _OEProton_OETautomerOptions_SetMaxZoneSize:

   .. oe:method:: SetMaxZoneSize

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

         .. oe:api::

            void SetMaxZoneSize(unsigned int maxZoneSize)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxZoneSize(maxZoneSize: int) -> None

      Sets the maximum number of atoms allowed in a continuous tautomerization zone.

.. _OEProton_OETautomerOptions_SetRacemicType:

   .. oe:method:: SetRacemicType

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

         .. oe:api::

            void SetRacemicType(unsigned int racemicType)

      .. oe:language:: python

         .. oe:api:: python

            SetRacemicType(raceType: int) -> None

      Sets the racemic type for loss of stereocenters if the
      :oe:meth:`OEProton::OETautomerOptions::GetSaveStereo` method returns ``false``.
      If the :oe:meth:`OEProton::OETautomerOptions::GetSaveStereo` method returns ``true``,
      this option is irrelevant.

      **racemicType**
         This value has to be from the :oe:constns:`OEProton::OERacemicType`
         namespace.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::SetSaveStereo` method
         * :oe:constns:`OEProton::OERacemicType` namespace

   .. oe:method:: SetRankTautomers

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

         .. oe:api::

            void SetRankTautomers(bool rank)

      .. oe:language:: python

         .. oe:api:: python

            SetRankTautomers(rank: bool) -> None

      Sets whether or not tautomers are ranked and ordered before
      being returned. Setting this argument to ``true`` will cause the
      most "reasonable" tautomer to be returned as the first tautomer,
      opposed to the "canonical" tautomer being returned first.

      The "canonical" tautomer may or may not be a suitable
      representative tautomer for depiction. To fill this role, the
      :oe:meth:`SetRankTautomers(true) <OEProton::OETautomerOptions::SetRankTautomers>`
      provides "reasonable" tautomer forms for any input molecule.

.. _OEProton_OETautomerOptions_SetSaveStereo:

   .. oe:method:: SetSaveStereo

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

         .. oe:api::

            void SetSaveStereo(bool saveStereo)

      .. oe:language:: python

         .. oe:api:: python

            SetSaveStereo(saveStereo: bool) -> None

      Sets whether atoms and bonds with labeled stereochemistry are fixed or
      allowed to participate in tautomerization.

      .. seealso::

         * :oe:meth:`OEProton::OETautomerOptions::SetRacemicType` method
