Hi Tim,

V3000 reader doesn't accept ChemFiles, if you want to be squeaky clean try '
reader.accepts(IChemFile.class)':
https://github.com/cdk/cdk/blob/39e87cafae1f044c16dd101e7a8bd7e1ccb00fa3/storage/io/src/main/java/org/openscience/cdk/io/MDLV3000Reader.java#L130-L139


Although it could read ChemFiles the first thing you do is unpack the
ChemFile into a list of AtomContainers and so it's just bloat here. With
the V2000 you can read sequentially if you have an SDfile:

List<IAtomContainer> mols;
> IAtomContainer mol;
> while ((mol = reader.read(new AtomContainer()) != null) {
>   mols.add(mol);
> }
>

Don't think that work with V3000 though but think it's the better option.

Ultimately it's silly that V2000 and V3000 are considered different but
haven't had time to put them in a single 'MolfileReader' yet.

Regards,
John W May
john.wilkinson...@gmail.com

On 19 January 2016 at 17:07, Tim Dudgeon <tdudgeon...@gmail.com> wrote:

> Hi All,
>
> I encountered an inconsistency when reading MDL molfiles.
> What works for the MDLV2000Reader blows up for the MDLV3000Reader with an
> NPE.
> This is illustrated in this GIST:
> https://gist.github.com/tdudgeon/08a858da05c958527242
>
> Note: if I use the reader to read a single molecule using:
> IAtomContainer mol = reader.read(new AtomContainer())
> it works OK, which would be OK in this particular case, but I suppose the
> behaviours should be consistent.
>
> Tim
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Cdk-user mailing list
> Cdk-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to