User 55ffa2f197
20-03-2012 21:25:19
Hi,
I am trying to match quite a number of molecules to 147 smarts, and get a count for the matching smarts in each mol. I put the query mol in queryMol map, and two loops as following. However for a molecule like this smiles c1cc(ccc1S(=O)(=O)NC(CCC(F)(F)F)C(=O)N)Cl I am getting following error message. The molecule itself is OK, and the smarts have been converted to mols fine.
It dies on the first molecue at int mc = ms.getMatchCount()
How do I fix the problem? Or at least prevent the process from dieing, and let it run through the molecule file.
Here is the code snippet:
try {
statement = connection.createStatement();
rs = statement.executeQuery(
" select m.achiral_smi,i.name,i.mol_id "
+ " from ca_molname i, ca_mol m "
+ " where i.vendor_id=1 and i.mol_id=m.mol_id" );
while(rs.next()){
Molecule t = MolImporter.importMol(rs.getString("achiral_smi"));
t.aromatize();
for ( Map.Entry<String, Molecule> entry : queryMol.entrySet() ){
Molecule q = ( Molecule ) entry.getValue();
ms = new MolSearch();
ms.setQuery( q );
ms.setTarget( t );
int mc = ms.getMatchCount();
}
}
} catch ( SQLException e ) {
e.printStackTrace();
} catch ( MolFormatException e ) {
e.printStackTrace();
} catch ( IOException e ) {
e.printStackTrace();
} catch ( SearchException e ){
e.printStackTrace();
}
Error Message:
chemaxon.sss.search.SearchException: chemaxon.formats.MolFormatException: Unmatched ring closure number 2 in SMILES string CF2
Caused by:
Unmatched ring closure number 2 in SMILES string CF2
at chemaxon.sss.search.SmartsAtomMatcher.createMolHandlerFromSMARTS(SmartsAtomMatcher.java:111)
at chemaxon.sss.search.SmartsAtomMatcher.isRecursiveMatching(SmartsAtomMatcher.java:74)
at chemaxon.sss.search.SmartsAtomMatcher.evaluateSmartsAtomTree(SmartsAtomMatcher.java:368)
at chemaxon.sss.search.SmartsAtomMatcher.evaluateSmartsAtomTree(SmartsAtomMatcher.java:318)
at chemaxon.sss.search.SmartsAtomMatcher.evaluateSmartsAtomTree(SmartsAtomMatcher.java:291)
at chemaxon.sss.search.StructureSearch.compareAtomQueryProperties(StructureSearch.java:4548)
at chemaxon.sss.search.StructureSearch.compareAtoms(StructureSearch.java:4801)
at chemaxon.sss.search.StructureSearch.initMaps(StructureSearch.java:3694)
at chemaxon.sss.search.StructureSearch.findFirst0(StructureSearch.java:6565)
at chemaxon.sss.search.StructureSearch.findFirstHit(StructureSearch.java:6524)
at chemaxon.sss.search.MolSearch.findNextEnumeratedHit(MolSearch.java:979)
at chemaxon.sss.search.MolSearch.findNextFilteredHit(MolSearch.java:837)
at chemaxon.sss.search.MolSearch.findFirstHit(MolSearch.java:708)
at chemaxon.sss.search.MolSearch.findAllHits(MolSearch.java:777)
at chemaxon.sss.search.Search.findAll(Search.java:200)
at com.bms.mscoi.molProps.MolProps.sssMapping(MolProps.java:100)
at com.bms.mscoi.molProps.MolProps.main(MolProps.java:122)
Caused by: chemaxon.formats.MolFormatException: Unmatched ring closure number 2 in SMILES string CF2
at chemaxon.marvin.io.formats.smiles.SmilesImport.readMol0(SmilesImport.java:1034)
at chemaxon.marvin.io.formats.smiles.SmilesImport.readMol(SmilesImport.java:566)
at chemaxon.marvin.io.formats.smiles.SmilesImport.readMol(SmilesImport.java:526)
at chemaxon.marvin.io.MRecordImporter.readStructure(MRecordImporter.java:764)
at chemaxon.marvin.io.MRecordImporter.readMol(MRecordImporter.java:709)
at chemaxon.marvin.io.MRecordImporter.readMol(MRecordImporter.java:678)
at chemaxon.marvin.io.MRecordImporter.readMol0(MRecordImporter.java:593)
at chemaxon.marvin.io.MRecordImporter.readMol(MRecordImporter.java:509)
at chemaxon.formats.MolImporter.readMol(MolImporter.java:859)
at chemaxon.formats.MolImporter.read(MolImporter.java:747)
at chemaxon.formats.MolImporter.read(MolImporter.java:717)
at chemaxon.sss.search.SmartsAtomMatcher.createMolHandlerFromSMARTS(SmartsAtomMatcher.java:109)
... 16 more