Converting chemical file formats¶
The most common use of Open Babel is to convert chemical file formats. The following examples show how this is done.
Let’s convert a PDB file to MOL format:
- Create a folder on the Desktop called
- Download the PDB file for insulin (
4ins) from the Protein Data Bank and save it in the
- Set the input file format to PDB and the input filename to the downloaded PDB file
- Set the output file format to MOL and the output filename to file:4ins.mol in the
- Now click CONVERT
Converting without files¶
Rather than use input and output files, it is possible to paste the contents of a chemical file format into the input box, and see the results of the conversion in the output box.
Here we will try this with the SMILES format, and illustrate how stereochemistry is handled by SMILES:
Choose the SMILES format as the input format
Tick the box Input below (ignore input file)
Copy and paste the following SMILES strings (and molecule titles) into the input box:
I/C=C/F I and F are trans I/C=C\F I and F are cis I[C@](Br)(Cl)F Anticlockwise from Iodine I[C@@](Br)(Cl)F Clockwise from Iodine
Choose the SMILES format as the output format
Tick the box for Output below only and Display in Firefox
- Click CONVERT.
In the resulting depiction, note that Open Babel only sets a single stereobond for a chiral centre. This is not ambiguous - it means that the stereobond is either above or below the plane, with the remaining three bonds the opposite site of the plane.
- Can you figure out whether the depiction of the tetrahedral centre is consistent with the SMILES string?
Open Babel 2.3.2 introduces a twisted double bond to indicate unknown cis/trans stereochemistry (e.g. IC=CF). See here for more info.