void OEPrepareSearch(OEMolBase &mol, const OESubSearch &subs, bool adjustH = false)
Perceives the atom and bond properties of the given target molecule that are necessary to successfully execute the given substructure search.
- The OEAssignAromaticFlags function is called if the aromaticity of the molecule is not perceived yet. The aromaticity is also re-perceived if it does not match the aromaticity model of the query molecule stored in the given OESubSearch object.
- The OEPerceiveChiral function is called if the chirality of the given molecule is not perceived yet.
- The OEAssignHybridization function is called if the hybridization perception is required by the query molecule stored in the OESubSearch object.
- Attempts to perceive atom stereo from other information (such as 3D, bond stereo or atom parity) if the atom stereo is required by the query molecule stored in the OESubSearch object.
- Attempts to perceive bond stereo from 2D or 3D coordinates if the bond stereo is required by the query molecule stored in the OESubSearch object.
- If the adjustH parameter is true, and
- the query molecule of the substructure search has any explicit hydrogen expressions but no implicit ones, then OEAddExplicitHydrogens is called on the given target molecule.
- the query molecule of the substructure search has any implicit hydrogen expressions but no explicit ones, then OESuppressHydrogens is called on the given target molecule.
If the query molecule has both explicit and implicit hydrogens then the hydrogens on the target molecule can not be adjusted accordingly, and the substructure search could fail. Therefore it is highly recommended to not mix explicit and implicit hydrogens in the query molecule.
It is a good practice to call the OEPrepareSearch function before calling any of the following methods:
If there is any atom or bond property that is not perceived but it is necessary to successfully execute the substructure search, then the above methods throw a warning. These warnings can be suppressed by calling the OEPrepareSearch function.