Token导航 LogoToken导航

Agent Skill · 研究检索

openbabel(openbabel 搜索)

openbabel 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

openbabel 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 59,464。

总安装 388周安装 16GitHub Stars 9下载 127核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openbabel(openbabel 搜索)
来源仓库:https://github.com/tondevrel/scientific-agent-skills
仓库路径:skills/openbabel
安装命令:
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill openbabel
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill openbabel

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

openbabel 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。通过 npx skills add 命令从指定仓库安装并使用该技能。安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。

建议结合原始 README 文档进一步核验具体用法和功能边界。

来源仓库内路径:skills/openbabel

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tondevrel/scientific-agent-skills --skill open…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

openbabel 怎么安装?

在终端执行 npx skills add https://github.com/tondevrel/scientific-agent-skills --skill openbabel。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

openbabel 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

openbabel 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

openbabel 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

openbabel 用的人多吗?

公开数据是累计安装 388 次,近一周安装 16 次,下载 127 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

openbabel 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
openbabel

openbabel 搜索 · 本页

3889需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Open Babel - The Universal Chemical Translator

Open Babel (and its Python wrapper pybel) is the essential tool for chemical data interoperability. It allows researchers to seamlessly move data between formats like SMILES, PDB, SDF, CIF, and Gaussian input/output.

When to Use

  • Converting chemical files between different formats (e.g., SDF to PDB).
  • Generating 3D coordinates from 2D structures or SMILES.
  • Searching for substructures using SMARTS patterns.
  • Performing fast molecular docking preparation (e.g., adding hydrogens, calculating charges).
  • Running basic force field minimizations (UFF, GAFF, MMFF94).
  • Calculating molecular fingerprints and Tanimoto coefficients.
  • Batch processing large chemical databases (millions of molecules).

Reference Documentation

Official docs: https://openbabel.org/docs/dev/ Python API (Pybel): https://openbabel.org/docs/dev/UseTheLibrary/Python_Pybel.html Search patterns: openbabel.OBMol, pybel.readfile, pybel.readstring, mol.make3D

Core Principles

OB vs. Pybel

  • OpenBabel (SWIG): Низкоуровневый интерфейс, прямой доступ к C++ классам (OBMol, OBAtom). Сложный, но максимально мощный.
  • Pybel: Высокоуровневая «обертка», более Pythonic-стиль. Рекомендуется для 90% задач.

The Conversion Engine

Open Babel работает как конвейер: Input Format -> Internal OBMol -> Output Format. Вы можете добавлять фильтры и трансформации (удаление солей, добавление водородов) прямо в процессе конвертации.

Quick Reference

Installation

# Recommended via conda/mamba
conda install -c conda-forge openbabel

Standard Imports

from openbabel import openbabel as ob
from openbabel import pybel

Basic Pattern - Format Conversion

from openbabel import pybel

# 1. Read molecule (from string or file)
mol = pybel.readstring("smi", "CC(=O)Oc1ccccc1C(=O)O") # Aspirin

# 2. Add metadata
mol.title = "Aspirin_001"

# 3. Write to a different format
output_pdb = mol.write("pdb")
# Or write to file
# mol.write("sdf", "aspirin.sdf", overwrite=True)

Critical Rules

✅ DO

  • Use Pybel for simplicity - It handles memory management and provides easy access to molecular properties.
  • Add Hydrogens for 3D - Always call mol.OBMol.AddHydrogens() or mol.addh() before generating 3D coordinates.
  • Use SMARTS for Substructures - It is the most robust way to find functional groups.
  • Batch Processing - Use pybel.readfile instead of reading molecules into a list to save memory.
  • Check for Valid Geometries - After 3D generation, check if the energy is reasonable.
  • Close File Iterators - Use list(pybel.readfile(...)) or properly iterate to ensure file handles are managed.

❌ DON'T

  • Mix RDKit and Open Babel objects - They are incompatible. Convert to SMILES/SDF to pass data between them.
  • Ignore Errors - Open Babel is quiet; check if the resulting molecule is not None.
  • Forget Stereochemistry - SMILES without @ or / will lose stereocenter information during conversion.
  • Use for Complex Descriptors - For advanced QSAR, RDKit is generally preferred; Open Babel is best for conversion and 3D work.

Anti-Patterns (NEVER)

from openbabel import pybel

# ❌ BAD: Loading millions of molecules into a list
# mols = list(pybel.readfile("sdf", "huge_database.sdf")) # Crashes RAM

# ✅ GOOD: Iterator-based processing
for mol in pybel.readfile("sdf", "huge_database.sdf"):
    # process one by one
    pass

# ❌ BAD: Generating 3D without hydrogens
mol = pybel.readstring("smi", "C1CCCCC1")
mol.make3D() # ❌ Resulting structure will be distorted/incorrect

# ✅ GOOD: Add H first
mol = pybel.readstring("smi", "C1CCCCC1")
mol.addh()
mol.make3D()
mol.optimize("mmff94")

# ❌ BAD: Manual string manipulation to change format
# pdb_str = sdf_str.replace(...) # ❌ Never works reliably

Working with Molecules (pybel)

Properties and Atoms

mol = pybel.readstring("smi", "c1ccccc1O") # Phenol

print(f"Formula: {mol.formula}")
print(f"Weight: {mol.molwt:.2f}")

# Iterate over atoms
for atom in mol.atoms:
    print(f"Atom: {atom.type}, Coords: {atom.coords}")

# Get data as a dictionary
data = mol.data # Access SDF tags/metadata

Substructure Searching (SMARTS)

# Search for carboxylic acid group
smarts = pybel.Smarts("C(=O)[OH]")
mol = pybel.readstring("smi", "CC(=O)O") # Acetic acid

if smarts.findall(mol):
    print("Molecule contains a carboxylic acid!")

3D Structure and Force Fields

Generation and Optimization

mol = pybel.readstring("smi", "CN1C=NC2=C1C(=O)N(C(=O)N2C)C") # Caffeine

# 1. Prepare for 3D
mol.addh()

# 2. Generate initial 3D (Distance Geometry)
mol.make3D(forcefield='mmff94', steps=50)

# 3. Fine-tune with a local optimizer
# Options: uff, gaff, mmff94, ghemical
mol.optimize(forcefield='mmff94', steps=500)

print(f"3D Energy: {mol.energy:.2f} kJ/mol")

Advanced: Low-Level Open Babel API

Direct OBMol Manipulation

from openbabel import openbabel as ob

# Access the internal OBMol object from a pybel molecule
obmol = mol.OBMol

# Manual atom addition
new_atom = obmol.NewAtom()
new_atom.SetAtomicNum(6) # Carbon
new_atom.SetVector(1.0, 1.0, 1.0)

# Bond information
for i in range(obmol.NumBonds()):
    bond = obmol.GetBond(i)
    print(f"Bond between {bond.GetBeginAtomIdx()} and {bond.GetEndAtomIdx()}")

Calculation of Descriptors

# Fingerprints
# Standard types: FP2 (path-based), FP3 (SMARTS patterns), FP4 (functional groups)
fps = mol.calcfp("FP2")
print(f"Fingerprint bits: {fps.bits}")

# Similarity
mol2 = pybel.readstring("smi", "c1ccccc1")
fps2 = mol2.calcfp("FP2")
similarity = fps | fps2 # Tanimoto coefficient

Practical Workflows

1. High-Throughput Format Converter

def batch_convert(input_file, in_fmt, output_file, out_fmt, add_h=False):
    """Converts large files with optional hydrogen addition."""
    writer = pybel.Outputfile(out_fmt, output_file, overwrite=True)

    for mol in pybel.readfile(in_fmt, input_file):
        if add_h:
            mol.addh()
        writer.write(mol)

    writer.close()

# batch_convert("library.smi", "smi", "library.sdf", "sdf", add_h=True)

2. Preparing Ligands for Docking (PDBQT)

def prepare_ligand(smi_str, output_name):
    """Basic prep for AutoDock Vina."""
    mol = pybel.readstring("smi", smi_str)
    mol.addh()
    mol.make3D()
    mol.optimize("gaff")

    # Open Babel has a dedicated pdbqt format
    mol.write("pdbqt", f"{output_name}.pdbqt", overwrite=True)

3. Salt Removal (Chemical Cleaning)

def strip_salts(mol):
    """Removes smaller fragments (salts/solvents) from a molecule."""
    if len(mol.reversesmi.split(".")) > 1:
        # Get the largest fragment by number of atoms
        fragments = mol.OBMol.Separate()
        largest = max(fragments, key=lambda x: x.NumAtoms())
        return pybel.Molecule(largest)
    return mol

Performance Optimization

Fast Search with FP2

Before doing expensive 3D or SMARTS matching on millions of molecules, use fingerprint screening (Tanimoto) to filter candidates.

Using OBConversion for Raw Speed

If you only need to convert formats and don't need to manipulate atoms, using the raw OBConversion class is faster than creating pybel.Molecule objects.

obconv = ob.OBConversion()
obconv.SetInAndOutFormats("smi", "sdf")
obconv.ConvertFile("in.smi", "out.sdf")

Common Pitfalls and Solutions

The "Empty Molecule" from SMILES

# ❌ Problem: pybel.readstring("smi", "invalid_smiles") returns a blank molecule
# ✅ Solution: Always check for atom count
mol = pybel.readstring("smi", some_input)
if len(mol.atoms) == 0:
    print("Error: Invalid molecule data")

Path issues for Force Fields

On some systems, Open Babel cannot find its data files (force field parameters).

# ✅ Solution: Manually set BABEL_DATADIR if needed
import os
# os.environ['BABEL_DATADIR'] = '/path/to/openbabel/data'

3D Chirality Inversion

Sometimes make3D can invert a stereocenter if the input SMILES isn't specific.

# ✅ Solution: Use 'gen3d' operation instead of simple make3D
# which is more robust for preserving stereochemistry.
obconv = ob.OBConversion()
obconv.AddOption("gen3d", ob.OBConversion.GENOPTIONS)

Best Practices

  1. Always add hydrogens before 3D generation - Structures without hydrogens will be incorrect.
  2. Use iterators for large files - Don't load entire databases into memory.
  3. Validate molecules after reading - Check atom count and basic properties.
  4. Use appropriate force fields - MMFF94 for organic molecules, UFF for general use, GAFF for drug-like molecules.
  5. Preserve stereochemistry - Use explicit SMILES notation with @ and / when needed.
  6. Use fingerprints for similarity - Before expensive operations, filter with Tanimoto coefficients.
  7. Close file writers explicitly - Use context managers or .close() to ensure data is written.
  8. Check energy after optimization - Unreasonable energies indicate geometry problems.

Open Babel is the "glue" of the chemical world. While it may not have the sophisticated 2D-rendering of RDKit or the high-level math of PySCF, its ability to handle any format and generate 3D starting points makes it a mandatory tool in every computational chemist's belt.

平台分布

Codex

32.12%
按下载量换算41

Claude

29.87%
按下载量换算38

Cursor

20.41%
按下载量换算26

Gemini CLI

8.94%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills