User 870ab5b546
01-07-2008 21:57:06
We're using JChem 3.2.12. The code:
The target:
The query:
The error:
Note that the error occurs in the MolSearch.findNext() command. It's already gone through the findFirst() command without any problem.
However, if we ungroup the Ph groups in the query, no error is thrown, and we get four isomorphisms, as we ought.
Can you reproduce this error? Does it occur in more recent versions of JChem? Is there a workaround available in JChem 3.2.12?
Code: |
public static boolean matchAtLeast_Map(Molecule respMol, Molecule authMol) throws VerifyException { try { MolSearch mySearch = new MolSearch(); mySearch.setTarget(respMol); mySearch.setQuery(authMol); mySearch.setSearchType(SearchConstants.EXACT); mySearch.setStereoSearch(true); mySearch.setExactBondMatching(true); mySearch.setOrderSensitiveSearch(true); // want multiple results mySearch.setSubgraphSearch(false); // full match desired mySearch.setOption(SearchConstants.OPTION_STEREO_MODEL, SearchConstants.STEREO_MODEL_GLOBAL); // JChem 3.2.2 mySearch.setOption(SearchConstants.OPTION_CHARGE_MATCHING, SearchConstants.CHARGE_MATCHING_EXACT); mySearch.setOption(SearchConstants.OPTION_ISOTOPE_MATCHING, SearchConstants.ISOTOPE_MATCHING_EXACT); mySearch.setOption(SearchConstants.OPTION_RADICAL_MATCHING, SearchConstants.RADICAL_MATCHING_EXACT); mySearch.setOption(SearchConstants.OPTION_VAGUE_BOND, SearchConstants.VAGUE_BOND_OFF); debugPrint("matchAtLeast_Map: respMol:\n" + respMol.toFormat("mrv") + "matchAtLeast_Map: authMol:\n" + authMol.toFormat("mrv")); int ct = 1; int[] isomorphism = mySearch.findFirst(); boolean first = true; while (isomorphism != null) { // check one isomorphism debugPrint("matchAtLeast_Map: isomorphism " + ct + " has " + isomorphism.length + " members."); if (goodIsomorphism(respMol, authMol, isomorphism, first)) { debugPrint("matchAtLeast_Map: isomorphism found "); return true; } isomorphism = mySearch.findNext(); ct++; first = false; } // check one isomorphism debugPrint("matchAtLeast_Map: no more isomorphisms found "); return false; // not a single isomorphism worked } catch (Exception e1) { e1.printStackTrace(); throw new VerifyException("internal error in matchAtLeast_Map"); } } // matchAtLeast_Map(Molecule, Molecule) |
The target:
Code: |
<?xml version="1.0" ?> <MDocument> <MChemicalStruct> <molecule molID="m1"> <atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27" elementType="C C C C C C C C C R O O C C C C C C C C O O H R C C C" mrvMap="6 7 2 5 1 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" sgroupRef="0 0 0 0 0 0 0 0 0 sg1 0 0 0 0 0 0 0 0 0 0 0 0 0 sg2 0 0 0" x3="-17.801633855590822 -17.119740522257487 -15.828263321533203 -16.35403385559082 -16.223180522257486 -14.439580522257486 -14.990433855590823 -17.588401890031633 -14.859757720419317 -13.350636079230203 -13.350636079230203 -14.220433855590823 -14.73931887850592 -0.9601248056888583 0.4367751943111422 0.9327018884181975 -0.10939811158180213 -1.5062981115818026 -2.002224805688858 -1.178598224384662 0.15341185202598595 -1.8202660434440436 0.9327018884181975 2.420227660903363 -0.9146931917667391 -2.1772846808831945 1.8805251370906833" y3="16.875655052693684 18.10858838602702 18.852713092651367 17.604215052693686 20.47104171936035 18.080401719360353 16.912988386027017 21.284944421043384 21.187057266277982 16.99145727633307 19.169346162387637 15.579309264198981 19.94165753567865 18.211075228881835 17.955675228881837 19.322591247558595 19.165891247558594 19.421291247558592 18.054375228881838 16.74857400473652 16.789904660034182 15.581643377428836 20.412591247558595 18.92400991810071 20.264291247558592 16.892276202114317 18.051925762939455" z3="0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.4073 0.8864 -0.32209999999999994 -1.4073 -0.8864 0.32210000000000005 0.32210000000000005 0.8864 0.32210000000000005 -0.32209999999999994 -0.32209999999999994 1.4073 1.4073 0.8864" /> <bondArray> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a2 a3" order="1" /> <bond atomRefs2="a1 a4" order="1" /> <bond atomRefs2="a4 a5" order="1" /> <bond atomRefs2="a5 a3" order="1" /> <bond atomRefs2="a3 a6" order="1" /> <bond atomRefs2="a6 a7" order="1" /> <bond atomRefs2="a7 a4" order="1" /> <bond atomRefs2="a5 a8" order="1" /> <bond atomRefs2="a5 a9" order="1" /> <bond atomRefs2="a6 a11" order="1" /> <bond atomRefs2="a7 a12" order="2" /> <bond atomRefs2="a3 a13" order="1" /> <bond atomRefs2="a14 a15" order="1" /> <bond atomRefs2="a14 a19" order="1" /> <bond atomRefs2="a15 a16" order="1" /> <bond atomRefs2="a16 a17" order="1" /> <bond atomRefs2="a17 a18" order="1" /> <bond atomRefs2="a18 a19" order="1" /> <bond atomRefs2="a19 a20" order="1" /> <bond atomRefs2="a15 a21" order="1" /> <bond atomRefs2="a20 a21" order="1" /> <bond atomRefs2="a20 a22" order="2" /> <bond atomRefs2="a16 a23" order="1" /> <bond atomRefs2="a14 a25" order="1" /> <bond atomRefs2="a14 a26" order="1" /> <bond atomRefs2="a15 a27" order="1" /> <bond atomRefs2="a16 a24" order="1" /> <bond atomRefs2="a6 a10" order="1" /> </bondArray> <molecule id="sg1" role="SuperatomSgroup" title="Ph" molID="m2"> <atomArray atomID="a28 a29 a30 a31 a32 a33" elementType="C C C C C C" attachmentPoint="1 0 0 0 0 0" x3="-13.282499313354492 -11.948820191526455 -11.948820191526455 -13.28249931335449 -14.616178435182526 -14.616178435182526" y3="15.351874313354493 16.121874313354493 17.66187431335449 18.43187431335449 17.66187431335449 16.121874313354493" z3="0.0 0.0 0.0 0.0 0.0 0.0" /> <bondArray> <bond atomRefs2="a28 a29" order="2" /> <bond atomRefs2="a28 a33" order="1" /> <bond atomRefs2="a29 a30" order="1" /> <bond atomRefs2="a30 a31" order="2" /> <bond atomRefs2="a31 a32" order="1" /> <bond atomRefs2="a32 a33" order="2" /> </bondArray> </molecule> <molecule id="sg2" role="SuperatomSgroup" title="Ph" molID="m3"> <atomArray atomID="a34 a35 a36 a37 a38 a39" elementType="C C C C C C" attachmentPoint="1 0 0 0 0 0" x3="2.6496003453925656 3.3714904316467207 4.785624909308046 5.507238982533522 4.785624909308044 3.3714904316467207" y3="21.309493829307847 20.09819516551877 20.096462546104462 21.30949382930785 22.52252511251124 22.52079249309693" z3="-3.6316335236080717E-10 4.4656358679551396E-10 -5.259824087052672E-11 -1.3512910359108159E-10 5.476814756506433E-10 -1.462726068336113E-9" /> <bondArray> <bond atomRefs2="a34 a35" order="2"> <bondStereo>C</bondStereo> </bond> <bond atomRefs2="a34 a39" order="1" /> <bond atomRefs2="a35 a36" order="1" /> <bond atomRefs2="a36 a37" order="2"> <bondStereo>C</bondStereo> </bond> <bond atomRefs2="a37 a38" order="1" /> <bond atomRefs2="a38 a39" order="2"> <bondStereo>C</bondStereo> </bond> </bondArray> </molecule> </molecule> </MChemicalStruct> </MDocument> |
The query:
Code: |
<?xml version="1.0" ?> <MDocument> <MChemicalStruct> <molecule molID="m1"> <atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27" elementType="C C C C C C C C C R O O C C C C C C C C O O H R C C C" mrvMap="6 7 2 5 1 3 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0" sgroupRef="0 0 0 0 0 0 0 0 0 sg1 0 0 0 0 0 0 0 0 0 0 0 0 0 sg2 0 0 0" x3="-18.774792851747844 -18.09289951841451 -16.801422317690225 -17.327192851747842 -17.196339518414508 -15.412739518414508 -15.963592851747844 -18.561560886188655 -15.832916716576339 -14.323795075387228 -14.323795075387224 -15.193592851747844 -15.712477874662941 -1.9332838018458807 -0.5363838018458802 -0.04045710773882494 -1.0825571077388245 -2.479457107738825 -2.9753838018458802 -2.1517572205416844 -0.8197471441310364 -2.793425039601066 -0.04045710773882494 1.44706866474634 -1.8878521879237615 -3.150443677040217 0.9073661409336609" y3="17.232299911108697 18.465233244442032 19.20935795106638 17.9608599111087 20.827686577775363 18.437046577775366 17.26963324444203 21.641589279458397 21.543702124692995 17.34810213474808 19.52599102080265 15.935954122613994 20.298302394093664 18.56772008729685 18.31232008729685 19.679236105973608 19.522536105973607 19.777936105973605 18.41102008729685 17.10521886315153 17.146549518449195 15.93828823584385 20.769236105973608 19.280654776515725 20.620936105973605 17.24892106052933 18.408570621354468" z3="0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 0.08944694691560619 1.4967469469156063 0.9758469469156061 -0.23265305308439377 -1.3178530530843937 -0.7969530530843938 0.4115469469156062 0.4115469469156062 0.9758469469156061 0.4115469469156062 -0.23265305308439377 -0.23265305308439377 1.4967469469156063 1.4967469469156063 0.9758469469156061" /> <bondArray> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a2 a3" order="1" /> <bond atomRefs2="a1 a4" order="1" /> <bond atomRefs2="a4 a5" order="1" /> <bond atomRefs2="a5 a3" order="1" /> <bond atomRefs2="a3 a6" order="1" /> <bond atomRefs2="a6 a7" order="1" /> <bond atomRefs2="a7 a4" order="1" /> <bond atomRefs2="a5 a8" order="1" /> <bond atomRefs2="a5 a9" order="1" /> <bond atomRefs2="a6 a11" order="1" /> <bond atomRefs2="a7 a12" order="2" /> <bond atomRefs2="a3 a13" order="1" /> <bond atomRefs2="a14 a15" order="1" /> <bond atomRefs2="a14 a19" order="1" /> <bond atomRefs2="a15 a16" order="1" /> <bond atomRefs2="a16 a17" order="1" /> <bond atomRefs2="a17 a18" order="1" /> <bond atomRefs2="a18 a19" order="1" /> <bond atomRefs2="a19 a20" order="1" /> <bond atomRefs2="a15 a21" order="1" /> <bond atomRefs2="a20 a21" order="1" /> <bond atomRefs2="a20 a22" order="2" /> <bond atomRefs2="a16 a23" order="1" /> <bond atomRefs2="a14 a25" order="1" /> <bond atomRefs2="a14 a26" order="1" /> <bond atomRefs2="a15 a27" order="1" /> <bond atomRefs2="a16 a24" order="1" /> <bond atomRefs2="a6 a10" order="1" /> </bondArray> <molecule id="sg1" role="SuperatomSgroup" title="Ph" molID="m2"> <atomArray atomID="a28 a29 a30 a31 a32 a33" elementType="C C C C C C" attachmentPoint="1 0 0 0 0 0" x3="-14.386513006190915 -13.664622919936761 -12.250488442275435 -11.528874369049959 -12.250488442275437 -13.664622919936761" y3="19.58817653804808 18.376877874259005 18.375145254844696 19.588176538048085 20.801207821251474 20.799475201837165" z3="-3.631633523608078E-10 4.4656358679551396E-10 -5.25982408705269E-11 -1.351291035910818E-10 5.476814756506428E-10 -1.4627260683361136E-9" /> <bondArray> <bond atomRefs2="a28 a29" order="2" /> <bond atomRefs2="a28 a33" order="1" /> <bond atomRefs2="a29 a30" order="1" /> <bond atomRefs2="a30 a31" order="2" /> <bond atomRefs2="a31 a32" order="1" /> <bond atomRefs2="a32 a33" order="2" /> </bondArray> </molecule> <molecule id="sg2" role="SuperatomSgroup" title="Ph" molID="m3"> <atomArray atomID="a34 a35 a36 a37 a38 a39" elementType="C C C C C C" attachmentPoint="1 0 0 0 0 0" x3="1.4466124658778714 2.1685025521320265 3.582637029793352 4.304251103018828 3.58263702979335 2.1685025521320265" y3="21.753801156578355 20.54250249278928 20.54076987337497 21.75380115657836 22.966832439781747 22.96509982036744" z3="-3.631633523608078E-10 4.4656358679551396E-10 -5.25982408705269E-11 -1.351291035910818E-10 5.476814756506428E-10 -1.4627260683361136E-9" /> <bondArray> <bond atomRefs2="a34 a35" order="2" /> <bond atomRefs2="a34 a39" order="1" /> <bond atomRefs2="a35 a36" order="1" /> <bond atomRefs2="a36 a37" order="2" /> <bond atomRefs2="a37 a38" order="1" /> <bond atomRefs2="a38 a39" order="2" /> </bondArray> </molecule> </molecule> </MChemicalStruct> </MDocument> |
The error:
Code: |
matchAtLeast_Map: isomorphism 1 has 37 members. java.lang.ArrayIndexOutOfBoundsException: 5776 at chemaxon.sss.search.StructureSearch.getMap(StructureSearch.java:4585) at chemaxon.sss.search.StructureSearch.clearRowColumn(StructureSearch.java:3050) at chemaxon.sss.search.StructureSearch.switchToExhaustiveMode(StructureSearch.java:5571) at chemaxon.sss.search.StructureSearch.findNext0(StructureSearch.java:5355) at chemaxon.sss.search.StructureSearch.findNext(StructureSearch.java:5318) at chemaxon.sss.search.MolSearch.findNextEnumerated(MolSearch.java:1117) at chemaxon.sss.search.MolSearch.findNextFiltered(MolSearch.java:1004) at chemaxon.sss.search.MolSearch.findNext(MolSearch.java:928) at com.prenhall.epoch.evals.impl.MapProperty.matchAtLeast_Map(MapProperty.java:332) |
Note that the error occurs in the MolSearch.findNext() command. It's already gone through the findFirst() command without any problem.
However, if we ungroup the Ph groups in the query, no error is thrown, and we get four isomorphisms, as we ought.
Can you reproduce this error? Does it occur in more recent versions of JChem? Is there a workaround available in JChem 3.2.12?