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

This section provides a tutorial example how to generate a SVG picture of a molecule structure including atom indices using the Open Babel 'obabel ... -o svg -xi' command.

If you want to atom indices to be displayed in molecule SVG picture, you can use the "-xi" option with the "-o svg" output format in Open Babel command like "obabel ... -o svg -xi".

Atom indices are sequence numbers of atoms representing the order atoms listed in the source data.

For example, the following command generates a SVG picture of the tyrosine molecule from a SMILES string:

herong$ obabel "-:c1cc(ccc1CC(C(=O)O)N)O" -o svg -O tyrosine-i.svg -xi

1 molecule converted

Open the output file, tyrosine-i.svg, in a Web browser, you see tyrosine molecule structure displayed with SMILES index number on each atom.

Open Babel SVG Picture - Tyrosine Molecule with Indeces
Open Babel SVG Picture - Tyrosine Molecule with Indeces

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