返回顶部
c

chemistry-query化学查询

Chemistry agent skill for PubChem API queries (compound info/properties, structures/SMILES/images, synthesis routes/references) + RDKit cheminformatics (SMILES to molecule props/logP/TPSA, 2D PNG/SVG viz, Morgan fingerprints, retrosynthesis/BRICS disconnects, multi-step synth planning). Use for chemistry tasks involving compounds, molecules, structures, PubChem data, RDKit analysis, SMILES processing, synthesis routes, retrosynthesis, reaction simulation. Triggers on chemistry, compounds, molecu

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
823
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

chemistry-query

化学查询智能体 v1.4.0

概述

全栈化学工具包,结合PubChem数据检索与RDKit分子处理、可视化、分析、逆合成及合成规划。所有输出均为结构化JSON格式,便于下游链式调用。可按需生成PNG/SVG图像。

核心能力:

  • - PubChem化合物查询(信息、结构、合成参考文献、相似性搜索)
  • RDKit分子属性(分子量、logP、TPSA、氢键供体/受体数、可旋转键数、芳香环数)
  • 二维分子可视化(PNG/SVG)
  • BRICS逆合成与递归深度控制
  • 多步合成路线规划
  • 基于SMARTS模板的正向反应模拟
  • Morgan指纹与相似性/子结构搜索
  • 21种命名反应模板(Suzuki、Heck、Grignard、Wittig、Diels-Alder等)

快速开始

bash

PubChem化合物信息


exec python scripts/query_pubchem.py --compound aspirin --type info

从SMILES计算分子属性

exec python scripts/rdkit_mol.py --smiles CC(=O)Oc1ccccc1C(=O)O --action props

逆合成

exec python scripts/rdkit_mol.py --target CC(=O)Oc1ccccc1C(=O)O --action retro --depth 2

完整链式调用(名称 → 属性 + 绘图 + 逆合成)

exec python scripts/chain_entry.py --input-json {name: caffeine, context: user}

脚本

scripts/query_pubchem.py

PubChem REST API查询,支持自动名称→CID解析和超时处理。

--compound <名称|CID> --type [--format smiles|inchi|image|json] [--threshold 80]

  • - info: 分子式、分子量、IUPAC名称、InChIKey(JSON格式)
  • structure: SMILES、InChI、图像URL或完整JSON
  • synthesis: 化合物的同义词/参考文献
  • similar: 基于二维指纹的相似化合物(前20个)

scripts/rdkit_mol.py

RDKit化学信息学引擎。自动通过PubChem解析化合物名称。

--smiles --action

操作描述关键参数
props分子量、logP、TPSA、氢键供体数、氢键受体数、可旋转键数、芳香环数--smiles
draw
二维PNG/SVG图像(300×300) | --smiles --output file.png --format png\|svg | | retro | BRICS递归逆合成 | --target --depth N | | plan | 多步逆合成路线 | --target --steps N | | react | 基于SMARTS的正向反应 | --reactants smi1 smi2 --smarts | | fingerprint | Morgan指纹位向量 | --smiles --radius 2 | | similarity | Tanimoto相似度评分 | --querysmiles --targetsmiles smi1,smi2 | | substruct | 子结构匹配 | --querysmiles --targetsmiles smi1,smi2 | | xyz | 三维坐标(MMFF优化) | --smiles |

scripts/chain_entry.py

标准智能体链式调用接口。接受{smiles: ..., context: ...}或{name: ..., context: ...}格式输入。返回包含属性、可视化和逆合成的统一JSON。

bash
python scripts/chain_entry.py --input-json {name: sotorasib, context: user}

输出模式:
json
{
agent: chemistry-query,
version: 1.4.0,
smiles: <规范SMILES>,
status: success|error,
report: {props: {...}, draw: {...}, retro: {...}},
risks: [],
viz: [path/to/image.png],
recommend_next: [pharmacology, toxicology],
confidence: 0.95,
warnings: [],
timestamp: ISO8601
}

scripts/templates.json

21种命名反应模板,包含SMARTS、预期产率、反应条件和参考文献。包括:Suzuki、Heck、Buchwald-Hartwig、Grignard、Wittig、Diels-Alder、点击化学、Sonogashira、Negishi等。

链式调用

  1. 1. 名称 → 完整档案: chainentry.py 使用 {name: ibuprofen} → 属性 + 绘图 + 逆合成
  2. 化学 → 药理学: 输出直接输入到 pharma-pharmacology-agent
  3. 逆合成 + 可视化: 获取前体,然后绘制每个前体
  4. Suzuki测试: --action react --reactants c1ccccc1Br c1ccccc1B(O)O --smarts [c:1][Br:2].[c:3]B(O)O>>[c:1][c:3]

测试验证

所有功能已使用RDKit 2024.03+进行端到端验证:

分子SMILES通过测试
咖啡因CN1C=NC2=C1C(=O)N(C(=O)N2C)C信息、结构、属性、绘图、逆合成、规划、链式调用
阿司匹林
CC(=O)Oc1ccccc1C(=O)O | 信息、结构、属性、绘图、逆合成、规划、链式调用 |
| 索托拉西布 | PubChem名称查询 | 信息、结构、属性、绘图、逆合成、链式调用 |
| 布洛芬 | PubChem名称查询 | 信息、结构、属性、链式调用 |
| 无效SMILES | XXXINVALID | 优雅的JSON错误处理 |
| 空输入 | {} | 优雅的JSON错误处理 |

资源

  • - references/apiendpoints.md — PubChem API端点参考和速率限制
  • scripts/rdkitreaction.py — 遗留反应模块
  • scripts/chemblquery.py、scripts/pubmedsearch.py、scripts/admet_predict.py — 其他查询模块

更新日志

v1.4.0(2026-02-14)

  • - 修复PubChem SMILES/InChI端点(property/CanonicalSMILES/TXT)
  • 修复chainentry.py中的HTML实体损坏问题
  • 修复bricsretro以正确处理BRICSDecompose字符串输出
  • 为所有PubChem调用添加请求超时(15秒)
  • 对无效SMILES和空输入进行优雅的错误处理
  • 更新链式调用输出版本和模式
  • 全面的端到端测试

v1.3.0

  • - RDKit属性NoneType修复,无效SMILES优雅错误处理
  • 反应修复:ReactionFromSmarts导入
  • 通过PubChem为所有RDKit操作添加名称解析

v1.2.0

  • - BRICS逆合成 + 21种反应模板库
  • 多步合成规划

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 chemistry-query-1776419965 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 chemistry-query-1776419965 技能

通过命令行安装

skillhub install chemistry-query-1776419965

下载

⬇ 下载 chemistry-query v1.0.0(免费)

文件大小: 16.73 KB | 发布时间: 2026-4-17 20:04

v1.0.0 最新 2026-4-17 20:04
chemistry-query v1.0.0

- Initial release of full-stack chemistry toolkit integrating PubChem API queries and RDKit cheminformatics.
- Supports compound lookup, molecular properties, 2D visualization, retrosynthesis, multi-step synthesis planning, and reaction simulation.
- Provides structured JSON outputs, PNG/SVG molecule images, and automatic chemical name resolution.
- Includes 21 named reaction templates and chaining capabilities for seamless chemistry workflows.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部