.. oe:namespace:: OEChem

.. include:: ../substitutions


.. meta::
   :keywords: OEInChIOptions, InChIOptions


.. _OEChem_OEInChIOptions:

.. oe:class:: OEInChIOptions

   .. oe:api::


      class OEInChIOptions

   This class is used to control the output for the
   :oe:const:`OEChem::OEFormat::INCHI` and
   :oe:const:`OEChem::OEFormat::INCHIKEY` formats. The options have a
   direct mapping between the flavors in the
   :oe:constns:`OEChem::OEOFlavor::INCHI` and
   :oe:constns:`OEChem::OEOFlavor::INCHIKEY`. The options also have a
   direct mapping into the options provided by the InChI library.

   .. seealso::

      * `InChI API Reference`_ documentation
      * `InChI Technical Manual`_ documentation

   .. oe:method:: Constructors

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

         .. oe:api::

            OEInChIOptions(unsigned int flavor = OEOFlavor::INCHI::Default)

      .. oe:language:: python

         .. oe:api:: python

            OEInChIOptions(flavor: int) -> OEInChIOptions

      The default constructor initializes the options class to the
      flavors indicated by the :oe:const:`OEChem::OEOFlavor::INCHI::Default`
      constant.

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

         .. oe:api::

            OEInChIOptions(const OEInChIOptions &)

      .. oe:language:: python

         .. oe:api:: python

            OEInChIOptions(arg2: OEInChIOptions) -> OEInChIOptions

      Copy constructor.

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

      .. oe:api::

         OEInChIOptions &operator=(const OEInChIOptions &rhs)

      Assignment operator. 

   .. oe:method:: GetChiral

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

         .. oe:api::

            bool GetChiral() const

      .. oe:language:: python

         .. oe:api:: python

            GetChiral() -> bool

      Returns a bool stating whether to use absolute stereochemistry.

   .. oe:method:: GetFixedHLayer

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

         .. oe:api::

            bool GetFixedHLayer() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixedHLayer() -> bool

      Returns whether to include the fixed H-layer.

   .. oe:method:: GetHydrogens

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

         .. oe:api::

            bool GetHydrogens() const

      .. oe:language:: python

         .. oe:api:: python

            GetHydrogens() -> bool

      Returns whether to add H according to usual valences.

   .. oe:method:: GetNonPolymerPseudoAtoms

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

         .. oe:api::

            bool GetNonPolymerPseudoAtoms() const

      .. oe:language:: python

         .. oe:api:: python

            GetNonPolymerPseudoAtoms() -> bool

      Returns the state of the flag that allows non-polymer `*atoms` (:oe:const:`OEChem::OEElemNo::Du`) to
      be present in the structure used for :term:`InChI` generation.
      Setting this flag results in a nonstandard :term:`InChI` version.
      By default, no `*atoms` are allowed.  Currently there is no support for polymer InChIs in ``OEChem``.

   .. oe:method:: GetRacemicStereo

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

         .. oe:api::

            bool GetRacemicStereo() const

      .. oe:language:: python

         .. oe:api:: python

            GetRacemicStereo() -> bool

      Returns whether to export all stereo as racemic stereo in the :term:`InChI` string.
      By default, all stereo is exported as absolute stereo.

   .. oe:method:: GetReconnectedMetals

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

         .. oe:api::

            bool GetReconnectedMetals() const

      .. oe:language:: python

         .. oe:api:: python

            GetReconnectedMetals() -> bool

      Returns whether to include reconnected metals.


   .. oe:method:: GetRelativeStereo

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

         .. oe:api::

            bool GetRelativeStereo() const

      .. oe:language:: python

         .. oe:api:: python

            GetRelativeStereo() -> bool

      Returns whether to export all stereo as relative stereo in the :term:`InChI` string.
      By default, all stereo is exported as absolute stereo.


   .. oe:method:: GetStereo

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

         .. oe:api::

            bool GetStereo() const

      .. oe:language:: python

         .. oe:api:: python

            GetStereo() -> bool

      Returns whether the stereo information in the input structure is ignored.

   .. oe:method:: GetTimeout

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

         .. oe:api::

            unsigned int GetTimeout() const

      .. oe:language:: python

         .. oe:api:: python

            GetTimeout() -> int

      Returns the setting for the maximum number of seconds the :term:`InChI` generation is allowed to take.
      By default, a ``60`` second execution limit is used.

   .. oe:method:: GetUndefinedStereo

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

         .. oe:api::

            bool GetUndefinedStereo() const

      .. oe:language:: python

         .. oe:api:: python

            GetUndefinedStereo() -> bool

      Returns the setting that controls explicit undefined stereo annotations in the generated :term:`InChI` identifier.
      Default, ``false``.

   .. oe:method:: SetChiral

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

         .. oe:api::

            void SetChiral(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetChiral(val: bool) -> None

      If set to true, use absolute stereochemistry, else relative
      stereochemistry (corresponds to :term:`InChI` option "ChiralFlagOn").

   .. oe:method:: SetFixedHLayer

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

         .. oe:api::

            void SetFixedHLayer(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetFixedHLayer(val: bool) -> None

      If set to true, do not allow for mobile hydrogens e.g. in
      tautomers (corresponds to :term:`InChI` option "FixedH").

   .. oe:method:: SetHydrogens

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

         .. oe:api::

            void SetHydrogens(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetHydrogens(val: bool) -> None

      If set to true, hydrogens are added according to usual valences
      (corresponds to the inverse of the :term:`InChI` option "DoNotAddH").

   .. oe:method:: SetNonPolymerPseudoAtoms

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

         .. oe:api::

            void SetNonPolymerPseudoAtoms(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetNonPolymerPseudoAtoms(val: bool) -> None

      If set to true, non-polymer `*atoms` (:oe:const:`OEChem::OEElemNo::Du`) are allowed to be present
      in the structure used for :term:`InChI` generation.
      Setting this flag results in a nonstandard :term:`InChI` version.
      By default, no `*atoms` are allowed.  Currently there is no support for polymer InChIs in ``OEChem``.

   .. oe:method:: SetRacemicStereo

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

         .. oe:api::

            void SetRacemicStereo(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetRacemicStereo(val: bool) -> None

      If set to true, export all stereo as racemic stereo (corresponds to
      :term:`InChI` option "SRac").  Enabling the racemic stereo option
      takes precedence over the option setting to disable
      :oe:meth:`OEChem::OEInChIOptions::SetStereo`.

   .. oe:method:: SetReconnectedMetals

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

         .. oe:api::

            void SetReconnectedMetals(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetReconnectedMetals(val: bool) -> None

      If set to true, include reconnected metals (corresponds to
      :term:`InChI` option "RecMet").

   .. oe:method:: SetRelativeStereo

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

         .. oe:api::

            void SetRelativeStereo(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetRelativeStereo(val: bool) -> None

      If set to true, export all stereo as relative stereo (corresponds to
      :term:`InChI` option "SRel").  Enabling the relative stereo option
      takes precedence over other option settings of
      :oe:meth:`OEChem::OEInChIOptions::SetRacemicStereo` or
      (disabled) :oe:meth:`OEChem::OEInChIOptions::SetStereo`.

   .. oe:method:: SetStereo

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

         .. oe:api::

            void SetStereo(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetStereo(val: bool) -> None

      If set to true, stereo information is used from input structure
      (corresponds to the inverse of the :term:`InChI` option "SNon").

   .. oe:method:: SetTimeout

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

         .. oe:api::

            void SetTimeout(unsigned int val)

      .. oe:language:: python

         .. oe:api:: python

            SetTimeout(val: int) -> None

      Sets the :term:`InChI` execution time cutoff to ``val`` seconds.
      Setting a value of ``0`` means unlimited, and by default a ``60`` second limit is used.

   .. oe:method:: SetUndefinedStereo

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

         .. oe:api::

            void SetUndefinedStereo(bool val)

      .. oe:language:: python

         .. oe:api:: python

            SetUndefinedStereo(val: bool) -> None

      If set to true, requests explicit undefined stereo annotations in the generated :term:`InChI` and :term:`InChIKey` identifiers.
      Enabling this flag always results in a nonstandard :term:`InChI`.
