ID and Class attributes are mandatory for the Matching eleme

User 870ab5b546

28-08-2008 19:40:37

We recently upgraded to JChem 5.0. We are getting a new ReactionException:





Code:
chemaxon.reaction.ReactionException: ID and Class attributes are mandatory for the Matching element


        at chemaxon.reaction.Reaction.setReactivityRule(Reaction.java:583)


        at chemaxon.reaction.Reactor.createReactionObject(Reactor.java:1287)


        at chemaxon.reaction.Reactor.createReactionObject(Reactor.java:1232)


        at chemaxon.reaction.Reactor.createReactionObject(Reactor.java:1188)


        at chemaxon.reaction.Reactor.setReaction(Reactor.java:1013)


        at chemaxon.reaction.Reactor.setReaction(Reactor.java:995)


        at com.prenhall.epoch.synthesis.SynthSolver$SingleRxnSolver.calcProducts(SynthSolver.java:505)






Can you tell us what this exception means, and how we might avoid throwing it? The offending reaction definition is below.





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


<cml>


<MDocument>


  <MChemicalStruct>


    <reaction>


      <arrow type="DEFAULT" x1="7.312108365836083" y1="1.40645996495316" x2="11.02903036549437" y2="0.9168924705150414" />


      <propertyList>


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


          <scalar><![CDATA[intramolecular Friedel-Crafts acylation]]></scalar>


        </property>


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


          <scalar>-energyE(ratom(1))</scalar>


        </property>


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


          <scalar><![CDATA[Aromatic carbon with the lowest localization energy provides the main product. ]]></scalar>


        </property>


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


          <scalar>0.02</scalar>


        </property>


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


          <scalar><![CDATA[Other aromatic carbons having similar localization energies (with less difference than 0.02) are also considered to lead to main products.]]></scalar>


        </property>


        <property dictRef="EXCLUDE" title="EXCLUDE">


          <scalar><![CDATA[(match(ratom(3), "[O:1]", 1) && !match(ratom(3), "O=C[O:1]C=O", 1)) || (match(reactant(0), "[Cl,Br,I]C(=[O,S])C=C") ||


match(reactant(0), "[H][O,S]C=[O,S]") ||


match(reactant(0), "[P][H]") ||


(max(pka(reactant(0), filter(reactant(0), "match('[O,S;H1]')"), "acidic")) > 14.5) ||


(max(pka(reactant(0), filter(reactant(0), "match('[#7:1][H]', 1)"), "basic")) > 0)) || dreidingEnergy(product(0)) > 100]]></scalar>


        </property>


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


          <scalar><![CDATA[We would like to avoid generating simple Friedel-Crafts products from acryloyl halides (reactant(1)), since it can result indanone derivatives owing to ring closure. Aromatic reaction components having carboxylic groups and their thio-analogues can destroy the Lewis acid catalyst, so we exclude them. Furthermore, the aromatic components should not contain nucleophilic groups like PH or OH and SH compounds with higher pKa than 14.5, or NH compounds with higher pKb than 0, because they could easily be acylated on their nucleophilic groups instead of the aromatic ring according to the Friedel-Crafts mechanism. The pKa calculation based rule excludes alcohols, thiols, amines and anilines, but permits the Friedel-Crafts acylation of phenols and many nitrogen heterocycles. ]]></scalar>


        </property>


      </propertyList>


      <reactantList>


        <molecule molID="m1">


          <atomArray


              atomID="a1 a2 a3 a4 a5 a6 a7 a8"


              elementType="C H C C C O O C"


              mrvMap="1 4 0 0 0 3 0 2"


              mrvQueryProps="a1 0 A: A: A: L,O,Cl,Br,I: L,O,S: L,C,S:"


              mrvLinkNodeRep="1 1 2 1 1 1 1 1"


              mrvLinkNodeOut="- - a5,a4 - - - - -"


              x2="1.393971433471044 0.025573333333333337 2.9068769216537476 4.125003289613156 1.317619196613525 4.180489179521978 5.477546666666668 4.143813333333334"


              y2="1.9905553678194683 0.8978666666666667 3.9427971839904785 2.994381013982418 3.6077725966375125 -0.4768698781998424 1.8326933333333335 1.0626933333333335"


              />


          <bondArray>


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


            <bond atomRefs2="a1 a5" order="A" />


            <bond atomRefs2="a3 a5" order="1" queryType="Any" />


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


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


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


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


          </bondArray>


        </molecule>


      </reactantList>


      <productList>


        <molecule molID="m2">


          <atomArray


              atomID="a1 a2 a3 a4 a5 a6"


              elementType="C C C C O C"


              mrvMap="0 0 0 1 0 2"


              mrvQueryProps="A: A: A: a1 L,O,S: L,C,S:"


              mrvLinkNodeRep="2 1 1 1 1 1"


              mrvLinkNodeOut="a3,a2 - - - - -"


              x2="12.830789566040039 13.65271360027087 13.65271360027087 15.148560000000002 16.49106666666667 15.157520000000003"


              y2="0.24161411821842194 1.6906542444557233 -1.284397300514607 -0.6664000000000001 1.7778133333333337 1.0078133333333334"


              />


          <bondArray>


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


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


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


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


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


            <bond atomRefs2="a6 a5" order="2" />


          </bondArray>


        </molecule>


      </productList>


    </reaction>


  </MChemicalStruct>


</MDocument>


</cml>

ChemAxon e08c317633

29-08-2008 09:24:23

bobgr wrote:
We recently upgraded to JChem 5.0. We are getting a new ReactionException:





Code:
chemaxon.reaction.ReactionException: ID and Class attributes are mandatory for the Matching element


        at chemaxon.reaction.Reaction.setReactivityRule(Reaction.java:583)


        at chemaxon.reaction.Reactor.createReactionObject(Reactor.java:1287)


        at chemaxon.reaction.Reactor.createReactionObject(Reactor.java:1232)


        at chemaxon.reaction.Reactor.createReactionObject(Reactor.java:1188)


        at chemaxon.reaction.Reactor.setReaction(Reactor.java:1013)


        at chemaxon.reaction.Reactor.setReaction(Reactor.java:995)


        at com.prenhall.epoch.synthesis.SynthSolver$SingleRxnSolver.calcProducts(SynthSolver.java:505)
Do you mean JChem 5.1?





In the 5.1 version the syntax of the evaluator.xml (contains Chemical Terms function definitions) has changed slightly, the "Matching" and "Dissimilarity" elements in the xml have to have a Class attribute.





Earlier, in this forum post I suggested to add a few lines to the <Plugins> section of the built in evaluator.xml file, and copy the modified file to the .chemaxon (UNIX / Linux) or chemaxon (Windows) subdirectory in your user's home directory. I think you still use that file, so the "Matching" and "Dissimilarity" elements in evaluator.xml file in your user's home directory do not contain Class attributes, that's why the exception is thrown.





From version 5.0 the evaluator.xml file in user home directory has to contain only the user defined functions, and these are added to the built-in functions (if a user defined function has the same name, then it overrides the built-in function).





So the solution for you is: delete all function definitions from the evaluator.xml file in your user's home directory, except the ones you added. Example evaluator.xml file (it only contains dynamicpKa function definition):


Code:
<?xml version="1.0" encoding="UTF-8"?>


<EvaluatorConfiguration Version ="0.1">


    <Plugins>


        <Plugin ID="dynamicpKa" Class="chemaxon.marvin.calculations.pKaPlugin" JAR="pKaPlugin.jar">


            <Param Name="prefix" Value="dynamic"/>


            <Param Name="min" Value="-1000"/>


            <Param Name="max" Value="1000"/>


        </Plugin>


    </Plugins>


</EvaluatorConfiguration>



The evaluator.xml file (from version 5.0) also can be paced to jchem/config directory. In this case the Chemical Terms functions defined in the xml can be accessed by all users who use JChem (if the evaluator.xml is in the user's home directory, then the functions in it can be accessed only by the owner of the file).





I hope this helps.





Zsolt

User 870ab5b546

29-08-2008 14:09:28

I understand, mostly.





We run both JChem 5.1.0 and JChem 3.2.12 on our server. Can we move the old version of evaluator.xml into jchem3.2.12/config, and put the new version of evaluator.xml into jchem5.1.0/config? Or does JChem 3.2.12 require that evaluator.xml be in root/.chemaxon?





If JChem 3.2.12 requires that evaluator.xml be in root/.chemaxon, and we have the new version of evaluator.xml in jchem5.1.0/config, which version of evaluator.xml will JChem 5.1.0 use: the new one in jchem5.1.0/config or the old one in root/.chemaxon?

ChemAxon e08c317633

29-08-2008 16:19:11

bobgr wrote:
We run both JChem 5.1.0 and JChem 3.2.12 on our server. Can we move the old version of evaluator.xml into jchem3.2.12/config, and put the new version of evaluator.xml into jchem5.1.0/config? Or does JChem 3.2.12 require that evaluator.xml be in root/.chemaxon?
JChem 3.2.12 is not looking for config file in jchem3.2.12/config directory, it reads only the built in config file (located in jchem.jar) or the config file in the user's home directory. If there is a config file in the user's home directory, then the built in config file is ignored.
Quote:
If JChem 3.2.12 requires that evaluator.xml be in root/.chemaxon, and we have the new version of evaluator.xml in jchem5.1.0/config, which version of evaluator.xml will JChem 5.1.0 use: the new one in jchem5.1.0/config or the old one in root/.chemaxon?
From JChem 5.0 all three config files are used in all cases. The built-in config file is read first, then the config file in jchem/config directory, and then the config file in user's home directory (the order is important). The functions defined in a config file are added to the previously defined ones, if a function has the same name as a previously defined function, then it overrides the previously defined function.





So using the same config files with these two JChem versions (3.2.12 and 5.1) is not recommended.





Zsolt

User 870ab5b546

29-08-2008 16:27:42

I figured out a workaround. I modified root/.chemaxon/evaluator.xml to include the Class attributes for Matching and Dissimilarity:





Code:
<Matching ID="match" Class="chemaxon.jep.function.Match">


...


<Matching ID="matchCount" Class="chemaxon.jep.function.Match" Type="count">


...


<Dissimilarity ID="dissimilarity" Class="chemaxon.jep.function.Dissimilarity">






The addition doesn't bother JChem 3.2.





I had to unzip jchem.jar to find the built-in evaluator.xml so I could find the proper values for the Class attributes.

User 870ab5b546

29-08-2008 17:27:57

Getting a 404 error when I try to go to /marvin/help/chemicalterms/Evaluator_files/evaluator.xml.txt from http://www.chemaxon.com/marvin/help/chemicalterms/Evaluator.html.

ChemAxon e08c317633

01-09-2008 10:02:36

bobgr wrote:
I figured out a workaround. I modified root/.chemaxon/evaluator.xml to include the Class attributes for Matching and Dissimilarity: ...
Nice workaround.





To avoid these kind of problems, from version 5.1.1 the evaluator config files defined by the user will be read from $HOME/.chemaxon/MARVIN_MAJOR_VERSION (UNIX / Linux) or $HOME/chemaxon/MARVIN_MAJOR_VERSION (Windows) directory, where $HOME is the user's home directory, and MARVIN_MAJOR_VERSION is the major version of Marvin (e.g. "5.1").





Zsolt