Parity and Stereo with Open Babel

Q

Cam Open Babel support stereoinformation represented by the Parity Code and Stereo Code in SDF/Mol files?

✍: Guest

A

Yes. Open Babel can support stereoinformation represented by the Parity Code and Stereo Code in SDF/Mol files.

But you should use Open Babel 2.4.1 and newer versions. Open Babel 2.3.1 seems to have a bug that reads the Stereo Code incorrectly. See the difference of two SVG diagrams generated by Open Babel 2.4.1 (left) and Open Babel 2.3.1 (right).

new$ obabel -V
Open Babel 2.4.1 -- May 25 2020 -- 08:24:13

fyicenter$ obabel L-Alanine.sdf -o svg -O L1.svg -xi --title "v2.4.1"

old$ obabel -V
Open Babel 2.3.1 -- Oct 13 2011 -- 15:14:48

fyicenter$ obabel L-Alanine.sdf -o svg -O L2.svg -xi --title "v2.3.1"
Open Babel 2.3.1 Bug on Stereo Code
Open Babel 2.3.1 Bug on Stereo Code

As you can see, Open Babel 2.3.1 shows the wedge on bond #1, but the stereo code is given on bond #2 in the SDF/Mol file, L-Alanine.sdf:

fyicenter$ cat L-Alanine.sdf
L-Alanine
CTFile Formats, 2003
123456789012345678901234567890123456789012345678901234567890
  6  5  0  0  1  0              3 V2000
   -0.6622    0.5342    0.0000 C   0  0  2  0  0  0
    0.6622   -0.3000    0.0000 C   0  0  0  0  0  0
   -0.7207    2.0817    0.0000 C   1  0  0  0  0  0
   -1.8622   -0.3695    0.0000 N   0  3  0  0  0  0
    0.6220   -1.8037    0.0000 O   0  0  0  0  0  0
    1.9464    0.4244    0.0000 O   0  5  0  0  0  0
  1  2  1  0  0  0
  1  3  1  1  0  0
  1  4  1  0  0  0
  2  5  2  0  0  0
  2  6  1  0  0  0 
M  CHG  2   4   1   6  -1
M  ISO  1   3  13
M  END

We can see the same bug in Open Babel 2.3.1, when writing the stereoinformation to SDF/MOl files. The Stereo code is written incorrectly on bond #1 instead of #2.

old$ obabel -V
Open Babel 2.3.1 -- Oct 13 2011 -- 15:14:48

old$ obabel L-Alanine.sdf -o sdf
L-Alanine
 OpenBabel02032111492D
123456789012345678901234567890123456789012345678901234567890
  6  5  0  0  1  0  0  0  0  0999 V2000
   -0.6622    0.5342    0.0000 C   0  0  2  0  0  0  0  0  0  0  0  0
    0.6622   -0.3000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7207    2.0817    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.8622   -0.3695    0.0000 N   0  3  0  0  0  0  0  0  0  0  0  0
    0.6220   -1.8037    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.9464    0.4244    0.0000 O   0  5  0  0  0  0  0  0  0  0  0  0
  1  2  1  1  0  0  0
  1  3  1  0  0  0  0
  1  4  1  0  0  0  0
  2  5  2  0  0  0  0
  2  6  1  0  0  0  0
M  ISO  1   3  13
M  CHG  2   4   1   6  -1
M  END
$$$$
1 molecule converted

With Open Babel 2.4.1, the bug is fixed.

new$ obabel -V
Open Babel 2.4.1 -- May 25 2020 -- 08:24:13

new$ obabel L-Alanine.sdf -o sdf
L-Alanine
 OpenBabel02032111482D
123456789012345678901234567890123456789012345678901234567890
  6  5  0  0  1  0  0  0  0  0999 V2000
   -0.6622    0.5342    0.0000 C   0  0  2  0  0  0  0  0  0  0  0  0
    0.6622   -0.3000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7207    2.0817    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.8622   -0.3695    0.0000 N   0  3  0  0  0  0  0  0  0  0  0  0
    0.6220   -1.8037    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.9464    0.4244    0.0000 O   0  5  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  1  3  1  1  0  0  0
  1  4  1  0  0  0  0
  2  5  2  0  0  0  0
  2  6  1  0  0  0  0
M  ISO  1   3  13
M  CHG  2   4   1   6  -1
M  END
$$$$
1 molecule converted

 

Open Babel Options on SDF/Mol Files

Stereoinformation Presentation in SDF/Mol File

Stereochemistry, Chirality, Parity

⇑⇑ SDF/Mol File FAQ

2021-03-07, 790🔥, 0💬