Connect with us


Converting file formats using Openbabel.



Converting file formats using Openbabel.

Openbabel [1] offers a wide range of operations. One of which is file format conversion which is most widely used. In this article, we will describe commands that convert file formats.

Assuming, you have already installed Openbabel on your system, you should be able to run it as obabel/babel in the terminal. Also, you can use the GUI of Openbabel that you will have to compile during its installation.

So, here is the command syntax for file conversion:

$ obabel -i<input_format> <input_filename> -o<output_format> -O <output_filename> -other_arguments

It is optional to provide input and output formats but it is always better to do so.

Let’s convert opensmiles SMILES to canonical SMILES.

$ obabel -ismi input.smi -osmi -O output.smi -ocan

Similarly, you can convert SMILES to InChi as shown below:

$ obabel -ismi input.smi -oinchi -O output.inchi

If you want, you can give some additional arguments such as ignoring isomers, removing duplicates, etc. Sometimes, the openbabel stops processing once it finds any invalid compound/molecule, so for that, you can -e to the command.

$ obabel -ismi input.smi -oinchi -O output.inchi -e --unique

Here, –unique will not convert the duplicate molecules.

If you want to ignore the stereochemistry of the molecules then you can use the following arguments:

$ obabel -ismi input.smi -oinchi -O output.inchi -e /nostereo /nochg /noiso /noEZ /sp3

You can also keep unique molecules based on the arguments given in the above command by writing –unique before the arguments as shown below.

$ obabel -ismi input.smi -oinchi -O output.inchi -e --unique /nostereo /nochg /noiso /noEZ /sp3

For further information on supported file formats, read here.


  1. O’Boyle, NM, Banck, M., James, CA, Morley, C., Vandermeersch, T., & Hutchison, GR (2011). Open Babel: An open chemical toolbox. Journal of cheminformatics3 (1), 1-14.

Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba

Click to comment

You must be logged in to post a comment Login

Leave a Reply

Bioinformatics Programming Python script to convert SMILES to structures.


on Python script to convert SMILES to structures.

As mentioned in some of our previous articles, RDKit provides a wide range of functions. In this article, we are using RDKit [1] to draw a molecular structure using SMILES. (more…)

Continue Reading

Bioinformatics Programming A Python script to calculate Tanimoto similarities of multiple compounds using RDKit.


on A Python script to calculate Tanimoto similarities of multiple compounds using RDKit.

RDKit [1] is a very nice cheminformatics software. It allows us to perform a wide range of operations on chemical compounds/ ligands. We have provided a Python script to perform fingerprinting using Tanimoto similarity on multiple compounds using RDKit. (more…)

Continue Reading


Installing CDK (Chemistry Development Kit) on Ubuntu (Linux)



Installing cdk on Ubuntu

CDK stands for chemistry development kit [1]. This is an open source kit for cheminformatics consisting of modular JAVA libraries. In this article, we will install CDK on Ubuntu. (more…)

Continue Reading