A lot of molecules that could be loaded with and older CDK version, do not work
anymore:
mol <- load.molecules("1.mol")
java.lang.NumberFormatException: For input string: ""
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:493)
at java.lang.Integer.parseInt(Integer.java:514)
at
org.openscience.cdk.io.MDLV2000Reader.readMolecule(MDLV2000Reader.java:542)
at
org.openscience.cdk.io.MDLV2000Reader.readChemFile(MDLV2000Reader.java:217)
at
org.openscience.cdk.io.MDLV2000Reader.read(MDLV2000Reader.java:184)
at org.guha.rcdk.util.Misc.loadMolecules(Misc.java:147)
.mol file
As far as I can tell this is in incorrect mol format. I'd suggest asking people on cdk-user to take a look at it. From the point of rcdk, ersion 3.0.1 did did not read. What was the last version that did?
Then we would have hundreds of broken mol files :(
What do think is wrong with these mol files ? Other programs can read them.
Have tried running them through babel to see if it can clean it up
The V2000 header line is incomplete
The portion following the coordinate entries are missing
I'm not sure whether this is a valid 'old' MOL format - hence my suggestion to ask on the maliing list
Is the information that is missing essential for reading the mol file ?
Or is CDK just very picky ?
I guess I can workaround this problem by converting mol -> mol using babel
before trying to load the mol file with CDK.
Well, it doesn't conform ot the MOL spec - I suppose the CDK is picky, but to be sure I'd suggest taking this to the cdk-user m/l
Ralf, please have a look at this post:
http://chem-bla-ics.blogspot.com/2010/01/validating-mdl-sd-files-and-symyx.html
That should work with 1.3.6...
I get this output using that code:
groovy mdlCheck.groovy 1.mol
location: 5, 35-37: Could not parse mass difference field.
-> For input string: ""
location: 5, 49-52: Could not parse valence information field
-> For input string: ""
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:493)
at java.lang.Integer.parseInt(Integer.java:514)
at org.openscience.cdk.io.MDLV2000Reader.readMolecule(MDLV2000Reader.java:523)
at org.openscience.cdk.io.MDLV2000Reader.read(MDLV2000Reader.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at mdlCheck.run(mdlCheck.groovy:26)
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:263)
at groovy.lang.GroovyShell.run(GroovyShell.java:226)
at groovy.lang.GroovyShell.run(GroovyShell.java:156)
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:494)
at groovy.ui.GroovyMain.run(GroovyMain.java:309)
at groovy.ui.GroovyMain.process(GroovyMain.java:295)
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:112)
at groovy.ui.GroovyMain.main(GroovyMain.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
location: 5, 0-0: Error while parsing line: 25.8300 6.0300 0.0000 C
-> For input string: ""
I'd say there is something wrong with the whitespace at line 5...