parity problems

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:





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?

ChemAxon 7c2d26e5cf

22-08-2007 09:28:07

We will check it.


By the way, which Marvin version do you use?

User 870ab5b546

22-08-2007 11:56:25

Marvin 4.1.6, JChem 3.2.6.

ChemAxon 25dcd765a3

22-08-2007 15:25:06

Before going into more detail, I could not reproduce the first bug you mentioned:
Quote:
However, I am also getting that atom 13 in the following compound has an odd parity: ...
I have printed out the parity and the chirality of the given molecule using the following code:


Code:
         


for (int i=0; i<m.getAtomCount(); i++){


  int c = m.getChirality(i);


  System.out.println(i


  +" Parity "+m.getParity(i)


  +" Chirality "+


  ((c == StereoConstants.CHIRALITY_R) ? "R" :


    (c == StereoConstants.CHIRALITY_S) ? "S" : (""+c))


   );


}





And my result is the following:
Quote:



0 Parity 0 Chirality 0


1 Parity 0 Chirality 0


2 Parity 0 Chirality 0


3 Parity 0 Chirality 0


4 Parity 0 Chirality 0


5 Parity 0 Chirality 0


6 Parity 0 Chirality 0


7 Parity 0 Chirality 0


8 Parity 0 Chirality 0


9 Parity 0 Chirality 0


10 Parity 0 Chirality 0


11 Parity 0 Chirality 0


12 Parity 0 Chirality 0


13 Parity 0 Chirality 0


14 Parity 0 Chirality 0


15 Parity 0 Chirality 0


So, as you can see the 13th atom has also parity value 0 as the other atoms.





Lets try to find what is the difference between the two code, so we can step further.


Andras

User 870ab5b546

22-08-2007 23:30:11

I am using:





Code:
int parity = substrateMol.getLocalParity(j);






Local parity, not global.

ChemAxon 25dcd765a3

23-08-2007 08:06:33

The local parity does something different:


http://www.chemaxon.com/marvin/doc/api/chemaxon/struc/MoleculeGraph.html#getLocalParity(int)





Computes the local parity of an atom of the Molecule instance based on both the coordinates of the neighbouring atoms and the stereo information of the bonds to those. The molecule symmetry is not checked, so even an atom with same ligands can have parity.





Returns:


PARITY_ODD or PARITY_EVEN for atoms of odd or even parity, PARITY_EITHER for atoms with wiggly bond 0 for atoms whose parity is unspecified or not known.





So even isobutane can have local parity if wedges are drawn.





C[C@@H](C)C


0 localParity 0


1 localParity 16


2 localParity 0


3 localParity 0





I hope this helps.


Andras

User 870ab5b546

23-08-2007 11:20:17

OK, that explains why I am getting parities for nonstereogenic atoms, but why am I getting an exception when I try to set the parity of S to 32?

User 870ab5b546

23-08-2007 12:55:15

Also, why does getParity() return a value of "either" for C7 in the following compound? (getLocalParity() correctly returns "none".)





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1" absStereo="true">


      <atomArray>


        <atom id="a1" elementType="O"


              x2="-2.671877104558258" y2="-0.5482128118702955" />


        <atom id="a2" elementType="C"


              x2="-1.1318771045582574" y2="-0.5482128118702957" />


        <atom id="a3" elementType="C"


              x2="-0.2266878160278496" y2="-1.7940989832077143" />


        <atom id="a4" elementType="C"


              x2="1.2379392190666871" y2="-1.3182128118702958" />


        <atom id="a5" elementType="C"


              x2="1.2379392190666876" y2="0.22178718812970433" />


        <atom id="a6" elementType="O"


              x2="2.483825390404106" y2="1.1269764766601127" />


        <atom id="a7" elementType="C"


              x2="-0.2266878160278487" y2="0.6976733594671233" />


        <atom id="a8" elementType="O"


              x2="-0.7025739873652674" y2="2.16230039456166" />


      </atomArray>


      <bondArray>


        <bond atomRefs2="a2 a1" order="1">


          <bondStereo>H</bondStereo>


        </bond>


        <bond atomRefs2="a2 a3" order="1" />


        <bond atomRefs2="a3 a4" order="1" />


        <bond atomRefs2="a4 a5" order="1" />


        <bond atomRefs2="a5 a6" order="1">


          <bondStereo>W</bondStereo>


        </bond>


        <bond atomRefs2="a5 a7" order="1" />


        <bond atomRefs2="a2 a7" order="1" />


        <bond atomRefs2="a7 a8" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>

ChemAxon 25dcd765a3

23-08-2007 19:08:08

localParity returns "none" because the given atom has no wedge.


It returns "none" for atoms whose parity is unspecified (has no wedge in 2D) or not known.


The "either" value from getParity() is a bug. We cannot handle correctly topographically different ligands.





The parity setting bug is fixed in marvin 4.1.11. (but thank you for the report !).





Andras

User 870ab5b546

23-08-2007 19:17:34

OK, I can handle Marvin thinking that C7 is a stereocenter, as long as wedge-up and wedge-down are recognized as identical compounds (which they are). But still, it would be nice if the bug were fixed.





Glad to hear the parity-setting bug is fixed.

ChemAxon 25dcd765a3

24-08-2007 15:21:56

We have to finish some project before starting to work on topographically different ligands.


But it is the list with high priority.