Error on MolSearch

User dfeb81947d

15-07-2005 13:20:00

Dear Support,





I'm using JChem3.0.12.


While using MolSearch in that way:


Code:
searchExact = new MolSearch();


search.setSubgraphSearch(true);


search.setExactBondMatching(true);


search.setExactChargeMatching(true);


search.setExactIsotopeMatching(true);


search.setExactQueryAtomMatching(true);


search.setExactStereoMatching(true);


search.setExactRadicalMatching(true);


search.setQueryAbsoluteStereo(true);


search.setStereoSearch(true);


search.setHCountMatching(SearchConstants.HCOUNT_MATCHING_AUTO);


search.setQuery(m1);


search.setTarget(m2);


return search.isMatching()


I have the following Exception:
Quote:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1


at chemaxon.marvin.modules.Parity.putToTheTop(Parity.java:1997)


at chemaxon.marvin.modules.Parity.setupStereoBonds(Parity.java:736)


at chemaxon.marvin.modules.Parity.setParity(Parity.java:543)


at chemaxon.marvin.modules.Parity.modfunc(Parity.java:149)


at chemaxon.struc.MoleculeGraph.setParity(MoleculeGraph.java:1242)


at chemaxon.struc.MoleculeGraph.setParity(MoleculeGraph.java:1190)


at chemaxon.sss.search.AtomRearranger.flipNewMolChirality(AtomRearranger.java:260)


at chemaxon.sss.search.AtomRearranger.checkParities(AtomRearranger.java:244)


at chemaxon.sss.search.AtomRearranger.rearrangeAtoms(AtomRearranger.java:192)


at chemaxon.sss.search.AtomRearranger.getRearrangedMolecule(AtomRearranger.java:74)


at chemaxon.sss.search.StructureSearch.initAtoms(StructureSearch.java:2203)


at chemaxon.sss.search.StructureSearch.initSearch(StructureSearch.java:1219)


at chemaxon.sss.search.StructureSearch.findFirst(StructureSearch.java:4164)


at chemaxon.sss.search.StructureSearch.isMatching(StructureSearch.java:4546)


at chemaxon.sss.search.MolSearch.isMatching(MolSearch.java:666)
with the molecules on the attached File


Do I need to deshydrogenate the molecule?


If so, the code Molecule.hydrogenize(false) gives an Exception too.





Warmest Regards


Jacques

ChemAxon a3d59b832c

16-07-2005 09:15:17

Dear Jacques,





I could not reproduce the problem with your molfiles. (I tried versions 3.0.12, 3.0.13 and our development version.) Perhaps the exception is caused by information which was not written in the molfile. Could you dump the molecules in .mrv format? That may contain more information and help us reproduce the problem.





A quick workaround in the meantime:





You can use the following option to disable query atom rearrangement:





Code:
setOption(SearchConstants.OPTION_KEEP_QUERY_ORDER,SearchConstants.KEEP_QUERY_ORDER)






With this option the search will be slightly slower (because it will not use the most optimal order of query atoms), but the execution will not go to the modules where the exception occured.





All the best,


Szabolcs

User dfeb81947d

25-07-2005 12:51:08

Dear Szabolcs,





To dump the molecule (in Molecule object) to .mrv format...


Do I just need to write Molecule.toFormat("mrv") or is there a methods which write Info to Standard output?





Thank you so far


Kind regards


Jacques

ChemAxon 9c0afc9aaf

25-07-2005 13:07:49

Hi Jacques,





Just simply write the structure in mrv format to the standard error or standard output right before you specify them to MolSearch.





Example:





Code:



System.err.println(m1.toFormat("mrv"));


System.err.println(m2.toFormat("mrv"));








(you can also use System.out for standard output)





Best regards,





Szilard

ChemAxon 9c0afc9aaf

25-07-2005 13:09:11

PS: In case your code is runnig inside Tomcat, use System.err, this will be visible in the log file of Tomcat.





Szilard

User dfeb81947d

25-07-2005 14:18:47

Here attached, is an example of Query and Target that fails.


In this case I used


target.hydrogenize(true);


query.hydrogenize(true);


before calling MolSearch.isMatching().





Hope it can help.


Regards


Jacques

ChemAxon 9c0afc9aaf

25-07-2005 14:41:59

Hi,





I have managed to reproduce the problem with JChem 3.0.12.





Please upgrade to JChem 3.0.13, this version will work correctly with these structures.





Best regards,





Szilard

User dfeb81947d

25-07-2005 14:53:47

Thank you very much.


Kind regards


Jacques