Why Openbabel output non-standard MDL Molfile (SDF) format?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Why Openbabel output non-standard MDL Molfile (SDF) format?

Charlie Zhu
Hi,

When I tried to reading SDF file generated by Openbabel errors are encountered.
According to Openbabel's wiki this format is following the specification of Symyx CTFile at http://www.symyx.com/downloads/public/ctfile/ctfile.jsp. But I have observed it does not.
The differences are length of atom block and bond block

Standard atom block

  Marvin  11030915522D          

 31 32  0  0  0  0            999 V2000
   -2.4750    0.3241    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -3.1895   -0.0884    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -3.1895   -0.9134    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

Openbabel atom block

 OpenBabel11150908402D

 31 32  0  0  0  0  0  0  0  0999 V2000
   -2.4750    0.3241    0.0000 C   0  0  0  0  0
   -3.1895   -0.0884    0.0000 C   0  0  0  0  0
   -3.1895   -0.9134    0.0000 C   0  0  0  0  0

Standard bond block

  1  2  1  0  0  0  0
  1  6  2  0  0  0  0
  2  3  2  0  0  0  0

Openbabel bond block

  1  2  1  0  0  0
  1  6  2  0  0  0
  1  7  1  0  0  0


Is this a purposely design? Thanks for answering.

Charlie

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Why Openbabel output non-standard MDL Molfile (SDF) format?

Ernst-Georg Schmid
Hi,

this is already a bug with ID 2897107. I didn't notice the short bond
block though.

regards,

ergo

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Why Openbabel output non-standard MDL Molfile (SDF) format?

Geoffrey Hutchison
In reply to this post by Charlie Zhu
> According to Openbabel's wiki this format is following the specification of Symyx CTFile at http://www.symyx.com/downloads/public/ctfile/ctfile.jsp. But I have observed it does not.

I perhaps should adjust the wiki to point out that the CTFile specification has changed repeatedly. I haven't looked at it recently, so I would not be surprised if they added more fields. I see that this one is dated Nov. 2007.

> Openbabel atom block

If you look at the specification, most of these are marked as "ignored when read", query, reaction, or unused. I've definitely seen non-standard SD files with fewer fields.

In any case, we can certainly add some additional padding.

> Standard bond block
> ...
> Openbabel bond block

Here's one from ChemDraw --
  1  2  2  0      

I think the "moral of the story" is that you must expect non-standard SD files when reading.

Cheers,
-Geoff
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Why Openbabel output non-standard MDL Molfile (SDF) format?

Ernst-Georg Schmid
Geoffrey Hutchison schrieb:

> If you look at the specification, most of these are marked as "ignored when read", query, reaction, or unused. I've definitely seen non-standard SD files with fewer fields.

Yes, but as far as I can see, Symyx Programs always set those fields to
zero, which works because zero means 'not specified'. And yes the Symyx
specs are, hm, sometimes unclear. I have seen MDL/Symyx software that
implemented their specification and didn't play nice with the rest of
their toolset, because the spec was different from how all their other
programs actually worked. :-)

I've also seen their Oracle cartridge returning the '\0' of C-Strings -
but not always... :-)

> In any case, we can certainly add some additional padding.
>
>> Standard bond block
>> ...
>> Openbabel bond block

I have appended working code to Bug 2897107.

> Here's one from ChemDraw --
>   1  2  2  0      
>
> I think the "moral of the story" is that you must expect non-standard SD files when reading.

Yes, but when writing you should write _all_ fields and set the unused
ones to zero, to be on the safe side. E.g. Dingo from Indigo does not
accept current OpenBabel Molfiles because of missing fields. That's why
I've made the patches in the first place.

best regards,

Ernst-Georg



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss