Open Babel Options on SDF/Mol Files

Q

What options are offerred in Parity Code to support stereoinformation in SDF/Mol V2000 and V3000 files generated by Open Babel?

✍: Guest

A

Here is the documentation of Open Babel 2.4.1 with options listed to support stereoinformation in SDF/Mol V2000 and V3000 files:

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

fyicenter$ obabel -L sdf
One of the formats
sdf -- MDL MOL format
Reads and writes V2000 and V3000 versions

Open Babel supports an extension to the MOL file standard
that allows cis/trans and tetrahedral stereochemistry to be                                                          
stored in 0D MOL files. The tetrahedral stereochemistry is
stored as the atom parity, while the cis/trans stereochemistry                                                       
is stored using Up and Down bonds similar to how it is
represented in a SMILES string. Use the ``S`` option
when reading or writing if you want to avoid storing
or interpreting stereochemistry in 0D MOL files.

Read Options, e.g. -as
 s  determine chirality from atom parity flags
       The default setting for 2D and 3D is to ignore atom parity and                                                
       work out the chirality based on the bond
       stereochemistry (2D) or coordinates (3D).
       For 0D the default is already to determine the chirality                                                      
       from the atom parity.
 S  do not read stereochemistry from 0D MOL files
       Open Babel supports reading and writing cis/trans
       and tetrahedral stereochemistry to 0D MOL files.
       This is an extension to the standard which you can
       turn off using this option.
 T  read title only
 P  read title and properties only
       When filtering an sdf file on title or properties
       only, avoid lengthy chemical interpretation by
       using the ``T`` or ``P`` option together with the
       :ref:`copy format <Copy_raw_text>`.

Write Options, e.g. -x3
 3  output V3000 not V2000 (used for >999 atoms/bonds)
 a  write atomclass if available
 m  write no properties
 w  use wedge and hash bonds from input (2D only)
 S  do not store cis/trans stereochemistry in 0D MOL files
 A  output in Alias form, e.g. Ph, if present
 E  add an ASCII depiction of the molecule as a property
 H  use HYD extension (always on if mol contains zero-order bonds)                                                   

As you can see, there are 4 options related to stereoinformation.

  • "-as" - Use 0D stereoinformation to override 2D and 3D stereoinformation when readinng file. By default, 2D or 3D stereoinformation overrides 0D stereoinformation. In other words, if "-as" is given, chirality (parity code on atom) given at atom line level wins.
  • "-aS" - Stop reading 0D stereoinformation. Only read 2D stereoinformation (stereo code on bond) and 3D stereoinformation (x, y, z coordinates).
  • "-xw" - Use wedge and hash bonds from input (2D only). Not sure how to interprete this.
  • "-xS" - Do not store cis/trans stereochemistry in 0D MOL files.

In order to test the "-as" option, we can create a new SDF/Mol file, L-Alanine-0D.sdf, for the L-Alanine with only 0D stereoinformation:

fyicneter$ cat L-Alanine-0D.sdf
L-Alanine
FYIcenter.com
Stereoinformation in 0D only
  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  0  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   

Try Open Babel with "-as" option. 0D stereoinformation is detected and converted to 2D stereoinformation in the output. as stereo code in bond lines.

fyicneter$ obabel L-Alanine-0D.sdf -o sdf -as
L-Alanine
 OpenBabel02032116592D
Stereoinformation in 0D only
  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

Try Open Babel without "-as" option. 0D stereoinformation is not detected and no 2D stereoinformation in the output. It also changed the parity code from "2 (even)" to "3 (either)". Could it be another bug?

fyicneter$ obabel L-Alanine-0D.sdf -o sdf
L-Alanine
 OpenBabel02032116572D
Stereoinformation in 0D only
  6  5  0  0  1  0  0  0  0  0999 V2000
   -0.6622    0.5342    0.0000 C   0  0  3  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  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

In order to test 3D stereoinformation, we can create a new SDF/Mol file, L-Alanine-3D.sdf, for the L-Alanine with only 3D stereoinformation. Notice that z=0.5000 is specified for atom #3, so it upward to the viewer.

fyicneter$ test]$ cat L-Alanine-3D.sdf 
L-Alanine
FYIcenter.com
Stereoinformation in 3D only
  6  5  0  0  0  0              3 V2000
   -0.6622    0.5342    0.0000 C   0  0  0  0  0  0
    0.6622   -0.3000    0.0000 C   0  0  0  0  0  0
   -0.7207    2.0817    0.5000 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  0  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

Try Open Babel with default options. 3D stereoinformation is detected and converted to both 0D and 2D stereoinformation in the output.

fyicneter$ obabel L-Alanine-3D.sdf -o sdf
L-Alanine
 OpenBabel02032117233D
Stereoinformation in 3D only
  6  5  0  0  0  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.5000 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

 

⇒ Stereoinformation in SDF/Mol V3000 Files

⇐ Parity and Stereo with Open Babel

⇑ Stereochemistry, Chirality, Parity

⇑⇑ SDF/Mol File FAQ

2021-03-07, 256👍, 0💬