.. oe:namespace:: OEChem



.. meta::
   :keywords: OEParseSmilesOptions, ParseSmilesOptions


.. _OEChem_OEParseSmilesOptions:

.. oe:class:: OEParseSmilesOptions

   .. oe:api::


      class OEParseSmilesOptions

   An class for handling options for the
   :oe:func:`OEChem::OEParseSmiles` function.


   .. oe:method:: Constructors

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

         .. oe:api::

            OEParseSmilesOptions(bool canon = false, bool strict = false,
                                 bool quiet = false, bool cxsmiles = false)

      .. oe:language:: python

         .. oe:api:: python

            OEParseSmilesOptions(canon: bool = False, strict: bool = False,
                                 quiet: bool = False, cxsmiles: bool = False) -> OEParseSmilesOptions

      Initializes the object with the specified options.

   .. oe:method:: GetCanon

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

         .. oe:api::

            bool GetCanon() const

      .. oe:language:: python

         .. oe:api:: python

            GetCanon() -> bool

      A value of ``true`` specifies that the
      :oe:func:`OEChem::OEKekulize` step can be skipped. Defaults to
      ``false``.

   .. oe:method:: GetCXSMILES

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

         .. oe:api::

            bool GetCXSMILES() const

      .. oe:language:: python

         .. oe:api:: python

            GetCXSMILES() -> bool

      A value of ``true`` specifies that a :term:`CXSMILES` formatted
      appendix is allowed to be present in the parse string, and extra checking
      will be employed to capture any enhanced stereogroup information therein.
      A value of ``false`` results in a :term:`CXSMILES` appendix being
      ignored and retained as part of the molecule title. Defaults to ``false``.

      .. warning::

         Unparsed :term:`CXSMILES` appendix information captured in the molecule title
         will generally be corrupt after regeneration of :term:`SMILES` information.

   .. oe:method:: GetStrict

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

         .. oe:api::

            bool GetStrict() const

      .. oe:language:: python

         .. oe:api:: python

            GetStrict() -> bool

      A value of ``true`` specifies that the
      :oe:func:`OEChem::OEParseSmiles` will apply more rigorous sanity
      checks on the parsed :term:`SMILES` string. Defaults to
      ``false``.

   .. oe:method:: GetQuiet

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

         .. oe:api::

            bool GetQuiet() const

      .. oe:language:: python

         .. oe:api:: python

            GetQuiet() -> bool

      A value of ``true`` specifies that there will be no output
      written to :oe:constns:`OESystem::OEThrow` if
      :oe:func:`OEChem::OEParseSmiles` fails to parse the
      string. Defaults to ``false``.

   .. oe:method:: SetCanon

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

         .. oe:api::

            void SetCanon(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetCanon(c: bool) -> None

      This setting can be used to circumvent the post-processing
      kekulization test of :oe:func:`OEChem::OEParseSmiles`.  Passing a
      boolean ``true`` value to this argument indicates to the parser
      that the :term:`SMILES` string should be assumed to be
      well-formed and the usual kekulization (by calling
      :oe:func:`OEChem::OEKekulize`) step may be omitted.  This can be
      used to speed-up parsing of a large database, but has the
      side-effect that bond orders are not correctly assigned for
      aromatic molecules.

   .. oe:method:: SetCXSMILES

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

         .. oe:api::

            void SetCXSMILES(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetCXSMILES(ste: bool) -> None

      Setting a value of ``true`` specifies that a :term:`CXSMILES` formatted
      appendix is allowed to be present in the parse string, and extra checking
      should be employed to capture any enhanced stereogroup information therein.
      Setting a value of ``false`` results in a :term:`CXSMILES` appendix being
      ignored and captured as part of the molecule title.

   .. oe:method:: SetStrict

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

         .. oe:api::

            void SetStrict(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetStrict(s: bool) -> None

      This setting controls whether :oe:func:`OEChem::OEParseSmiles`
      should operate in strict mode.  By default, the :term:`SMILES`
      parser attempts to process any reasonably formed :term:`SMILES`
      string.  If this setting is ``true``, the parser applies more
      rigorous sanity checking.  For example, the :term:`SMILES`
      ``C==C`` is accepted by the default non-strict parser, but
      rejected by the strict parser.

   .. oe:method:: SetQuiet

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

         .. oe:api::

            void SetQuiet(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetQuiet(q: bool) -> None

      This setting can be used to force
      :oe:func:`OEChem::OEParseSmiles` to not write anything to
      :oe:constns:`OESystem::OEThrow` in the case of a failure. This can
      be useful for programs that want to determine if a string is a
      valid :term:`SMILES` string without spewing unnecessary logging
      information to the terminal.
