mapping bug?

User 870ab5b546

10-08-2007 16:40:41

The reaction:





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


<MDocument>


  <MChemicalStruct>


    <reaction x1="2.6015551516223105" y1="6.359496797367529" x2="6.833338165833845" y2="6.2855183631921445">


      <propertyList>


        <property dictRef="NAME" title="NAME">


          <scalar><![CDATA[hydroboration, oxidation_stereo]]></scalar>


        </property>


        <property dictRef="REAGENTS" title="REAGENTS">


          <scalar><![CDATA[BH3; then H2O2, base]]></scalar>


        </property>


        <property dictRef="SELECTIVITY" title="SELECTIVITY">


          <scalar><![CDATA[


charge(ratom(1), "pi")


              ]]></scalar>


        </property>


        <property dictRef="EXPLAIN_SELECTIVITY" title="EXPLAIN_SELECTIVITY">


          <scalar><![CDATA[The more negatively pi-charged C will gain the O atom.  Note that the sign on the charge() function is opposite to what is expected.]]></scalar>


        </property>


        <property dictRef="EXPLAIN_REACTIVITY" title="EXPLAIN_REACTIVITY">


          <scalar></scalar>


        </property>


        <property dictRef="EXPLAIN_EXCLUDE" title="EXPLAIN_EXCLUDE">


          <scalar></scalar>


        </property>


        <property dictRef="TOLERANCE" title="TOLERANCE">


          <scalar></scalar>


        </property>


        <property dictRef="EXPLAIN_TOLERANCE" title="EXPLAIN_TOLERANCE">


          <scalar></scalar>


        </property>


        <property dictRef="STANDARDIZATION" title="STANDARDIZATION">


          <scalar><![CDATA[<?xml version="1.0" encoding="UTF-8"?>


<!-- Standardizer configuration file -->


<!-- This configuration file is created with ChemAxon Config Builder -->





<StandardizerConfiguration Version ="1.0">


<Actions>


</Actions>


</StandardizerConfiguration>


]]></scalar>


        </property>


      </propertyList>


      <reactantList>


        <molecule molID="m1">


          <atomArray


              atomID="a1 a2 a3 a4 a5"


              elementType="C C C C C"


              mrvMap="1 2 0 3 4"


              mrvQueryProps="0 0 A: A: A:"


              x2="-0.30241796163212165 -1.8424518427502026 0.46758203836787837 -2.612451842750202 -2.612451842750202"


              y2="6.695844328841227 6.695844328841227 5.3621652070131915 8.029523450669263 5.3621652070131915"


              />


          <bondArray>


            <bond atomRefs2="a1 a2" order="2" />


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


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


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


          </bondArray>


        </molecule>


      </reactantList>


      <productList>


        <molecule molID="m2">


          <atomArray>


            <atom id="a1" elementType="C" mrvMap="1"


                  x2="11.290092738593708" y2="6.440502322157878" />


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


                  x2="9.750058857475628" y2="6.440502322157878" />


            <atom id="a3" elementType="O" mrvMap="5"


                  x2="12.830080572319407" y2="6.44662375800527" />


            <atom id="a4" elementType="C" mrvQueryProps="A:"


                  x2="12.060092738593708" y2="5.106823200329842" />


            <atom id="a5" elementType="C" mrvMap="3" mrvQueryProps="A:"


                  x2="8.975857996984997" y2="7.771747238623503" />


            <atom id="a6" elementType="C" mrvMap="4" mrvQueryProps="A:"


                  x2="8.980058857475628" y2="5.106823200329842" />


            <atom id="a7" elementType="H" mrvMap="6"


                  x2="8.210058857475627" y2="6.440502322157878" />


          </atomArray>


          <bondArray>


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


              <bondStereo>W</bondStereo>


            </bond>


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


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


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


              <bondStereo>W</bondStereo>


            </bond>


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


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


          </bondArray>


        </molecule>


      </productList>


    </reaction>


  </MChemicalStruct>


</MDocument>






The code includes,





Code:
reactor.setOutputReactionMappingStyle(Reactor.MAPPING_STYLE_COMPLETE);






The starting material is CC1=CCCCC1. The calculated product is [H:6][C:2]1([CH3:3])[CH2:4]CC[CH2:7][C@@H:1]1[OH:5]. Note that the calculated product includes a C atom with a map number of 7. Why? There is no such map number in the reaction definition.

ChemAxon e08c317633

14-08-2007 09:17:14

Hi,





It's a known bug, we will correct it.





Use


Code:
reactor.setMappingStyle(0);



before you set the reaction to avoid completing the mapping of the reaction scheme.


Note: this method is deprecated and will be removed in the future.





Se more: http://www.chemaxon.com/jchem/doc/api/chemaxon/reaction/Reactor.html#setMappingStyle(int)








The method


Code:
reactor.setOutputReactionMappingStyle(Reactor.MAPPING_STYLE_COMPLETE);





is designed to work with reaction output. When used with product output then it only transfers the maps of the reaction scheme onto products and it can be used only for "debugging" your reaction definition.





Zsolt

User 870ab5b546

14-08-2007 13:53:32

I wrote a workaround. You can go through the atoms of the reaction definition product, make a list of all the map numbers, then go through the atoms of the Reactor product, check that every map is in the previously made list, and, if not, set it to 0.





A very useful method, by the way, would be





MolAtom[] MoleculeGraph.getAtomsWithMap(int i)





or





int[] MoleculeGraph.getIndicesOfAtomsWithMap(int i)





Right now, you have to go through every atom in the whole molecule looking for a map, and if you're looking for more than one, you need to store the map number and the atom index.