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.