User da00f5c453
09-04-2010 20:28:10
Hi all,
I am trying to create a database of query structures to be queried with regular structures to see what chemical structures contain the query structures in the database. All queries are encoded as SMARTS and imported into a query table in IJC, however for some particular query/target examples the search fails with an exception:
java.lang.NullPointerException
at chemaxon.sss.search.StructureSearch.initQueryProperties(StructureSearch.java:3183)
at chemaxon.sss.search.StructureSearch.initSearch(StructureSearch.java:1455)
at chemaxon.sss.search.StructureSearch.findFirst0(StructureSearch.java:6109)
at chemaxon.sss.search.StructureSearch.isMatching0(StructureSearch.java:6693)
at chemaxon.sss.search.StructureSearch.isMatching(StructureSearch.java:6685)
at chemaxon.sss.search.MolSearch.isMatching(MolSearch.java:703)
Caused: chemaxon.sss.search.SearchException: An error occured during search:java.lang.NullPointerException
Query:c1cnnc1
Target:
<?xml version="1.0" ?>
<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5"
elementType="C C N N C"
mrvQueryProps="a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])]"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="A" />
<bond atomRefs2="a2 a3" order="A" />
<bond atomRefs2="a3 a4" order="A" />
<bond atomRefs2="a4 a5" order="A" />
<bond atomRefs2="a1 a5" order="A" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
Caused by:
java.lang.NullPointerException
at chemaxon.sss.search.MolSearch.getWrapperSearchException(MolSearch.java:729)
at chemaxon.sss.search.MolSearch.isMatching(MolSearch.java:719)
at chemaxon.jchem.db.JChemSearch.isMatching(JChemSearch.java:4117)
at chemaxon.jchem.db.JChemSearch.access$1300(JChemSearch.java:120)
at chemaxon.jchem.db.JChemSearch$ABASThread.run(JChemSearch.java:471)
Caused: org.springframework.dao.InvalidDataAccessResourceUsageException: Exception occurred when executing JChem search; nested exception is chemaxon.sss.search.SearchException: An error occured during search:java.lang.NullPointerException
Query:c1cnnc1
Target:
<?xml version="1.0" ?>
<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5"
elementType="C C N N C"
mrvQueryProps="a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])] a1;str:[x2!$(*=[!R])]"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="A" />
<bond atomRefs2="a2 a3" order="A" />
<bond atomRefs2="a3 a4" order="A" />
<bond atomRefs2="a4 a5" order="A" />
<bond atomRefs2="a1 a5" order="A" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
Caused by:
java.lang.NullPointerException
at com.im.ijcs.impl.query.JChemExecutor.executeJChemSearch(JChemExecutor.java:268)
at com.im.ijcs.impl.query.JChemExecutor.execute(JChemExecutor.java:156)
at com.im.ijcs.impl.query.JChemExecutor.run(JChemExecutor.java:359)
at com.im.ijcs.impl.query.Executor.visitStructureQuery(Executor.java:152)
at com.im.ijcs.impl.query.Executor.visitSqlQuery(Executor.java:185)
at com.im.ijcs.impl.query.Executor.execute(Executor.java:143)
at com.im.df.server.local.LocalQueryExecutor.access$001(LocalQueryExecutor.java:14)
at com.im.df.server.local.LocalQueryExecutor$1.doInTransactionWithoutResult(LocalQueryExecutor.java:48)
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at com.im.df.server.local.LocalQueryExecutor.execute(LocalQueryExecutor.java:46)
at com.im.ijcs.impl.query.DefaultQueryService.findIDs(DefaultQueryService.java:44)
at com.im.df.impl.db.DBSchemaDataProviderImpl.queryForIdsImpl(DBSchemaDataProviderImpl.java:439)
at com.im.df.impl.db.DBEntityDataProviderImpl.queryForIds(DBEntityDataProviderImpl.java:156)
at com.im.df.impl.db.ResultSetImpl.applyQueryInternal(ResultSetImpl.java:195)
at com.im.df.impl.db.ResultSetImpl.applyWorkingQuery(ResultSetImpl.java:148)
at com.im.ijc.core.query.exec.ExecutableQueryPanel$2.phase1InRequestProcessor(ExecutableQueryPanel.java:232)
at com.im.commons.progress.BackgroundRunner.processTheTask(BackgroundRunner.java:126)
at com.im.commons.progress.BackgroundRunner$1.run(BackgroundRunner.java:90)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:577)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1030)
I can reproduce the error with a simple Java program:
Molecule query = MolImporter.importMol("c1cnnc1", "smiles");
Molecule target = MolImporter.importMol("[c;x2!$(*=[!R])]:1:[c;x2!$(*=[!R])]:[n;x2!$(*=[!R])]:[n;x2!$(*=[!R])]:[c;x2!$(*=[!R])]:1", "smarts:d");
StandardizedMolSearch ms = new StandardizedMolSearch();
ms.setSearchType(SearchConstants.SUPERSTRUCTURE);
ms.setTarget(target);
ms.setQuery(query);
System.out.println(ms.isMatching());
wich raises the same exception. Am I doing something wrong? Are the SMARTS used in my application not supported?
IJC 5.3.1 and JChem 5.3.1 with Java 1.6 on Mac OSX 10.6
Oleg.