Computational Chemistry Agent Skills

openbabel

data-processing
A versatile CLI tool for converting molecular file formats, generating 3D atomic coordinates from SMILES, rendering 2D chemical structure images, and preparing or extracting structures for computational workflows. USE WHEN you need to convert between chemical file formats (e.g., xyz, pdb, mol, smi, gjf), generate 3D structures from SMILES using `--gen3d`, render molecule images (PNG/SVG), or extract geometries from simulation logs to build new inputs.
v1.1 Requires uv and internet access (uses `uvx --from openbabel-wheel obabel ...`). repository source

Installation

Install folder: openbabel · Repo path: data-processing/openbabel
Copy/paste this message to your OpenClaw agent.
Please install the OpenClaw skill "openbabel" on the OpenClaw host.

Steps:
- Download: https://skills.computchem.cn/skill-zips/openbabel.zip
- Unzip it to get openbabel/
- Copy openbabel/ into the workspace skills directory (<workspace>/skills/)
- Start a NEW OpenClaw session so the skill is loaded

Then verify:
openclaw skills list --eligible
openclaw skills info openbabel
Prerequisites: Requires uv and internet access (uses `uvx --from openbabel-wheel obabel ...`).

Open Babel

This skill provides practical Open Babel command patterns for common chemistry data tasks.

Quick Start

Check installation through uvx:

uvx --from openbabel-wheel obabel -V

Typical conversion syntax:

uvx --from openbabel-wheel obabel input.ext -i<input_format> -o<output_format> -O output.ext

Core Tasks

1) File format conversion

Convert XYZ to PDB:

uvx --from openbabel-wheel obabel C.xyz -ixyz -opdb -O C.pdb

Open Babel supports a large set of chemistry formats (e.g., xyz, mol, mol2, pdb, smi, Gaussian gjf/log/fchk, etc.).

2) Build structures from SMILES

Generate methane (3D coordinates required):

uvx --from openbabel-wheel obabel -:C --gen3d -omol -O C.mol

Generate a single carbon atom:

uvx --from openbabel-wheel obabel -:[C] --gen3d -omol -O C.mol

Generate methyl radical:

uvx --from openbabel-wheel obabel -:[CH3] --gen3d -omol -O CH3.mol

Important: quote SMILES when they contain brackets or special characters.

Equivalent explicit form:

uvx --from openbabel-wheel obabel -:"[C]([H])([H])[H]" --gen3d -omol -O CH3.mol

3) Export SMILES from one or more structure files

uvx --from openbabel-wheel obabel C.mol C.mol2 C.pdb C.xyz --osmi -O C.smi

4) Render 2D structure images

Generate PNG:

uvx --from openbabel-wheel obabel -:"C([C@@H](C(=O)O)N)S" -opng -O cys.png

Generate SVG:

uvx --from openbabel-wheel obabel -:"C([C@@H](C(=O)O)N)S" -osvg -O cys.svg

Convert Gaussian log directly to image:

uvx --from openbabel-wheel obabel phosphate.log -ilog -opng -O phosphate.png

5) Gaussian workflow helper

Generate Gaussian input from SMILES, then patch header with sed:

uvx --from openbabel-wheel obabel -:CC --gen3d -ogjf | sed "1c %nproc=28\n#opt b3lyp/6-31g(d,p)" > CC.gjf

Generate next-step input from a previous Gaussian log:

uvx --from openbabel-wheel obabel CC.log -ilog -ogjf | sed "1c %nproc=28\n#freq b3lyp/6-31g(d,p)" > CC2.gjf

Agent Checklist

When using this skill for users:

  1. Confirm source file(s) and desired target format.
  2. Prefer explicit -i and -o format flags for reproducibility.
  3. Add --gen3d when converting SMILES to coordinate-bearing structures.
  4. Quote SMILES strings that contain brackets/parentheses.
  5. For Gaussian workflows, verify route section and resource lines (%nproc, method/basis) after generation.
  6. Use uvx --from openbabel-wheel obabel ... consistently to minimize local dependency setup.

References