User c30a4b265a
02-12-2009 22:03:53
Hi - I am using version 5.2.4 of JChem, JRE version 6 update 17 on Windows XP. I am doing an in-memory molecule substructure comparison using the MolSearch object. Query molecules are being drawn with MarvinSketch version 5.2.3.
It works fine with a basic substructure query. But, if I replace the heavy atoms in my query molecule with the atom wildcard A in MarvinSketch (off the atom toolbar, "More", then "Advanced" tab, at right), then nothing is matched - while of course the results should be a superset of those found using all atom literals (C, N, etc).
I don't think it's a MarvinSketch problem, because when I pass the same kind of query molecule from MarvinSketch to our ISIS data cartridge in Oracle to do a substructure search, that seems to work just fine.
Below is a fragment from my code that is doing the searching in-memory, which should be sufficient for you to see how I am making the call...
Thanks,
Barry
================================
MolSearch ms = new MolSearch(); // search object creation
queryMol.aromatize(); // aromatization of query molecule
ms.setQuery(queryMol); // assignment of query to search
ms.getSearchOptions().setSearchType(chemaxon.sss.SearchConstants.SUBSTRUCTURE);
numRows= getRowCount();
Boolean curr= null;
boolean sssMatch;
Molecule targetMol= null;
int numMatches= 0;
for (i=0;i<numRows;i++) {
targetMol= (Molecule) molColumn.getObjectAt(i);
if (targetMol == null || targetMol.getAtomCount() == 0) continue;
targetMol= targetMol.cloneMolecule();
targetMol.aromatize(); // aromatization of target molecule
ms.setTarget(targetMol); // assignment of target molecule to search
sssMatch= false;
try {
sssMatch= ms.isMatching();
}
catch (chemaxon.sss.search.SearchException se)
{
se.printStackTrace();
}
if (sssMatch) numMatches++;
================================