"babel ... -o svg -xd -xP300" - Open Babel 2.4 Bug

This section provides a tutorial example demonstrating a code bug in 'babel -o svg -xd -xP300' command in Open Babel 2.4.

"-xd" for "svg" output format is a nice option in Open Babel that removes molecule title in the output SVG image.

But there seems to be a code bug in Open Babel 2.4 release, where "-xd" option requires a parameter. If you use "-xd" option and follow by another option, the "babel -o svg" command will give you an error: "Option -d takes a parameter">

herong$ obabel -:CCCCCCC -O carbon-chain.sdf --gen2D
1 molecule converted

herong$ babel carbon-chain.sdf carbon-chain.svg -xd -xP300
Option -d takes a parameter

The workaround is to put the "-xd" option at the end of the command line as shown below:

herong$ babel carbon-chain.sdf carbon-chain.svg -xP300 -xd
1 molecule converted
20 audit log messages

However, the "obabel -o svg -xd -xP300" works perfectly in Open Babel 2.4 release.

herong$ obabel -:CCCCCC -o svg -O carbon-chain.svg -xd -xP300
1 molecule converted

So we should use "obabel" instead of "babel", since "babel" is deprecated now and will be removed in a future release.

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"

Generating SVG Pictures with Open Babel

 "obabel -o svg" - Molecule Picture in SVG

 "obabel -:... -o svg" - Generate SVG from SMILES

 "obabel ... -o svg -xi" - Show Atom Indices in SVG

 "obabel ... -o svg -xS" - Ball/Stick Depiction in SVG

 "obabel ... -o svg -xX" - Hide Implicit H in SVG

 "obabel ... -o svg -xC" - Hide Terminal C in SVG

 "obabel ... -o svg -xP300" - Control Image Size

 "obabel ... -o svg" - Two "svg" XML Tag Levels

 "obabel ... -o svg -xd" - Hide Molecule Name

"babel ... -o svg -xd -xP300" - Open Babel 2.4 Bug

 Scale SVG Images using "viewBox" Attribute

 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