User 870ab5b546
20-08-2007 13:51:43
Hi,
I have written a method that generates the stereoisomers of a compound with unspecified tetrahedral stereocenters.
I begin by altering each regular single bond to a wedge, calculating the parity of atom1 of the bond, and seeing if it is nonzero. I see that according to the MDL documentation, parity will be nonzero if there are two identical groups, one of them has the highest atom number, and the wedge points to neither, as in the following compound:
However, I am also getting that atom 13 in the following compound has an odd parity:
It's attached to three F atoms! How can it possibly have nonzero parity?
Furthermore, in this compound, I am getting a parity of 32 for S (which is expected, given the above-mentioned quirk of the parity definition):
Yet when I try to set the parity of the S atom in the compound below to 32, I get a runtime error. The relevant code is:
The log output is:
Why am I getting the ArrayIndexOutOfBoundsException? I am not submitting -1, so something in the setParity() method must be calculating it.
Finally, I am using parity as a surrogate for stereogenicity, but clearly, it's not working all that well. Do you have any other suggestions?
I have written a method that generates the stereoisomers of a compound with unspecified tetrahedral stereocenters.
I begin by altering each regular single bond to a wedge, calculating the parity of atom1 of the bond, and seeing if it is nonzero. I see that according to the MDL documentation, parity will be nonzero if there are two identical groups, one of them has the highest atom number, and the wedge points to neither, as in the following compound:
Code: |
<?xml version="1.0" ?> <MDocument> <MChemicalStruct> <molecule molID="m1"> <atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9" elementType="C C C C C C O C C" x2="-6.159999847412109 -7.493669188460368 -7.493669188460368 -6.159999847412109 -4.826330506363851 -4.826330506363851 -3.492651384535815 -3.49264649422662 -4.826330506363851" y2="1.106908891846917 0.3368919512878765 -1.2031419298302044 -1.9731588703892449 -1.2031419298302044 0.3368919512878765 1.1068919512878765 -1.9731334595040957 -2.7431419298302044" /> <bondArray> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a1 a6" order="1" /> <bond atomRefs2="a2 a3" order="1" /> <bond atomRefs2="a3 a4" order="1" /> <bond atomRefs2="a5 a4" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a5 a6" order="1" /> <bond atomRefs2="a5 a8" order="1" /> <bond atomRefs2="a5 a9" order="1" /> <bond atomRefs2="a6 a7" order="2" /> </bondArray> </molecule> </MChemicalStruct> </MDocument> |
However, I am also getting that atom 13 in the following compound has an odd parity:
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" elementType="C C C C C C O C C S O O C F F F" mrvMap="3 0 0 0 0 1 2 0 0 5 6 7 8 9 10 11" x2="-6.159999847412109 -7.493669188460368 -7.493669188460368 -6.159999847412109 -4.826330506363851 -4.826330506363851 -3.492651384535815 -3.49264649422662 -4.826330506363851 -2.965214810371399 -2.965214810371399 -2.965214810371399 -1.4252148103713989 -0.6552148103713986 0.11478518962860118 -0.6552148103713986" y2="1.106908891846917 0.3368919512878765 -1.2031419298302044 -1.9731588703892449 -1.2031419298302044 0.3368919512878765 1.1068919512878765 -1.9731334595040957 -2.7431419298302044 0.3843216300010681 1.9243216300010682 -1.155678369998932 0.3843216300010681 1.7180007518291036 0.3843216300010681 -0.9493574918269674" /> <bondArray> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a6 a1" order="2" /> <bond atomRefs2="a2 a3" order="1" /> <bond atomRefs2="a3 a4" order="1" /> <bond atomRefs2="a5 a4" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a5 a6" order="1" /> <bond atomRefs2="a5 a8" order="1" /> <bond atomRefs2="a5 a9" order="1" /> <bond atomRefs2="a6 a7" order="1" /> <bond atomRefs2="a7 a10" order="1" /> <bond atomRefs2="a10 a12" order="2" /> <bond atomRefs2="a10 a11" order="2" /> <bond atomRefs2="a13 a10" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a13 a15" order="1" /> <bond atomRefs2="a13 a14" order="1" /> <bond atomRefs2="a13 a16" order="1" /> </bondArray> </molecule> </MChemicalStruct> </MDocument> |
It's attached to three F atoms! How can it possibly have nonzero parity?
Furthermore, in this compound, I am getting a parity of 32 for S (which is expected, given the above-mentioned quirk of the parity definition):
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" elementType="C C C C C C O C C S O O C F F F" mrvMap="3 0 0 0 0 1 2 0 0 5 6 7 8 9 10 11" x2="-6.159999847412109 -7.493669188460368 -7.493669188460368 -6.159999847412109 -4.826330506363851 -4.826330506363851 -3.492651384535815 -3.49264649422662 -4.826330506363851 -2.965214810371399 -2.965214810371399 -2.965214810371399 -1.4252148103713989 -0.6552148103713986 0.11478518962860118 -0.6552148103713986" y2="1.106908891846917 0.3368919512878765 -1.2031419298302044 -1.9731588703892449 -1.2031419298302044 0.3368919512878765 1.1068919512878765 -1.9731334595040957 -2.7431419298302044 0.3843216300010681 1.9243216300010682 -1.155678369998932 0.3843216300010681 1.7180007518291036 0.3843216300010681 -0.9493574918269674" /> <bondArray> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a6 a1" order="2" /> <bond atomRefs2="a2 a3" order="1" /> <bond atomRefs2="a3 a4" order="1" /> <bond atomRefs2="a5 a4" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a5 a6" order="1" /> <bond atomRefs2="a5 a8" order="1" /> <bond atomRefs2="a5 a9" order="1" /> <bond atomRefs2="a6 a7" order="1" /> <bond atomRefs2="a10 a7" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a10 a12" order="2" /> <bond atomRefs2="a10 a11" order="2" /> <bond atomRefs2="a10 a13" order="1" /> <bond atomRefs2="a13 a15" order="1" /> <bond atomRefs2="a13 a14" order="1" /> <bond atomRefs2="a13 a16" order="1" /> </bondArray> </molecule> </MChemicalStruct> </MDocument> |
Yet when I try to set the parity of the S atom in the compound below to 32, I get a runtime error. The relevant code is:
Code: |
println("Cleaning stereo of:\n" + reactorProd.toFormat("mrv")); ... for (int atmIdx = 0; atmIdx < numAtoms; atmIdx++) if (parities[atmIdx] != 0) { println("stereoClean: Setting parity of atom " + (atmIdx + 1) + " to " + parities[atmIdx]); reactorProd.setParity(atmIdx, parities[atmIdx]); } // if the parity must be altered |
The log output is:
Code: |
Cleaning stereo of: <?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" elementType="C C C C C C O C C S O O C F F F" mrvMap="3 0 0 0 0 1 2 0 0 5 6 7 8 9 10 11" x2="-6.159999847412109 -7.493669188460368 -7.493669188460368 -6.159999847412109 -4.826330506363851 -4.826330506363851 -3.492651384535815 -3.49264649422662 -4.826330506363851 -2.965214810371399 -2.965214810371399 -2.965214810371399 -1.4252148103713989 -0.6552148103713986 0.11478518962860118 -0.6552148103713986" y2="1.106908891846917 0.3368919512878765 -1.2031419298302044 -1.9731588703892449 -1.2031419298302044 0.3368919512878765 1.1068919512878765 -1.9731334595040957 -2.7431419298302044 0.3843216300010681 1.9243216300010682 -1.155678369998932 0.3843216300010681 1.7180007518291036 0.3843216300010681 -0.9493574918269674" /> <bondArray> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a6 a1" order="2" /> <bond atomRefs2="a2 a3" order="1" /> <bond atomRefs2="a3 a4" order="1" /> <bond atomRefs2="a5 a4" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a5 a6" order="1" /> <bond atomRefs2="a5 a8" order="1" /> <bond atomRefs2="a5 a9" order="1" /> <bond atomRefs2="a6 a7" order="1" /> <bond atomRefs2="a10 a7" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a10 a12" order="2" /> <bond atomRefs2="a10 a11" order="2" /> <bond atomRefs2="a13 a10" order="1"> <bondStereo>W</bondStereo> </bond> <bond atomRefs2="a13 a15" order="1" /> <bond atomRefs2="a13 a14" order="1" /> <bond atomRefs2="a13 a16" order="1" /> </bondArray> </molecule> </MChemicalStruct> </MDocument> stereoClean: atom 10's new parity = 32 stereoClean: Setting parity of atom 10 to 32 pasteSynthTest.jsp: Exception caught: products is null. -1 java.lang.ArrayIndexOutOfBoundsException: -1 at chemaxon.marvin.modules.Parity.putToTheTop(Parity.java:2719) at chemaxon.marvin.modules.Parity.setupStereoBonds(Parity.java:855) at chemaxon.marvin.modules.Parity.setParity(Parity.java:652) at chemaxon.marvin.modules.Parity.modfunc(Parity.java:144) at chemaxon.struc.MoleculeGraph.setParity(MoleculeGraph.java:1972) at chemaxon.struc.MoleculeGraph.setParity(MoleculeGraph.java:1896) at com.prenhall.epoch.chem.MolFunctions.stereoClean(MolFunctions.java:1625) |
Why am I getting the ArrayIndexOutOfBoundsException? I am not submitting -1, so something in the setParity() method must be calculating it.
Finally, I am using parity as a surrogate for stereogenicity, but clearly, it's not working all that well. Do you have any other suggestions?