bool OEScreen(const OESubSearchScreen &query, const OESubSearchScreen &target)
The code snippet below shows how to generate a screens for a query and a target molecule and how to compare them using OEScreen.
- OEScreen will throw a warning and returns false if the type of the screens are different.
- If the query screen has any bit ‘on’ that is ‘off’ in the target molecule (i.e. query has some feature that is not present in the target molecule), the OEScreen function returns false and the target molecule can be eliminated from further consideration since it can not be successfully matched to the query.
- If all the bits that are ‘on’ in the query screen are also ‘on’ in the target screen, OEScreen returns true and match has to be validated by performing atom-by-atom substructure match (see also OESubSearch).
qmol = oechem.OEQMol() oechem.OEParseSmarts(qmol, "c1cc[o,n,s]c1") qscreen = oechem.OESubSearchScreen() oechem.OEMakeSubSearchQueryScreen(qscreen, qmol, oechem.OESubSearchScreenType_SMARTS) tmol = oechem.OEGraphMol() oechem.OEParseSmiles(tmol, "c1ccoc1") tscreen = oechem.OESubSearchScreen() oechem.OEMakeSubSearchTargetScreen(tscreen, tmol, oechem.OESubSearchScreenType_SMARTS) ss = oechem.OESubSearch(qmol) if oechem.OEScreen(qscreen, tscreen): if ss.SingleMatch(tmol): print("match") else: print("false positive match") else: print("no match")
All screens provided by OEChem TK are rigorously tested to make sure that they do not eliminate any matches that would succeed when utilizing the more elaborate atom-by-atom substructure search algorithm.