it seems there are mol files with short atom lines. Although the mdl
spec does not say that fields are optional or so, I think we should
support this. So I made valence reading optional (see bug #288324)
CDK IO has a mechanism for STRICT and RELAXED. The condition you describe is the RELAXED reading, where the files are not read to the letter of the specification... I suggest to code throws an exception when the information is missing and in STRICT mode.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The MDLV2000Reader does now read valencies, the MDLWriter writes them. There are tests for both. Also, the valencies are only tried in STRICT mode, else there may be short lines (see glycine-short-line.mdl example). Commits in cdk git repostory (http://www.ebi.ac.uk/steinbeck-srv/git/cdk/) are 01d9576bff0a7bc9d064f586ccad303a0380d484, 29e2293996a0191f4c6a2c30d0198c020c534bff, 6a13391dbab5d49c52ae06e63b8f6103679aac95
We tried squashing these, but got errors
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Stefan, what does a full example file look like?
Attached an exmple. Marvin reads this, btw, so it seems to be common.
Review report:
Did you also have a patch for the unit test?
CDK IO has a mechanism for STRICT and RELAXED. The condition you describe is the RELAXED reading, where the files are not read to the letter of the specification... I suggest to code throws an exception when the information is missing and in STRICT mode.
The MDLV2000Reader does now read valencies, the MDLWriter writes them. There are tests for both. Also, the valencies are only tried in STRICT mode, else there may be short lines (see glycine-short-line.mdl example). Commits in cdk git repostory (http://www.ebi.ac.uk/steinbeck-srv/git/cdk/) are 01d9576bff0a7bc9d064f586ccad303a0380d484, 29e2293996a0191f4c6a2c30d0198c020c534bff, 6a13391dbab5d49c52ae06e63b8f6103679aac95
We tried squashing these, but got errors
I support this and most other file readers do :-)
Any chance that this gets tested and applied? I'm hesitant to do it inhouse.
Stefan, can you attach an example file?
An example is src/test/data.mdl/glycine-short-line.mdl
I left a question at the Blue Obelisk Exchange:
http://blueobelisk.stackexchange.com/questions/202/proper-mdl-molfile-atom-block-line-format
Patch with the unit test against master.
This also seems to be done.