OEExprOpts

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

The OEExprOpts namespace contains expression options that control the conversion into query molecules.

The OEExprOpts namespace contains both atom and bond expressions options. Some options such as OEExprOpts_Aromaticity can be used both as an atom or a bond expression.

Atom and bond expression options

Constant name

Atom expression

Bond expression

Should be used with

Aromaticity

X

X

AtomicNumber

X

BondOrder

X

Chiral

X

X

Degree

X

EqAromatic

X

AtomicNumber

EqCAliphaticONS

X

AtomicNumber

EqCHalogen

X

AtomicNumber

EqCPSAcidRoot

X

AtomicNumber

EqDoubleTriple

X

BondOrder

EqHalogen

X

AtomicNumber

EqKetoneSulfoneRoot

X

AtomicNumber

EqMetal

X

AtomicNumber

EqNotAromatic

X

X

AtomicNumber or BondOrder

EqON

X

AtomicNumber

EqONS

X

AtomicNumber

EqPS

X

AtomicNumber

EqSingleDouble

X

BondOrder

ExplicitDegree

X

FormalCharge

X

HCount

X

HvyDegree

X

Hybridization

X

ImplicitHCount

X

IntType

X

X

Mass

X

RingMember

X

X

StrictFormalCharge

X

StringType

X

X

SymmetryClass

X

X

Valence

X

The OEExprOpts namespace also contains some predefined atom and bonds expression combinations listed in the table below.

Predefined atom and bond expression combinations

Constant name

Combination of expression flags

AutomorphAtoms

AtomicNumber | Aromaticity | RingMember | HvyDegree

AutomorphBonds

Aromaticity

DefaultAtoms

AtomicNumber | Aromaticity | FormalCharge

DefaultBonds

BondOrder | Aromaticity

ExactAtoms

AtomicNumber | Aromaticity | StrictFormalCharge | Degree | HCount | Chiral | Mass | RingMember

ExactBonds

BondOrder | Aromaticity | Chiral | RingMember

Aromaticity

The 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 OEAtomBase.IsAromatic method returns the same value for them.

  • When using this option as a bond expression option, bonds are considered equivalent if the OEBondBase.IsAromatic method returns the same value for them.

Example of using the OEExprOpts_Aromaticity option in substructure search
../../_images/OEExprOpts_OESubSearch_NotAromaticity.png ../../_images/OEExprOpts_OESubSearch_Aromaticity.png
Example of using the OEExprOpts_Aromaticity option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotAromaticity.png ../../_images/OEExprOpts_OEMCSSearch_Aromaticity.png

AtomicNumber

The OEExprOpts_AtomicNumber flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetAtomicNum method returns the same value for them.

Example of using the OEExprOpts_AtomicNumber option in substructure search
../../_images/OEExprOpts_OESubSearch_NotAtomicNumber.png ../../_images/OEExprOpts_OESubSearch_AtomicNumber.png
Example of using the OEExprOpts_AtomicNumber option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotAtomicNumber.png ../../_images/OEExprOpts_OEMCSSearch_AtomicNumber.png

AutomorphAtoms

This constant along with OEExprOpts_AutomorphBonds is used when determining automorphism related graphs OEExprOpts_AutomorphAtoms is the combination of the following atom expression constants:

AutomorphBonds

This constant along with OEExprOpts_AutomorphAtoms is used when determining automorphism related graphs. OEExprOpts_AutomorphBonds is equivalent to the OEExprOpts_Aromaticity constant.

BondOrder

The OEExprOpts_BondOrder flag can be used as a bond expression option. When using this option, bonds are considered equivalent if the OEBondBase.GetOrder method returns the same value for them.

Example of using the OEExprOpts_BondOrder option in substructure search
../../_images/OEExprOpts_OESubSearch_NotBondOrder.png ../../_images/OEExprOpts_OESubSearch_BondOrder.png
Example of using the OEExprOpts_BondOrder option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotBondOrder.png ../../_images/OEExprOpts_OEMCSSearch_BondOrder.png

DefaultAtoms

This constant along with OEExprOpts_DefaultBonds is used when a moderate degree of discrimination is required of the graph equivalence. OEExprOpts_DefaultAtoms is the combination of the following atom expression constants:

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.

DefaultBonds

OEExprOpts_DefaultBonds is the combination of the following bond expression constants:

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.

Chiral

The 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.

Example of using the OEExprOpts_Chiral atom option in substructure search
../../_images/OEExprOpts_OESubSearch_NotChiralAtom.png ../../_images/OEExprOpts_OESubSearch_ChiralAtom.png

Warning

The OEExprOpts_Chiral is not available as an atom expression option in maximum common substructure search (OEMCSSearch) and clique search (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.

Example of using the OEExprOpts_Chiral atom option in substructure search
../../_images/OEExprOpts_OESubSearch_NotChiralBond.png ../../_images/OEExprOpts_OESubSearch_ChiralBond.png

Warning

The OEExprOpts_Chiral is not available as a bond expression option in maximum common substructure search (OEMCSSearch) and clique search (OECliqueSearch).

Degree

The OEExprOpts_Degree flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetDegree method returns the same value for them.

Hint

The OEAtomBase.GetDegree method returns the total degree including the contribution from implicit hydrogens.

EqAromatic

The 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 OEExprOpts_EqAromatic should always be used with the OEExprOpts_AtomicNumber flag.

Example of using the OEExprOpts_EqAromatic option in substructure search
../../_images/OEExprOpts_OESubSearch_NotEqAromatic.png ../../_images/OEExprOpts_OESubSearch_EqAromatic.png
Example of using the OEExprOpts_EqAromatic option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotEqAromatic.png ../../_images/OEExprOpts_OEMCSSearch_EqAromatic.png

EqCAliphaticONS

The 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 OEExprOpts_EqCAliphaticONS should always be used with the OEExprOpts_AtomicNumber flag.

Example of using the OEExprOpts_EqCAliphaticONS option in substructure search
../../_images/OEExprOpts_OESubSearch_NotEqCAliphaticONS.png ../../_images/OEExprOpts_OESubSearch_EqCAliphaticONS.png
Example of using the OEExprOpts_EqCAliphaticONS option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotEqCAliphaticONS.png ../../_images/OEExprOpts_OEMCSSearch_EqCAliphaticONS.png

EqCHalogen

The OEExprOpts_EqCHalogen flag can be used as an atom expression option. When using this option, carbons are considered equivalent with halogen atoms.

Warning

The OEExprOpts_EqCHalogen should always be used with the OEExprOpts_AtomicNumber flag.

EqCPSAcidRoot

The 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 OEExprOpts_EqCPSAcidRoot should always be used with the OEExprOpts_AtomicNumber flag.

EqDoubleTriple

The OEExprOpts_EqDoubleTriple flag can be used as a bond expression option. When using this option, double and triple bonds are considered equivalent.

Warning

The OEExprOpts_EqDoubleTriple should always be used with the OEExprOpts_BondOrder flag.

Example of using the OEExprOpts_EqDoubleTriple option in substructure search
../../_images/OEExprOpts_OESubSearch_NotEqDoubleTriple.png ../../_images/OEExprOpts_OESubSearch_EqDoubleTriple.png
Example of using the OEExprOpts_EqDoubleTriple option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotEqDoubleTriple.png ../../_images/OEExprOpts_OEMCSSearch_EqDoubleTriple.png

EqHalogen

The OEExprOpts_EqHalogen flag can be used as an atom expression option. When using this option, halide atoms (OEElemNo_F, OEElemNo_Cl, OEElemNo_Br, and OEElemNo_I) are considered equivalent.

Warning

The OEExprOpts_EqHalogen should always be used with the OEExprOpts_AtomicNumber flag.

Example of using the OEExprOpts_EqHalogen option in substructure search
../../_images/OEExprOpts_OESubSearch_NotEqHalogen.png ../../_images/OEExprOpts_OESubSearch_EqHalogen.png
Example of using the OEExprOpts_EqHalogen option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotEqHalogen.png ../../_images/OEExprOpts_OEMCSSearch_EqHalogen.png

EqKetoneSulfoneRoot

The 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 OEExprOpts_EqKetoneSulfoneRoot should always be used with the OEExprOpts_AtomicNumber flag.

EqMetal

The OEExprOpts_EqMetal flag can be used as an atom expression option. When using this option, metal atoms are considered equivalent.

Warning

The OEExprOpts_EqMetal should always be used with the OEExprOpts_AtomicNumber flag.

EqNotAromatic

The 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.

Example of using the OEExprOpts_EqNotAromatic atom option in substructure search
../../_images/OEExprOpts_OESubSearch_NotEqNotAromaticAtom.png ../../_images/OEExprOpts_OESubSearch_EqNotAromaticAtom.png
Example of using the OEExprOpts_EqNotAromatic atom option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotEqNotAromaticAtom.png ../../_images/OEExprOpts_OEMCSSearch_EqNotAromaticAtom.png
  • When using this option as a bond expression option, aliphatic bonds are considered equivalent regardless of their bond order.

Example of using the OEExprOpts_EqNotAromatic bond option in substructure search
../../_images/OEExprOpts_OESubSearch_NotEqNotAromaticBond.png ../../_images/OEExprOpts_OESubSearch_EqNotAromaticBond.png
Example of using the OEExprOpts_EqNotAromatic bond option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotEqNotAromaticBond.png ../../_images/OEExprOpts_OEMCSSearch_EqNotAromaticBond.png

Warning

The OEExprOpts_EqNotAromatic should always be used with either the OEExprOpts_AtomicNumber or the OEExprOpts_BondOrder flag.

EqON

The OEExprOpts_EqON flag can be used as an atom expression option. When using this option, nitrogen and oxygen atoms are considered equivalent.

Warning

The OEExprOpts_EqON should always be used with the OEExprOpts_AtomicNumber flag.

EqONS

The 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 OEExprOpts_EqONS should always be used with the OEExprOpts_AtomicNumber flag.

EqPS

The OEExprOpts_EqPS flag can be used as an atom expression option. When using this option, phosphorus and sulfur atoms are considered equivalent.

Warning

The OEExprOpts_EqPS should always be used with the OEExprOpts_AtomicNumber flag.

EqSingleDouble

The 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 OEExprOpts_EqSingleDouble should always be used with the OEExprOpts_BondOrder flag.

Example of using the OEExprOpts_EqSingleDouble option in substructure search
../../_images/OEExprOpts_OESubSearch_NotEqSingleDouble.png ../../_images/OEExprOpts_OESubSearch_EqSingleDouble.png
Example of using the OEExprOpts_EqSingleDouble option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotEqSingleDouble.png ../../_images/OEExprOpts_OEMCSSearch_EqSingleDouble.png

ExactAtoms

OEExprOpts_ExactAtoms is the combination of the following bond expression constants:

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

ExactBonds

OEExprOpts_ExactBonds is the combination of the following bond expression constants:

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

ExplicitDegree

The OEExprOpts_ExplicitDegree flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetHvyDegree method returns the same value for them.

FormalCharge

The OEExprOpts_FormalCharge flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the 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 OEExprOpts_StrictFormalCharge.

Example of using the OEExprOpts_FormalCharge option in substructure search
../../_images/OEExprOpts_OESubSearch_NotFormalCharge.png ../../_images/OEExprOpts_OESubSearch_FormalCharge.png
Example of using the OEExprOpts_FormalCharge option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotFormalCharge.png ../../_images/OEExprOpts_OEMCSSearch_FormalCharge.png

See also

HCount

The OEExprOpts_HCount flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetTotalHCount method returns the same value for them.

Hint

The OEAtomBase.GetTotalHCount method returns the number of explicit and implicit hydrogens i.e. the expression built when the OEExprOpts_HCount flag is set will therefore not discriminate between implicit and explicit hydrogen counts.

HvyDegree

The OEExprOpts_HvyDegree flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetHvyDegree method returns the same value for them.

Hybridization

The OEExprOpts_Hybridization flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetHyb method returns the same value for them.

Warning

Hybridization of the molecules must be perceived by calling the OEAssignHybridization function.

ImplicitHCount

The OEExprOpts_ImplicitHCount flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetImplicitHCount method returns the same value for them.

IntType

The 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 OEAtomBase.GetIntType method returns the same value for them.

  • When using this option as a bond expression option, bonds are considered equivalent if the OEBondBase.GetIntType method returns the same value for them.

Mass

The OEExprOpts_Mass flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetIsotope method returns the same value for them.

RingMember

The 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 OEAtomBase.IsInRing method returns the same value for them.

Example of using the OEExprOpts_RingMember atom option in substructure search
../../_images/OEExprOpts_OESubSearch_NotRingMemberAtom.png ../../_images/OEExprOpts_OESubSearch_RingMemberAtom.png
Example of using the OEExprOpts_RingMember atom option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotRingMemberAtom.png ../../_images/OEExprOpts_OEMCSSearch_RingMemberAtom.png
  • When using this option as a bond expression option, bonds are considered equivalent if the OEBondBase.IsInRing method returns the same value for them.

Example of using the OEExprOpts_RingMember bond option in substructure search
../../_images/OEExprOpts_OESubSearch_NotRingMemberBond.png ../../_images/OEExprOpts_OESubSearch_RingMemberBond.png
Example of using the OEExprOpts_RingMember bond option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotRingMemberBond.png ../../_images/OEExprOpts_OEMCSSearch_RingMemberBond.png

StrictFormalCharge

The OEExprOpts_StrictFormalCharge flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the 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.

Example of using the OEExprOpts_StrictFormalCharge option in substructure search
../../_images/OEExprOpts_OESubSearch_NotStrictFormalCharge.png ../../_images/OEExprOpts_OESubSearch_StrictFormalCharge.png
Example of using the OEExprOpts_StrictFormalCharge option in maximum common substructure search
../../_images/OEExprOpts_OEMCSSearch_NotStrictFormalCharge.png ../../_images/OEExprOpts_OEMCSSearch_StrictFormalCharge.png

See also

StringType

The 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 OEAtomBase.GetType method returns the same value for them.

  • When using this option as a bond expression option, bonds are considered equivalent if the OEBondBase.GetType method returns the same value for them.

SymmetryClass

The OEExprOpts_SymmetryClass flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetSymmetryClass method returns the same value for them.

Warning

Symmetry of the molecules must be perceived by calling the OEPerceiveSymmetry function.

Valence

The OEExprOpts_Valence flag can be used as an atom expression option. When using this option, atoms are considered equivalent if the OEAtomBase.GetValence method returns the same value for them.

Hint

The 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.