#2 JUMBO: Molfile to CML conversion problem

closed
nobody
None
5
2006-12-13
2006-05-24
pmatos
No

Hi,

I'm trying to convert MDL mol files to CML using JUMBO.
For some of my molfiles JUMBO throws a NullPointer when
I use the org.xmlcml.cml.legacy.molecule.MDLConverter.
I have tracked it down to no default "dimensionalCode"
attribute being initialised. It looks to read this
attribute from the header when I call the 'readMol'
method but because it is not a required attribute in
the header of the molfile it will sometimes be missing.
I have read the MDL molfile documentation and it seems
perfectly valid to have 3 blank lines in the header.
This causes a NullPointer later on in the 'readAtoms'
method.

Apologies if I am using the wrong java package to
convert from molfile to CML - I realise that this is in
the legacy package.

I've included the code snippet that I have used and the
molfile that I am trying to parse.

Reader inputReader = new FileReader(inputDir+filename);
OutputStream os = new FileOutputStream(new
File(outputDir+outfilename));
MDLConverter converter = new MDLConverter();
converter.readMOL(inputReader);
converter.writeXML(os);

Thanks,
Paula

Discussion

  • Logged In: YES
    user_id=125666
    Originator: NO

    This is really a bug report.

    I have fixed and committed this. The default is now that it tries to guess the coordinate type from the form of the coordinates

     
    • status: open --> closed
     
  • Logged In: YES
    user_id=125666
    Originator: NO

    This is really a bug report.

    I have fixed and committed this. The default is now that it tries to guess the coordinate type from the form of the coordinates