User f05f6b8c05
23-05-2012 03:42:50
Hi,
I'm using jchem 5.8.3 API
I am confused why below search code cannot use aromatic benzene to identify kekule benzene, after both get standardized and dearomatized etc.
If I comment out so.setStereoSearchType(SearchConstants.STEREO_EXACT); below, then match is found, but I don't know why that is necessary.
Any help would be very much appreciated.
Thanks,
Andrew
public void Process() throws Exception {
MolSearch s = new MolSearch();
MolSearchOptions so = new MolSearchOptions(SearchConstants.FULL_FRAGMENT);
so.setQueryAbsoluteStereo(true);
so.setChargeMatching(SearchConstants.CHARGE_MATCHING_EXACT);
so.setDoubleBondStereoMatchingMode(StereoConstants.DBS_ALL);
so.setImplicitHMatching(SearchConstants.IMPLICIT_H_MATCHING_ENABLED);
so.setExactBondMatching(true);
so.setStereoSearchType(SearchConstants.STEREO_EXACT);
so.setTautomerSearch(SearchConstants.TAUTOMER_SEARCH_OFF);
s.setSearchOptions(so);
Standardizer standardizer = new Standardizer("neutralize");
MolHandler mhl = new MolHandler("c1ccccc1", false);
Molecule mm = mhl.getMolecule();
mm.dearomatize();
MakeHsImplicit(mm);
standardizer.standardize(mm);
System.out.println(mm.toFormat("smiles"));
s.setQuery(mm);
MolHandler mhl2 = new MolHandler("C1=CC=CC=C1", false);
Molecule tarm = mhl2.getMolecule();
standardizer.standardize(tarm);
System.out.println(tarm.toFormat("smiles"));
s.setTarget(tarm);
int[][] hits = s.findAll();
if (hits!=null) {
System.out.println("found it");
}
}
private void MakeHsImplicit(Molecule m) throws Exception {
m.addExplicitHydrogens(0);
m.implicitizeHydrogens(MolAtom.ALL_H & ~MolAtom.LONELY_H & ~MolAtom.ISOTOPE_H & ~MolAtom.CHARGED_H & ~MolAtom.RADICAL_H & ~MolAtom.MAPPED_H & ~MolAtom.HCONNECTED_H & ~MolAtom.CTSPECIFIC_H );
}