Hi Egon
Yes, I can do that - but, having looked at the source code,
the problem with the MDLV3000Reader appears to be quite simple.
Here's the 'Read' method:
public <T extends IChemObject> T read(T object) throws CDKException {
if (object instanceof IAtomContainer) {
return (T)readMolecule(object.getBuilder());
}
return null;
}
Obviously, attempting to read into any object but an IAtomContainer is not
going to get you very far! It seems to me that code which apparently
accepts any object - but actually fails silently (no exception thrown)
for anything except one type of object is a bit strange.
I modified my own code to pre-parse the SDF file into strings corresponding
to mol files then used the read method of the MDLV3000Reader with these
and it worked fine. It doesn't look like the 1.4.8 version of the
MDLV3000Reader is designed to take SDF files unlike MDLV2000Reader?
I will send a test file for the Iterating MDL Reader..
Best wishes
Kevin
-----Original Message-----
From: Egon Willighagen [mailto:[email protected]]
Sent: 02 May 2012 07:27
To: Lawson Kevin GBJH
Cc: [email protected]
Subject: Re: [Cdk-user] MDLV3000Reader
On Thu, Apr 26, 2012 at 5:21 PM, <[email protected]> wrote:
> BTW I am using cdk-1.4.8. Have also tried the Iterating MDL Reader. This
> also fails for V3000 files but works for V2000 files. However, if I use
> cdk-1.4.2 then the iterating reader works fine for both V3000 and v2000
> files (whereas MDLV3000Reader still fails when applied as below)
There has been some work on the SDF reader to fix something else,
which seemed to have introduced a regression...
Can you make a unit test with a dummy SD file? Or send me a test file
offline privately?
Egon
--
Dr E.L. Willighagen
Postdoctoral Researcher
Department of Bioinformatics - BiGCaT
Maastricht University (http://www.bigcat.unimaas.nl/)
Homepage: http://egonw.github.com/
LinkedIn: http://se.linkedin.com/in/egonw
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers
This message may contain confidential information. If you are not the
designated recipient, please notify the sender immediately, and delete the
original and any copies. Any use of the message by you is prohibited.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user