new exception

User 870ab5b546

25-06-2014 20:16:47

I have a Molecule whose MRV is:


<?xml version="1.0" encoding="UTF-8"?>
<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/help/formats/schema/mrvSchema_6_2_0.xsd" version="ChemAxon file format v6.2, generated by v6.3.1">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray>
<atom id="a1" elementType="C" x2="-8.808333396911621" y2="5.623367373397134"/>
<atom id="a2" elementType="C" x2="-10.142002737959880" y2="4.853350432838093"/>
<atom id="a3" elementType="C" formalCharge="1" x2="-10.142002737959880" y2="3.3133165517200123"/>
<atom id="a4" elementType="C" x2="-8.808333396911621" y2="2.543299611160972"/>
<atom id="a5" elementType="C" x2="-7.474664055863363" y2="3.3133165517200123"/>
<atom id="a6" elementType="C" x2="-7.474664055863363" y2="4.853350432838093"/>
<atom id="a7" elementType="H" x2="-11.475681859787915" y2="2.543316551720012"/>
<atom id="a8" elementType="H" x2="-11.475686750097111" y2="5.623341962511985"/>
<atom id="a9" elementType="H" x2="-8.808333396911621" y2="7.163367373397134"/>
<atom id="a10" elementType="H" x2="-6.704664055863362" y2="1.9796374298919768"/>
<atom id="a11" elementType="H" x2="-8.808333396911621" y2="1.0032996111609718"/>
<atom id="a12" elementType="C" x2="-6.140980043726132" y2="5.623341962511985"/>
<atom id="a13" elementType="N" x2="-5.341875076293945" y2="-1.8768750429153442"/>
<atom id="a14" elementType="O" formalCharge="1" x2="-5.341875076293945" y2="-0.3368750429153442">
<scalar id="a14.prop1" title="paired electrons" convention="atomprop" dataType="xsd:integer">2</scalar>
</atom>
<atom id="a15" elementType="O" x2="-4.008195954465910" y2="-2.6468750429153443">
<scalar id="a15.prop1" title="paired electrons" convention="atomprop" dataType="xsd:integer">4</scalar>
</atom>
<atom id="a16" elementType="O" formalCharge="-1" x2="-6.675554198121981" y2="-2.6468750429153447">
<scalar id="a16.prop1" title="paired electrons" convention="atomprop" dataType="xsd:integer">6</scalar>
</atom>
<atom id="a17" elementType="H" x2="-3.513124942779541" y2="-0.09624999761581421"/>
</atomArray>
<bondArray>
<bond id="b1" atomRefs2="a1 a2" order="1"/>
<bond id="b2" atomRefs2="a1 a6" order="2"/>
<bond id="b3" atomRefs2="a1 a9" order="1"/>
<bond id="b4" atomRefs2="a2 a3" order="1"/>
<bond id="b5" atomRefs2="a2 a8" order="1"/>
<bond id="b6" atomRefs2="a3 a4" order="1"/>
<bond id="b7" atomRefs2="a3 a7" order="1"/>
<bond id="b8" atomRefs2="a4 a5" order="2"/>
<bond id="b9" atomRefs2="a4 a11" order="1"/>
<bond id="b10" atomRefs2="a5 a6" order="1"/>
<bond id="b11" atomRefs2="a5 a10" order="1"/>
<bond id="b12" atomRefs2="a6 a12" order="1"/>
<bond id="b13" atomRefs2="a13 a14" order="1"/>
<bond id="b14" atomRefs2="a13 a15" order="2"/>
<bond id="b15" atomRefs2="a13 a16" order="1"/>
<bond id="b16" atomRefs2="a14 a17" order="1"/>
<bond id="b17" atomRefs2="a2 a13" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>

When using JChem 6.3.1, when I try to convert it into SMARTS, I get an exception with this trace:


Jun 25, 2014 4:08:43 PM org.apache.catalina.core.StandardWrapperValve invoke
INFO: chemaxon.marvin.io.MolExportException: Only java.lang.String objects are supported as atom properties in cxsmiles and cxsmarts export.
at chemaxon.marvin.io.formats.smiles.CxsmilesExport.writeAtomProperties(CxsmilesExport.java:1109)
at chemaxon.marvin.io.formats.smiles.CxsmilesExport.convert(CxsmilesExport.java:921)
at chemaxon.formats.MolExporter.exportToObject(MolExporter.java:1353)
at chemaxon.formats.MolExporter.exportToObject(MolExporter.java:1297)
at chemaxon.formats.MolExporter.exportToFormat(MolExporter.java:1181)
at com.epoch.chem.MolString.toString(MolString.java:165)
at com.epoch.mechanisms.MechSolver.lookForInvalidProducts(MechSolver.java:672)
at com.epoch.mechanisms.MechSolver.getProducts(MechSolver.java:145)
at com.epoch.mechanisms.MechSolver.getProducts(MechSolver.java:103)
at com.epoch.mechanisms.MechStage.calculateFlowProducts(MechStage.java:390)
at com.epoch.mechanisms.Mechanism.processFlows(Mechanism.java:323)
at com.epoch.mechanisms.Mechanism.classifyMolecules(Mechanism.java:280)
at com.epoch.mechanisms.Mechanism.getAllResponseProducts(Mechanism.java:196)
at com.epoch.evals.impl.chemEvals.mechEvals.MechProdStartIs.isResponseMatching(MechProdStartIs.java:150)
at com.epoch.evals.Subevaluator.isResponseMatching(Subevaluator.java:119)
at com.epoch.evals.Evaluator.matchResponse(Evaluator.java:246)
at com.epoch.qBank.Question.evaluateResponse(Question.java:1139)
at com.epoch.session.HWSession.submitResponse(HWSession.java:973)
at org.apache.jsp.homework.answerPreview_jsp._jspService(answerPreview_jsp.java:518)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsupportedOperationException: Only java.lang.String objects are supported as atom properties in cxsmiles and cxsmarts export.

This exception is not thrown when I use JChem 6.2.1.


I don't understand what is your purpose in introducing this restriction in JChem 6.3.1. Why should Integer objects (or Doubles, or Characters, or any number of other Objects) not be supported as atom properties in cxsmiles and cxsmarts export? 

-- Bob

ChemAxon 712bc8fcf4

26-06-2014 08:41:11

Hi Bob,


From 6.3 cxsmarts and cxsmiles export supports atom properties, but only the string type properties. Your mrv file contains integer type properties, you can switch off the atom properties export with the -A parameter.


MolExporter.exportToFormat(mol, "cxsmarts: -A");

Best regards
Mate