.. oe:namespace:: OEChem

.. oe:constnamespace:: OEExprOpts

   Pattern matching in **OEChem TK** is always done using query molecules or
   query graphs (:ref:`OEQMolBase <OEChem_OEQMolBase>`).
   Non-query molecules, *i.e.* those that are defined by :ref:`OEMolBase <OEChem_OEMolBase>`
   abstract base-class must be converted into a query molecule before using
   them in pattern matching algorithms (:ref:`OESubSearch <OEChem_OESubSearch>`,
   :ref:`OEMCSSearch <OEChem_OEMCSSearch>` or :ref:`OECliqueSearch <OEChem_OECliqueSearch>`).

   The :oe:constns:`OEChem::OEExprOpts` namespace contains expression options
   that control the conversion into query molecules.

   .. seealso::

      * :oe:meth:`OEChem::OESubSearch::Init` method
      * :oe:meth:`OEChem::OEMCSSearch::Init` method
      * :oe:meth:`OEChem::OEQMolBase::BuildExpressions` method

   The :oe:constns:`OEChem::OEExprOpts` namespace contains both atom and bond
   expressions options.
   Some options such as :oe:const:`OEChem::OEExprOpts::Aromaticity` can be used
   both as an atom or a bond expression.

   .. list-table:: **Atom and bond expression options**
      :widths: 80 50 50 100
      :header-rows: 1

      * - Constant name
        - Atom expression
        - Bond expression
        - Should be used with

      * - :oe:const:`Aromaticity<OEChem::OEExprOpts::Aromaticity>`
        - **X**
        - **X**
        -

      * - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`
        - **X**
        -
        -

      * - :oe:const:`BondOrder<OEChem::OEExprOpts::BondOrder>`
        -
        - **X**
        -

      * - :oe:const:`Chiral<OEChem::OEExprOpts::Chiral>`
        - **X**
        - **X**
        -

      * - :oe:const:`Degree<OEChem::OEExprOpts::Degree>`
        - **X**
        -
        -

      * - :oe:const:`EqAromatic<OEChem::OEExprOpts::EqAromatic>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqCAliphaticONS<OEChem::OEExprOpts::EqCAliphaticONS>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqCHalogen<OEChem::OEExprOpts::EqCHalogen>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqCPSAcidRoot<OEChem::OEExprOpts::EqCPSAcidRoot>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqDoubleTriple<OEChem::OEExprOpts::EqDoubleTriple>`
        -
        - **X**
        - :oe:const:`BondOrder<OEChem::OEExprOpts::BondOrder>`

      * - :oe:const:`EqHalogen<OEChem::OEExprOpts::EqHalogen>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqKetoneSulfoneRoot<OEChem::OEExprOpts::EqKetoneSulfoneRoot>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqMetal<OEChem::OEExprOpts::EqMetal>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqNotAromatic<OEChem::OEExprOpts::EqNotAromatic>`
        - **X**
        - **X**
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>` or :oe:const:`BondOrder<OEChem::OEExprOpts::BondOrder>`

      * - :oe:const:`EqON<OEChem::OEExprOpts::EqON>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqONS<OEChem::OEExprOpts::EqONS>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqPS<OEChem::OEExprOpts::EqPS>`
        - **X**
        -
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>`

      * - :oe:const:`EqSingleDouble<OEChem::OEExprOpts::EqSingleDouble>`
        -
        - **X**
        - :oe:const:`BondOrder<OEChem::OEExprOpts::BondOrder>`

      * - :oe:const:`ExplicitDegree<OEChem::OEExprOpts::ExplicitDegree>`
        - **X**
        -
        -

      * - :oe:const:`FormalCharge<OEChem::OEExprOpts::FormalCharge>`
        - **X**
        -
        -

      * - :oe:const:`HCount<OEChem::OEExprOpts::HCount>`
        - **X**
        -
        -

      * - :oe:const:`HvyDegree<OEChem::OEExprOpts::HvyDegree>`
        - **X**
        -
        -

      * - :oe:const:`Hybridization<OEChem::OEExprOpts::Hybridization>`
        - **X**
        -
        -

      * - :oe:const:`ImplicitHCount<OEChem::OEExprOpts::ImplicitHCount>`
        - **X**
        -
        -

      * - :oe:const:`IntType<OEChem::OEExprOpts::IntType>`
        - **X**
        - **X**
        -

      * - :oe:const:`Mass<OEChem::OEExprOpts::Mass>`
        - **X**
        -
        -

      * - :oe:const:`RingMember<OEChem::OEExprOpts::RingMember>`
        - **X**
        - **X**
        -

      * - :oe:const:`StrictFormalCharge<OEChem::OEExprOpts::StrictFormalCharge>`
        - **X**
        -
        -

      * - :oe:const:`StringType<OEChem::OEExprOpts::StringType>`
        - **X**
        - **X**
        -

      * - :oe:const:`SymmetryClass<OEChem::OEExprOpts::SymmetryClass>`
        - **X**
        - **X**
        -

      * - :oe:const:`Valence<OEChem::OEExprOpts::Valence>`
        - **X**
        -
        -

   The :oe:constns:`OEChem::OEExprOpts` namespace also contains some predefined atom and bonds
   expression combinations listed in the table below.

   .. list-table:: **Predefined atom and bond expression combinations**
      :widths: 60 340
      :header-rows: 1

      * - Constant name
        - Combination of expression flags

      * - :oe:const:`AutomorphAtoms<OEChem::OEExprOpts::AutomorphAtoms>`
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>` | :oe:const:`Aromaticity<OEChem::OEExprOpts::Aromaticity>` | :oe:const:`RingMember<OEChem::OEExprOpts::RingMember>` | :oe:const:`HvyDegree<OEChem::OEExprOpts::HvyDegree>`
      * - :oe:const:`AutomorphBonds<OEChem::OEExprOpts::AutomorphBonds>`
        - :oe:const:`Aromaticity<OEChem::OEExprOpts::Aromaticity>`

      * - :oe:const:`DefaultAtoms<OEChem::OEExprOpts::DefaultAtoms>`
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>` | :oe:const:`Aromaticity<OEChem::OEExprOpts::Aromaticity>` | :oe:const:`FormalCharge<OEChem::OEExprOpts::FormalCharge>`
      * - :oe:const:`DefaultBonds<OEChem::OEExprOpts::DefaultBonds>`
        - :oe:const:`BondOrder<OEChem::OEExprOpts::BondOrder>` | :oe:const:`Aromaticity<OEChem::OEExprOpts::Aromaticity>`

      * - :oe:const:`ExactAtoms<OEChem::OEExprOpts::ExactAtoms>`
        - :oe:const:`AtomicNumber<OEChem::OEExprOpts::AtomicNumber>` | :oe:const:`Aromaticity<OEChem::OEExprOpts::Aromaticity>` | :oe:const:`StrictFormalCharge<OEChem::OEExprOpts::StrictFormalCharge>` | :oe:const:`Degree<OEChem::OEExprOpts::Degree>` | :oe:const:`HCount<OEChem::OEExprOpts::HCount>` | :oe:const:`Chiral<OEChem::OEExprOpts::Chiral>` | :oe:const:`Mass<OEChem::OEExprOpts::Mass>` | :oe:const:`RingMember<OEChem::OEExprOpts::RingMember>`
      * - :oe:const:`ExactBonds<OEChem::OEExprOpts::ExactBonds>`
        - :oe:const:`BondOrder<OEChem::OEExprOpts::BondOrder>` | :oe:const:`Aromaticity<OEChem::OEExprOpts::Aromaticity>` | :oe:const:`Chiral<OEChem::OEExprOpts::Chiral>` | :oe:const:`RingMember<OEChem::OEExprOpts::RingMember>`

   .. ################################################################
      #
      ################################################################

   .. oe:constant:: Aromaticity

      The :oe:const:`OEChem::OEExprOpts::Aromaticity` flag can be used both
      as atom and bond expression option.

      * When using this option as an atom expression option, atoms are
        considered equivalent if the :oe:meth:`OEChem::OEAtomBase::IsAromatic`
        method returns the same value for them.

      * When using this option as a bond expression option, bonds are
        considered equivalent if the :oe:meth:`OEChem::OEBondBase::IsAromatic`
        method returns the same value for them.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::Aromaticity` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotAromaticity.*
           - .. image:: ../images/OEExprOpts_OESubSearch_Aromaticity.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::Aromaticity` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotAromaticity.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_Aromaticity.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: AtomicNumber

      The :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetAtomicNum` method returns the
      same value for them.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::AtomicNumber` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotAtomicNumber.*
           - .. image:: ../images/OEExprOpts_OESubSearch_AtomicNumber.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::AtomicNumber` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotAtomicNumber.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_AtomicNumber.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: AutomorphAtoms

      This constant along with :oe:const:`OEChem::OEExprOpts::AutomorphBonds`
      is used when determining automorphism related graphs
      :oe:const:`OEChem::OEExprOpts::AutomorphAtoms` is the combination of the
      following atom expression constants:

      * :oe:const:`OEChem::OEExprOpts::AtomicNumber`
      * :oe:const:`OEChem::OEExprOpts::Aromaticity`
      * :oe:const:`OEChem::OEExprOpts::RingMember`
      * :oe:const:`OEChem::OEExprOpts::HvyDegree`

   .. oe:constant:: AutomorphBonds

      This constant along with :oe:const:`OEChem::OEExprOpts::AutomorphAtoms`
      is used when determining automorphism related graphs.
      :oe:const:`OEChem::OEExprOpts::AutomorphBonds` is equivalent to the
      :oe:const:`OEChem::OEExprOpts::Aromaticity` constant.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: BondOrder

      The :oe:const:`OEChem::OEExprOpts::BondOrder` flag can be used
      as a bond expression option.
      When using this option, bonds are considered equivalent if the
      :oe:meth:`OEChem::OEBondBase::GetOrder` method returns the
      same value for them.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::BondOrder` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotBondOrder.*
           - .. image:: ../images/OEExprOpts_OESubSearch_BondOrder.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::BondOrder` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotBondOrder.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_BondOrder.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: DefaultAtoms

      This constant along with :oe:const:`OEChem::OEExprOpts::DefaultBonds`
      is used when a moderate degree of discrimination is required
      of the graph equivalence.
      :oe:const:`OEChem::OEExprOpts::DefaultAtoms` is the combination of
      the following atom expression constants:

      * :oe:const:`OEChem::OEExprOpts::AtomicNumber`
      * :oe:const:`OEChem::OEExprOpts::Aromaticity`
      * :oe:const:`OEChem::OEExprOpts::FormalCharge`

      This combination of flags is intended to give a moderate
      degree of discrimination of the graph equivalence of atoms.
      Accordingly, two atoms are considered equivalent if they
      have the same element, aromaticity value and formal charge.

   .. oe:constant:: DefaultBonds

      :oe:const:`OEChem::OEExprOpts::DefaultBonds` is the combination of the
      following bond expression constants:

      * :oe:const:`OEChem::OEExprOpts::BondOrder`
      * :oe:const:`OEChem::OEExprOpts::Aromaticity`

      This combination of flags is intended to give a moderate
      degree of discrimination of the graph equivalence of bonds.
      Accordingly, two bonds are considered equivalent if they
      have the same bond order and aromaticity value.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: Chiral

      The :oe:const:`OEChem::OEExprOpts::Chiral` flag can be used both
      as atom and bond expression option.

      * When using this option as an atom expression option, if the query atom
        has specified tetrahedral configuration, than it can only be
        mapped to an atom with the same stereo configuration.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::Chiral` **atom option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotChiralAtom.*
           - .. image:: ../images/OEExprOpts_OESubSearch_ChiralAtom.*

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::Chiral` is not available
         as an atom expression option in maximum common substructure
         search (:ref:`OEMCSSearch <OEChem_OEMCSSearch>`) and clique search
         (:ref:`OECliqueSearch <OEChem_OECliqueSearch>`).

      * When using this option as a bond expression option, if the query bond
        has specified cis/trans configuration, than it can only be
        mapped to a bond with the same stereo configuration.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::Chiral` **atom option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotChiralBond.*
           - .. image:: ../images/OEExprOpts_OESubSearch_ChiralBond.*

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::Chiral` is not available
         as a bond expression option in maximum common substructure
         search (:ref:`OEMCSSearch <OEChem_OEMCSSearch>`) and clique search
         (:ref:`OECliqueSearch <OEChem_OECliqueSearch>`).

   .. ################################################################
      #
      ################################################################

   .. oe:constant:: Degree

      The :oe:const:`OEChem::OEExprOpts::Degree` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetDegree` method returns the
      same value for them.

      .. hint::

         The :oe:meth:`OEChem::OEAtomBase::GetDegree` method returns the total
         degree including the contribution from implicit hydrogens.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqAromatic

      The :oe:const:`OEChem::OEExprOpts::EqAromatic` flag can be used
      as an atom expression option.
      When using this option, aromatic atoms are considered equivalent
      regardless of their atomic number.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqAromatic` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqAromatic` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotEqAromatic.*
           - .. image:: ../images/OEExprOpts_OESubSearch_EqAromatic.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqAromatic` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotEqAromatic.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_EqAromatic.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqCAliphaticONS

      The :oe:const:`OEChem::OEExprOpts::EqCAliphaticONS` flag can be used
      as an atom expression option.
      When using this option, aliphatic query carbon atoms are considered equivalent
      with aliphatic oxygen, nitrogen, or sulfur atoms.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqCAliphaticONS` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqCAliphaticONS` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotEqCAliphaticONS.*
           - .. image:: ../images/OEExprOpts_OESubSearch_EqCAliphaticONS.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqCAliphaticONS` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotEqCAliphaticONS.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_EqCAliphaticONS.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqCHalogen

      The :oe:const:`OEChem::OEExprOpts::EqCHalogen` flag can be used
      as an atom expression option.
      When using this option, carbons are considered equivalent
      with halogen atoms.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqCHalogen` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqCPSAcidRoot

      The :oe:const:`OEChem::OEExprOpts::EqCPSAcidRoot` flag can be used
      as an atom expression option.
      When using this option, query atoms which are the central atom of a carboxylic,
      phosphonic, or sulfonic acid moiety are equivalent to a
      potential match atom which is also the central atom of a
      carboxylic, phosphonic, or sulfonic moiety.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqCPSAcidRoot` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqDoubleTriple

      The :oe:const:`OEChem::OEExprOpts::EqDoubleTriple` flag can be used
      as a bond expression option.
      When using this option, double and triple bonds are considered equivalent.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqDoubleTriple` should always be used
         with the :oe:const:`OEChem::OEExprOpts::BondOrder` flag.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqDoubleTriple` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotEqDoubleTriple.*
           - .. image:: ../images/OEExprOpts_OESubSearch_EqDoubleTriple.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqDoubleTriple` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotEqDoubleTriple.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_EqDoubleTriple.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqHalogen

      The :oe:const:`OEChem::OEExprOpts::EqHalogen` flag can be used
      as an atom expression option.
      When using this option, halide atoms (:oe:const:`OEChem::OEElemNo::F`,
      :oe:const:`OEChem::OEElemNo::Cl`, :oe:const:`OEChem::OEElemNo::Br`,
      and :oe:const:`OEChem::OEElemNo::I`) are considered equivalent.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqHalogen` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqHalogen` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotEqHalogen.*
           - .. image:: ../images/OEExprOpts_OESubSearch_EqHalogen.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqHalogen` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotEqHalogen.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_EqHalogen.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqKetoneSulfoneRoot

      The :oe:const:`OEChem::OEExprOpts::EqKetoneSulfoneRoot` flag can be used
      as an atom expression option.
      When using this option, query atoms
      which are the central atom of a ketone or sulfone moiety are
      equivalent to a potential match atom which is also the central
      atom of a ketone or sulfone moiety.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqKetoneSulfoneRoot` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqMetal

      The :oe:const:`OEChem::OEExprOpts::EqMetal` flag can be used
      as an atom expression option.
      When using this option, metal atoms are considered equivalent.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqMetal` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqNotAromatic

      The :oe:const:`OEChem::OEExprOpts::EqNotAromatic` flag can be used both
      as atom and bond expression option.

      * When using this option as an atom expression option, aliphatic
        atoms are considered equivalent regardless of their atomic number.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqNotAromatic` **atom option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotEqNotAromaticAtom.*
           - .. image:: ../images/OEExprOpts_OESubSearch_EqNotAromaticAtom.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqNotAromatic` **atom option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotEqNotAromaticAtom.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_EqNotAromaticAtom.*

      * When using this option as a bond expression option, aliphatic
        bonds are considered equivalent regardless of their bond order.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqNotAromatic` **bond option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotEqNotAromaticBond.*
           - .. image:: ../images/OEExprOpts_OESubSearch_EqNotAromaticBond.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqNotAromatic` **bond option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotEqNotAromaticBond.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_EqNotAromaticBond.*

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqNotAromatic` should always be used
         with either the :oe:const:`OEChem::OEExprOpts::AtomicNumber` or
         the :oe:const:`OEChem::OEExprOpts::BondOrder` flag.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqON

      The :oe:const:`OEChem::OEExprOpts::EqON` flag can be used
      as an atom expression option.
      When using this option, nitrogen and oxygen atoms are considered equivalent.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqON` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqONS

      The :oe:const:`OEChem::OEExprOpts::EqONS` flag can be used
      as an atom expression option.
      When using this option, nitrogen, oxygen and sulfur atoms
      are considered equivalent.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqONS` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqPS

      The :oe:const:`OEChem::OEExprOpts::EqPS` flag can be used
      as an atom expression option.
      When using this option, phosphorus and sulfur atoms
      are considered equivalent.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqPS` should always be used
         with the :oe:const:`OEChem::OEExprOpts::AtomicNumber` flag.

   .. ################################################################
      #
      ################################################################

   .. oe:constant:: EqSingleDouble

      The :oe:const:`OEChem::OEExprOpts::EqSingleDouble` flag can be used
      as a bond expression option.
      When using this option, single and double bonds and are considered equivalent.

      .. warning::

         The :oe:const:`OEChem::OEExprOpts::EqSingleDouble` should always be used
         with the :oe:const:`OEChem::OEExprOpts::BondOrder` flag.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqSingleDouble` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotEqSingleDouble.*
           - .. image:: ../images/OEExprOpts_OESubSearch_EqSingleDouble.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::EqSingleDouble` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotEqSingleDouble.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_EqSingleDouble.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: ExactAtoms

      :oe:const:`OEChem::OEExprOpts::ExactAtoms` is the combination of the
      following bond expression constants:

      * :oe:const:`OEChem::OEExprOpts::AtomicNumber`
      * :oe:const:`OEChem::OEExprOpts::Aromaticity`
      * :oe:const:`OEChem::OEExprOpts::StrictFormalCharge`
      * :oe:const:`OEChem::OEExprOpts::Degree`
      * :oe:const:`OEChem::OEExprOpts::HCount`
      * :oe:const:`OEChem::OEExprOpts::Chiral`
      * :oe:const:`OEChem::OEExprOpts::Mass`
      * :oe:const:`OEChem::OEExprOpts::RingMember`

      This combination of flags is intended to give a high
      degree of discrimination of the graph equivalence of atoms.

   .. oe:constant:: ExactBonds

      :oe:const:`OEChem::OEExprOpts::ExactBonds` is the combination of the
      following bond expression constants:

      * :oe:const:`OEChem::OEExprOpts::BondOrder`
      * :oe:const:`OEChem::OEExprOpts::Aromaticity`
      * :oe:const:`OEChem::OEExprOpts::Chiral`
      * :oe:const:`OEChem::OEExprOpts::RingMember`

      This combination of flags is intended to give a high
      degree of discrimination of the graph equivalence of bonds.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: ExplicitDegree

      The :oe:const:`OEChem::OEExprOpts::ExplicitDegree` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetHvyDegree` method returns the
      same value for them.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: FormalCharge

      The :oe:const:`OEChem::OEExprOpts::FormalCharge` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetFormalCharge` method returns the
      same value for them **and** the query atom has a non-zero charge.
      If you want to consider zero charges see option
      :oe:const:`OEChem::OEExprOpts::StrictFormalCharge`.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::FormalCharge` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotFormalCharge.*
           - .. image:: ../images/OEExprOpts_OESubSearch_FormalCharge.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::FormalCharge` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotFormalCharge.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_FormalCharge.*

      .. seealso::

         * :oe:const:`OEChem::OEExprOpts::StrictFormalCharge` constants


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: HCount

      The :oe:const:`OEChem::OEExprOpts::HCount` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetTotalHCount` method returns the
      same value for them.

      .. hint::

         The :oe:meth:`OEChem::OEAtomBase::GetTotalHCount` method returns
         the number of explicit and implicit hydrogens i.e.
         the expression built when the :oe:const:`OEChem::OEExprOpts::HCount`
         flag is set will therefore not discriminate between implicit and
         explicit hydrogen counts.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: HvyDegree

      The :oe:const:`OEChem::OEExprOpts::HvyDegree` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetHvyDegree` method returns the
      same value for them.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: Hybridization

      The :oe:const:`OEChem::OEExprOpts::Hybridization` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetHyb` method returns the
      same value for them.

      .. warning::

         Hybridization of the molecules must be perceived by calling
         the :oe:func:`OEChem::OEAssignHybridization` function.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: ImplicitHCount

      The :oe:const:`OEChem::OEExprOpts::ImplicitHCount` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetImplicitHCount` method returns the
      same value for them.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: IntType

      The :oe:const:`OEChem::OEExprOpts::IntType` flag can be used both
      as atom and bond expression option.

      * When using this option as an atom expression option,
        atoms are considered equivalent if the
        :oe:meth:`OEChem::OEAtomBase::GetIntType` method returns the
        same value for them.

      * When using this option as a bond expression option,
        bonds are considered equivalent if the
        :oe:meth:`OEChem::OEBondBase::GetIntType` method returns the
        same value for them.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: Mass

      The :oe:const:`OEChem::OEExprOpts::Mass` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetIsotope` method returns the
      same value for them.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: RingMember

      The :oe:const:`OEChem::OEExprOpts::RingMember` flag can be used both
      as atom and bond expression option.

      * When using this option as an atom expression option,
        atoms are considered equivalent if the
        :oe:meth:`OEChem::OEAtomBase::IsInRing` method returns the
        same value for them.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::RingMember` **atom option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotRingMemberAtom.*
           - .. image:: ../images/OEExprOpts_OESubSearch_RingMemberAtom.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::RingMember` **atom option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotRingMemberAtom.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_RingMemberAtom.*

      * When using this option as a bond expression option,
        bonds are considered equivalent if the
        :oe:meth:`OEChem::OEBondBase::IsInRing` method returns the
        same value for them.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::RingMember` **bond option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotRingMemberBond.*
           - .. image:: ../images/OEExprOpts_OESubSearch_RingMemberBond.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::RingMember` **bond option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotRingMemberBond.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_RingMemberBond.*


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: StrictFormalCharge

      The :oe:const:`OEChem::OEExprOpts::StrictFormalCharge` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetFormalCharge` method returns the
      same value for them.
      The formal charges must be equivalent even if the formal charge
      of the query atom is zero.

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::StrictFormalCharge` **option in substructure search**

         * - .. image:: ../images/OEExprOpts_OESubSearch_NotStrictFormalCharge.*
           - .. image:: ../images/OEExprOpts_OESubSearch_StrictFormalCharge.*

      .. list-table:: **Example of using the** :oe:const:`OEChem::OEExprOpts::StrictFormalCharge` **option in maximum common substructure search**

         * - .. image:: ../images/OEExprOpts_OEMCSSearch_NotStrictFormalCharge.*
           - .. image:: ../images/OEExprOpts_OEMCSSearch_StrictFormalCharge.*

      .. seealso::

         * :oe:const:`OEChem::OEExprOpts::FormalCharge` constant


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: StringType

      The :oe:const:`OEChem::OEExprOpts::StringType` flag can be used both
      as atom and bond expression option.

      * When using this option as an atom expression option,
        atoms are considered equivalent if the
        :oe:meth:`OEChem::OEAtomBase::GetType` method returns the
        same value for them.

      * When using this option as a bond expression option,
        bonds are considered equivalent if the
        :oe:meth:`OEChem::OEBondBase::GetType` method returns the
        same value for them.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: SymmetryClass

      The :oe:const:`OEChem::OEExprOpts::SymmetryClass` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetSymmetryClass` method returns the
      same value for them.

      .. warning::

         Symmetry of the molecules must be perceived by calling
         the :oe:func:`OEChem::OEPerceiveSymmetry` function.


   .. ################################################################
      #
      ################################################################

   .. oe:constant:: Valence

      The :oe:const:`OEChem::OEExprOpts::Valence` flag can be used
      as an atom expression option.
      When using this option, atoms are considered equivalent if the
      :oe:meth:`OEChem::OEAtomBase::GetValence` method returns the
      same value for them.

      .. hint::

         The :oe:meth:`OEChem::OEAtomBase::GetValence` method
         includes the valence contribution from implicit hydrogens,
         therefore, the expression test may return successfully even when
         the explicit valence of two corresponding atoms differ.
