"obabel" Command Option Argument Syntax

This section provides tutorial examples to demonstrate different ways to specify Open Babel 'obabel' command option arguments.

Open Babel "obabel" command supports different ways to specify option arguments on the command line. Here are some guidelines on how to use them.

If a "obabel" command option takes an argument, you can specify the argument in two ways:

If an option argument contains special characters, you should place it in double quotes or single quotes to protect it. Here are some examples:

herong$ obabel tyrosine.sdf -o smiles -s c(C)c
  -bash: syntax error near unexpected token `('

herong$ # using double quotes to protect ()
herong$ obabel tyrosine.sdf -o smiles -s "c(C)c"
  c1cc(ccc1CC(C(=O)O)N)O
  1 molecule converted

herong$ # using single quotes to protect ()
herong$ obabel tyrosine.sdf -o smiles -s 'c(C)c'
  c1cc(ccc1CC(C(=O)O)N)O
  1 molecule converted

herong$ # putting option flag and argument together
herong$ obabel tyrosine.sdf -o smiles "-sc(C)c"
  c1cc(ccc1CC(C(=O)O)N)O
  1 molecule converted

herong$ # putting option flag and argument together
herong$ obabel tyrosine.sdf -o smiles "-s c(C)c"
  c1cc(ccc1CC(C(=O)O)N)O
  1 molecule converted

herong$ # using double quotes to protect ' and space
herong$ obabel tyrosine.sdf -o smiles --title "John's molecule"
  c1cc(ccc1CC(C(=O)O)N)O  John's molecule
  1 molecule converted

Table of Contents

 About This Book

 SMILES (Simplified Molecular-Input Line-Entry System)

 Open Babel: The Open Source Chemistry Toolbox

Using Open Babel Command: "obabel"

 What Is "obabel" Command

 "obabel -i ..." - Input Data Format and Source

 "obabel -o ... -O" - Output Data Format and Destination

 "obabel -... --..." - Generic Conversion Options

"obabel" Command Option Argument Syntax

 "obabel ... --gen2D" - Calculated 2D Coordinates

 "obabel ... -f # -l #" - Split Large Molecule File

 "obabel -h/-d" - Add/Remove Hydrogens in Molecule Data

 "obabel --append ..." - Calculate Molecule Properties

 "obabel -L formats" - List of File Formats Supported

 "obabel -a..." - Extra Options for Input Reading

 "obabel -x..." - Extra Options for Output Writing

 "obabel" vs. "babel" Open Babel Commands

 Generating SVG Pictures with Open Babel

 Substructure Search with Open Babel

 Similarity Search with Open Babel

 Fingerprint Index for Fastsearch with Open Babel

 Stereochemistry with Open Babel

 Command Line Tools Provided by Open Babel

 RDKit: Open-Source Cheminformatics Software

 rdkit.Chem.rdchem - The Core Module

 rdkit.Chem.rdmolfiles - Molecular File Module

 rdkit.Chem.rdDepictor - Compute 2D Coordinates

 rdkit.Chem.Draw - Handle Molecule Images

 Molecule Substructure Search with RDKit

 rdkit.Chem.rdmolops - Molecule Operations

 Daylight Fingerprint Generator in RDKit

 Morgan Fingerprint Generator in RDKit

 RDKit Performance on Substructure Search

 Introduction to Molecular Fingerprints

 OCSR (Optical Chemical Structure Recognition)

 AlphaFold - Protein Structure Prediction

 Resources and Tools

 Cheminformatics Related Terminologies

 References

 Full Version in PDF/EPUB