Substructure search

User da00f5c453

17-10-2011 03:25:58

Hi all,


I run recently into what could be an error in substructure search algorithm or SMARTS parsing? The error can be reproduced by the code below


 


Molecule target = MolImporter.importMol("C1=CC2=C(C=C1)N=CC=C2", "smiles");
target.aromatize();
Molecule query = MolImporter.importMol("n1ccccc1-C", "smarts");
StandardizedMolSearch ss = new StandardizedMolSearch();
ss.setTarget(target);
ss.setQuery(query);
System.out.println(ss.isMatching());

This should print "false" but instead prints "true", even if I replace "C1=CC2=C(C=C1)N=CC=C2" with "c1ccc2ncccc2c1", I still get "true", when I should get false - there is no single non aromatic bond or C atom in target structure.


JChem 5.6.0.2


Java 1.6.0.26


Oleg.

ChemAxon efa1591b5a

17-10-2011 07:56:29

Hi Oleg,


Thank you for your report. We will investigate this problem and get back to you soon.


 


Best regards,


Miklos


 

ChemAxon a9ded07333

19-10-2011 14:44:18

Hi Oleg,


In searches we use default vague bond handling (level 1 - see our Query Guide section on vague bond search). During this process we 'lost' the aliphatic property of the carbon atom and set its bond (that connects it to the aromatic ring) to aromatic.


We will fix this bug in our 5.6.0.4 patch, to be released probably before the end of next week.


If you need a workaround, you may set the vague bond matching level to 0 (see search option usage). It prevents aromatizing single bonds connected to aromatic rings.


Best regards,
Tamás

User da00f5c453

19-10-2011 16:13:09

Hi Tamás,


Thank you for help, the modified code works now fine.


Molecule target = MolImporter.importMol("C1=CC2=C(C=C1)N=CC=C2", "smiles");

Molecule query = MolImporter.importMol("n1ccccc1-C", "smarts");

StandardizedMolSearch ss = new StandardizedMolSearch();

MolSearchOptions mso = ss.getSearchOptions();

mso.setVagueBondLevel(SearchConstants.VAGUE_BOND_OFF);

ss.setTarget(target);

ss.setQuery(query);

System.out.println(ss.isMatching());


Oleg.