User f05f6b8c05
19-05-2012 22:52:15
Hi,
I'm using jchem 5.8.3 API
I'm trying to standardize the following molecule:
[O-][N+]1=CC=CC=C1 => O=N1=CC=CC=C1
The following command does not standardize it:
Standardizer standardizer = new Standardizer("[!#1:1]-[N+:2](-[O-:3])=[*:4]>>[!#1:1]-[N:2](=[O:3])=[*:4]");
However, this command does:
Standardizer standardizer = new Standardizer("[N+:1]-[O-:2]>>[N:1]=[O:2]");
(but this command is too general, I would like to use the previous one)
Can you tell me what I'm doing wrong in the first standardizer command?
Thanks.
Andrew
In case it is useful, the following search finds a match in the molecule as desired:
Molecule mol = MolImporter.importMol("[O-][N+]1=CC=CC=C1");
MolHandler mhl = new MolHandler("[!#1]-[N+]([O-])=*", true); // if true, import SMILES string as SMARTS
Molecule query = mhl.getMolecule();
MolSearch s = new MolSearch();
MolSearchOptions so = new MolSearchOptions(SearchConstants.SUBSTRUCTURE);
so.setQueryAbsoluteStereo(true);
so.setChargeMatching(SearchConstants.CHARGE_MATCHING_EXACT);
so.setImplicitHMatching(SearchConstants.IMPLICIT_H_MATCHING_IGNORE); // we won't match H's at all here
so.setDoubleBondStereoMatchingMode(StereoConstants.DBS_ALL);
so.setExactBondMatching(true);
so.setStereoSearchType(SearchConstants.STEREO_EXACT);
so.setTautomerSearch(SearchConstants.TAUTOMER_SEARCH_OFF);
s.setSearchOptions(so);
s.setTarget(mol);
s.setQuery(query);
SearchHit[] sh = s.findAllHits();
if (sh!=null) {
// match found
}