Smiles To Iupac logo

Smiles To Iupac

Organization
InternScience
smiles-to-iupac

将 SMILES 字符串转换为 IUPAC 化学名称。使用 PubChem、NCI/CADD、STOUT、RDKit-InChI 多种方法智能转换。

Overview

PublisherInternScience
RepositoryChemClaw
Skill namesmiles-to-iupac
Stars
53
Forks
13
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by InternScience on GitHub. Read the source before you install it.

Installation

Install the Smiles To Iupac AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/InternScience/ChemClaw/tree/main/skills/smiles-to-iupac
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/InternScience/ChemClaw.git /tmp/ChemClaw
mkdir -p .claude/skills
cp -r /tmp/ChemClaw/skills/smiles-to-iupac .claude/skills/smiles-to-iupac
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Smiles To Iupac in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Smiles To Iupac on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Smiles To Iupac is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SMILES to IUPAC Name Converter (Optimized)

将 SMILES 字符串转换为 IUPAC 化学名称,使用多种方法智能转换:PubChem API、NCI/CADD、STOUT (Docker)、RDKit-InChI。

触发条件

  • 用户提供 SMILES 并要求转换
  • 提到"SMILES 转 IUPAC"、"smiles to iupac"
  • 说"这个 SMILES 叫什么"、"命名这个分子"
  • 提供 SMILES 字符串并要求化学名称

功能特性

  • ✅ 多方法支持 - PubChem、NCI/CADD、STOUT、RDKit-InChI
  • ✅ 智能降级 - 自动尝试多种方法直到成功
  • ✅ SMILES 验证 - 使用 RDKit 验证 SMILES 有效性
  • ✅ 分子性质 - 计算分子量、LogP、TPSA 等
  • ✅ 聚合物支持 - 自动清理聚合物标记
  • ✅ 立体化学 - 支持立体化学信息
  • ✅ 批量处理 - 支持多个 SMILES 同时转换
  • ✅ 置信度评估 - 提供结果置信度

核心模型

方法来源返回置信度速度
PubChemNCBIIUPAC⭐⭐⭐⭐⭐快
NCI/CADDNCIIUPAC⭐⭐⭐⭐⭐快
STOUTDockerInChI⭐⭐⭐⭐中
RDKit-InChIRDKitInChI⭐⭐⭐⭐快

方法选择逻辑 (auto 模式)

1. PubChem API → 成功?→ 返回 IUPAC 名称
                    ↓ 失败
2. NCI/CADD API → 成功?→ 返回 IUPAC 名称
                     ↓ 失败
3. STOUT (Docker) → 成功?→ 返回 InChI
                       ↓ 失败
4. RDKit-InChI → 生成 InChI → 返回

PubChem PUG-REST API (首选)

  • 来源: NCBI PubChem (>1 亿化合物)
  • 优势:
    • 权威数据源,准确率最高
    • 直接返回 IUPAC 名称
    • 覆盖药物、天然产物等
  • 限制:
    • 需要网络连接
    • 速率限制:~10 请求/秒

NCI/CADD Chemical Identifier Resolver (备选)

  • 来源: NCI/CADD
  • 优势:
    • 权威数据源
    • 支持多种化学标识符
    • 准确率与 PubChem 相当
  • 限制:
    • 需要网络连接
    • 某些化合物可能无 IUPAC 名称

STOUT (Docker) (本地方案)

  • 架构: Docker 容器 + RDKit
  • 优势:
    • 本地运行,保护隐私
    • 不依赖外部 API
    • 生成 InChI 标准化标识
  • 限制:
    • 需要安装 Docker
    • 需要安装 stout 包

RDKit-InChI (最终方案)

  • 来源: RDKit + InChI
  • 优势:
    • 完全本地运行
    • 生成标准化 InChI
    • InChI 可转换为 IUPAC
  • 限制:
    • 返回 InChI 而非直接 IUPAC

使用方法

对话框中使用

把 CCO 转成 IUPAC 名称
SMILES: CC(=O)Oc1ccccc1C(=O)O,转 IUPAC
smiles to iupac: C1=CC=C(C=C1)O
自动转换这个 SMILES

命令行使用

bash
# 基本转换(自动选择最佳方法)
python3 scripts/smiles_to_iupac.py -s "CCO"

# 指定使用 PubChem
python3 scripts/smiles_to_iupac.py -s "CCO" -m pubchem

# 指定使用 NCI/CADD
python3 scripts/smiles_to_iupac.py -s "CCO" -m nci

# 指定使用 STOUT (Docker)
python3 scripts/smiles_to_iupac.py -s "CCO" -m stout

# 指定生成 InChI
python3 scripts/smiles_to_iupac.py -s "CCO" -m inchi

# 指定输出目录
python3 scripts/smiles_to_iupac.py -s "CCO" -o ./results

# 不计算分子性质(加快速度)
python3 scripts/smiles_to_iupac.py -s "CCO" --no-properties

# 安静模式(输出 JSON)
python3 scripts/smiles_to_iupac.py -s "CCO" -q

参数说明

参数简写说明默认值
--smiles-s输入 SMILES 字符串-
--output-o输出目录~/.openclaw/media/smiles-to-iupac
--method-m方法:auto/pubchem/nci/stout/inchiauto
--no-properties不计算分子性质false
--quiet-q安静模式(输出 JSON)false

输出示例

简单化合物 (PubChem)

json
{
  "input_smiles": "CCO",
  "cleaned_smiles": "CCO",
  "timestamp": "2026-03-16T20:00:00",
  "molecular_properties": {
    "molecular_formula": "C2H6O",
    "molecular_weight": 46.07,
    "num_atoms": 9,
    "num_heavy_atoms": 3
  },
  "results": [
    {
      "status": "success",
      "iupac_name": "ethanol",
      "smiles": "CCO",
      "model": "PubChem",
      "source": "api",
      "confidence": "high"
    }
  ],
  "best_result": {
    "status": "success",
    "iupac_name": "ethanol",
    "model": "PubChem",
    "confidence": "high"
  }
}

复杂化合物 (NCI/CADD)

json
{
  "input_smiles": "CC(=O)Oc1ccccc1C(=O)O",
  "best_result": {
    "status": "success",
    "iupac_name": "2-acetyloxybenzoic acid",
    "model": "NCI/CADD",
    "confidence": "high"
  }
}

聚合物单体 (InChI)

json
{
  "input_smiles": "*CC(C(=O)OCCCCOc1ccc(cc1)C(=O)Oc1ccc(cc1)OC)(C)*",
  "cleaned_smiles": "CC(C)(C(=O)OCCCCOc1ccc(cc1)C(=O)Oc1ccc(cc1)OC)",
  "best_result": {
    "status": "success",
    "iupac_name": "InChI: 1S/C22H26O6/...",
    "model": "RDKit-InChI",
    "confidence": "medium",
    "note": "InChI is a standardized identifier"
  }
}

依赖安装

bash
# 基本安装(推荐)
pip install rdkit requests

# 完整安装(包含 STOUT)
pip install rdkit requests stout

# 确保 Docker 已安装(STOUT 需要)
docker --version

方法选择建议

场景推荐方法原因
常见有机分子auto (PubChem)准确率最高
药物分子auto (PubChem)数据库覆盖广
无网络连接stout/inchi本地运行
隐私敏感stout/inchi不上传数据
聚合物inchi生成标准化 InChI
PubChem 失败auto (自动降级)尝试其他方法

SMILES 清理

自动清理以下内容:

  • 聚合物标记: *...* → 移除
  • 空格: 自动移除
  • 无效字符: 自动检测

示例:

*CCO* → CCO
C C O → CCO

分子性质计算

包括以下性质(如果 RDKit 可用):

  • 分子式 (Molecular Formula)
  • 分子量 (Molecular Weight)
  • 精确质量 (Exact Mass)
  • 原子数 (Atom Count)
  • 重原子数 (Heavy Atom Count)
  • 环数 (Ring Count)
  • 芳香环数 (Aromatic Ring Count)
  • 氢键供体 (H-Bond Donors)
  • 氢键受体 (H-Bond Acceptors)
  • LogP (疏水性)
  • TPSA (拓扑极性表面积)

输出目录白名单

重要:为了能在飞书等平台上发送生成的文件,输出目录必须在白名单内:

  • ✅ ~/.openclaw/media/
  • ✅ ~/.openclaw/workspace/
  • ✅ ~/.openclaw/agents/

本 skill 默认输出到 ~/.openclaw/media/smiles-to-iupac/,可以直接分享!

与其他技能配合

与 iupac-to-smiles 配合

1. smiles-to-iupac: SMILES → IUPAC 名称
2. iupac-to-smiles: IUPAC 名称 → SMILES (反向验证)

与 mol-image-to-smiles 配合

1. mol-image-to-smiles: 分子图片 → SMILES
2. smiles-to-iupac: SMILES → IUPAC 名称

完整工作流

分子图片 → mol-image-to-smiles → SMILES → smiles-to-iupac → IUPAC 名称
     ↓                              ↓
  2D 结构图                      iupac-to-smiles
     ↓                              ↓
  可视化                        IUPAC 名称(验证)

完整工作流程示例

示例 1: 简单分子

bash
# 转换乙醇
python3 scripts/smiles_to_iupac.py -s "CCO"

# 输出:ethanol

示例 2: 复杂分子

bash
# 转换阿司匹林
python3 scripts/smiles_to_iupac.py -s "CC(=O)Oc1ccccc1C(=O)O"

# 输出:2-acetyloxybenzoic acid

示例 3: 含立体化学

bash
# 转换乳酸(R 型)
python3 scripts/smiles_to_iupac.py -s "C[C@H](O)C(=O)O"

# 输出:(2R)-2-hydroxypropanoic acid

示例 4: 聚合物单体

bash
# 转换聚合物重复单元
python3 scripts/smiles_to_iupac.py \
  -s "*CC(C(=O)OCCCCOc1ccc(cc1)C(=O)Oc1ccc(cc1)OC)(C)*"

# 输出:InChI (聚合物不在数据库中)

技术细节

智能降级逻辑

python
methods_order = ["pubchem", "nci", "stout", "inchi"]

for method in methods_order:
    result = try_method(method, smiles)
    if result["status"] == "success":
        return result  # 成功即返回
# 所有方法都失败
return error

SMILES 验证

使用 RDKit 验证:

python
from rdkit import Chem

mol = Chem.MolFromSmiles(smiles)
is_valid = mol is not None

分子性质计算

python
from rdkit.Chem import rdMolDescriptors, Descriptors

formula = rdMolDescriptors.CalcMolFormula(mol)
mw = Descriptors.MolWt(mol)
logp = Descriptors.MolLogP(mol)
tpsa = rdMolDescriptors.CalcTPSA(mol)

注意事项

  • ✅ 自动方法选择 - auto 模式智能降级
  • ✅ SMILES 验证 - 自动验证输入有效性
  • ✅ 结果验证 - 建议用其他工具验证 IUPAC 名称
  • ✅ 批量处理 - 支持多个 SMILES 同时转换
  • ⚠️ 网络连接 - PubChem/NCI 需要网络
  • ⚠️ Docker - STOUT 需要 Docker 运行
  • ⚠️ 聚合物 - 聚合物可能返回 InChI 而非 IUPAC
  • ⚠️ 超大分子 - 蛋白质等可能失败

错误处理

错误说明解决方案
Invalid SMILESSMILES 格式错误检查 SMILES 语法
PubChem API errorAPI 调用失败检查网络连接
NCI API errorNCI 服务不可用尝试其他方法
STOUT not installedSTOUT 未安装pip install stout
Docker not availableDocker 未运行启动 Docker 服务
All methods failed所有方法失败分子可能太大或不在数据库

与 iupac-to-smiles 的区别

特性iupac-to-smilessmiles-to-iupac
输入IUPAC 名称SMILES
输出SMILESIUPAC 名称/InChI
核心模型OPSIN APIPubChem/NCI/STOUT
需要网络是可选
转换方向名称→结构结构→名称

常见化合物示例

醇类

CCO → ethanol
CCCO → propan-1-ol
CC(C)O → propan-2-ol

酸类

CC(=O)O → acetic acid
CCC(=O)O → propanoic acid
c1ccccc1C(=O)O → benzoic acid

酯类

CC(=O)OCC → ethyl acetate
CC(=O)Oc1ccccc1C(=O)O → 2-acetyloxybenzoic acid

芳香族

c1ccccc1 → benzene
c1ccccc1O → phenol
c1ccccc1N → aniline

性能对比

方法平均响应时间成功率准确率
PubChem~1s90%+95%+
NCI/CADD~2s88%+93%+
STOUT~10s85%+90%+
RDKit-InChI~0.1s99%+100% (InChI)

未来改进

  • 支持更多无机化合物
  • 添加同义词支持
  • 改进聚合物命名
  • 添加 CAS 号查询
  • 支持多语言 IUPAC 名称
  • 集成更多数据源(ChEBI、ChemSpider 等)
  • 添加反应式支持

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Smiles To Iupac AI skill do?

将 SMILES 字符串转换为 IUPAC 化学名称。使用 PubChem、NCI/CADD、STOUT、RDKit-InChI 多种方法智能转换。

Why use Smiles To Iupac on TypingMind?

Because you install it once and use it with any model. Smiles To Iupac is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Smiles To Iupac in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/InternScience/ChemClaw/tree/main/skills/smiles-to-iupac. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Smiles To Iupac?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Smiles To Iupac?

As many as you like. As long as a model supports skills, you can use Smiles To Iupac with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Smiles To Iupac AI skill free?

Yes. It is published on GitHub by InternScience under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇