rdkit-repr

rdkit-repr:一个标准化的命令行接口工具,用于 RDKit 分子特征化工作流。支持从 SMILES 数据集(.csv 或 .smi)计算理化描述符并输出为 .csv,以及提取分子指纹并输出为 .npy 或 .csv,内置 SMILES 验证功能。适用于需要批量生成 RDKit 描述符或指纹,或列出可用描述符名称和预设配置的场景。

仓库最近推送
GitHub Stars
166
Forks
30
Issues / PRs
13

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "rdkit-repr":https://skillpi.com/zh/skills/deepskill-f799ea6a91e3c577ed593768b6f912f888f431bd93c8ef6f64d8f0ebd204bc14。安装前核对上游来源和版本:https://github.com/jinzhezenggroup/computational-chemistry-agent-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

rdkit-repr:一个标准化的命令行接口工具,用于 RDKit 分子特征化工作流。支持从 SMILES 数据集(.csv 或 .smi)计算理化描述符并输出为 .csv,以及提取分子指纹并输出为 .npy 或 .csv,内置 SMILES 验证功能。适用于需要批量生成 RDKit 描述符或指纹,或列出可用描述符名称和预设配置的场景。

0 下载

介绍来源: third_party · jinzhezenggroup · 1.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: rdkit-repr
description: >
  A standardized CLI wrapper for RDKit molecular featurization workflows that handles
  physicochemical descriptor computation (outputs .csv) and molecular fingerprint extraction
  (outputs .npy or .csv), with built-in SMILES validation.
  USE WHEN you need to compute RDKit molecular descriptors or fingerprints from SMILES
  datasets (.csv/.smi), or when you want to list all available descriptor names and presets.
compatibility: Requires uv. Dependencies (rdkit, pandas, numpy) are declared as PEP 723 inline script metadata and are installed automatically when the script is invoked with `uv run <script_path>` (do NOT use `uv run python <script_path>` -- that bypasses the inline metadata and will not install dependencies automatically).
metadata:
  author: luzitian
  version: '1.0'
  repository: https://github.com/rdkit/rdkit

RDKit Molecular Featurization

This skill provides practical command patterns for RDKit descriptor and fingerprint extraction using the standardized CLI wrapper: <skill_path>/scripts/rdkit_helper.py.

Key behaviors (important for Agents):

  • The script prints environment detection (Python/RDKit/NumPy/Pandas) by default.
  • Bad/illegal SMILES are skipped and logged to *.skipped.csv (no crash).
  • Each run ends by printing absolute output paths like:
    • [RESULT] desc_csv=/abs/path.csv
    • [RESULT] fp_npy=/abs/path.npy
    • [RESULT] fp_csv=/abs/path.csv

Quick Start

Check CLI help:

uv run <skill_path>/scripts/rdkit_helper.py --help

Check subcommand help:

uv run <skill_path>/scripts/rdkit_helper.py desc --help
uv run <skill_path>/scripts/rdkit_helper.py fp --help
uv run <skill_path>/scripts/rdkit_helper.py list-desc --help

Disable environment printing (optional):

uv run <skill_path>/scripts/rdkit_helper.py --no-env desc --smiles "CCO" --output out.csv

Core Tasks

1) Compute physicochemical descriptors → .csv

Single SMILES (default preset: physchem, 25 descriptors):

uv run <skill_path>/scripts/rdkit_helper.py desc \
    --smiles "CCO" \
    --output /tmp/CCO.desc.csv

From CSV (default SMILES column is smiles):

uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file data.csv \
    --smiles-col smiles \
    --output data.desc.csv

From SMI:

uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file molecules.smi \
    --output molecules.desc.csv

Choose a descriptor preset:

# Lipinski drug-likeness (6 descriptors: MolWt, MolLogP, NumHDonors, ...)
uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file data.csv --preset lipinski --output data.lipinski.csv

# Extended physicochemical (25 descriptors, default)
uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file data.csv --preset physchem --output data.physchem.csv

# Topological / graph indices (56 descriptors: BalabanJ, BertzCT, Chi*, PEOE_VSA*, ...)
uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file data.csv --preset topological --output data.topo.csv

# All RDKit descriptors (~200 descriptors)
uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file data.csv --preset all --output data.all_desc.csv

Select specific descriptors (overrides --preset):

uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file data.csv \
    --descriptors "MolWt,MolLogP,TPSA,NumHDonors,NumHAcceptors" \
    --output data.custom.csv

Suppress merging back original CSV columns (output only smiles + descriptors):

uv run <skill_path>/scripts/rdkit_helper.py desc \
    --file data.csv --preset physchem --no-merge --output data.desc_only.csv

2) Compute molecular fingerprints → .npy or .csv

Available fingerprint types:

Type Description Default bits
morgan2 Morgan circular FP radius 2 (ECFP4-like), bit vector 2048
morgan3 Morgan circular FP radius 3 (ECFP6-like), bit vector 2048
morgan2_count Morgan radius-2 count vector 2048
rdkit RDKit path-based FP, bit vector 2048
maccs MACCS 167 structural keys (bit vector, --nbits ignored) 167
topological Topological torsion FP (count vector, hashed to --nbits) 2048
atompair Atom-pair FP (count vector, hashed to --nbits) 2048
layered Layered substructure FP, bit vector 2048
pattern SMARTS pattern FP, bit vector 2048

Single SMILES, output as NumPy array (.npy):

uv run <skill_path>/scripts/rdkit_helper.py fp \
    --smiles "CCO" \
    --type morgan2 \
    --output /tmp/CCO.morgan2.npy

From CSV, Morgan ECFP4 (2048 bits):

uv run <skill_path>/scripts/rdkit_helper.py fp \
    --file data.csv \
    --smiles-col smiles \
    --type morgan2 \
    --nbits 2048 \
    --output data.morgan2.npy

From SMI, MACCS keys (always 167 bits):

uv run <skill_path>/scripts/rdkit_helper.py fp \
    --file molecules.smi \
    --type maccs \
    --output molecules.maccs.npy

Output as CSV (smiles + bit_0 … bit_N-1 columns):

uv run <skill_path>/scripts/rdkit_helper.py fp \
    --file data.csv \
    --type rdkit \
    --nbits 1024 \
    --format csv \
    --output data.rdkfp.csv

Atom-pair fingerprint, 4096 bits:

uv run <skill_path>/scripts/rdkit_helper.py fp \
    --file data.csv \
    --type atompair \
    --nbits 4096 \
    --output data.atompair.npy

3) List available descriptors

List all descriptors and built-in presets:

uv run <skill_path>/scripts/rdkit_helper.py list-desc

List descriptors in a specific preset group:

uv run <skill_path>/scripts/rdkit_helper.py list-desc --group lipinski
uv run <skill_path>/scripts/rdkit_helper.py list-desc --group physchem
uv run <skill_path>/scripts/rdkit_helper.py list-desc --group topological
uv run <skill_path>/scripts/rdkit_helper.py list-desc --group all

Descriptor Presets Reference

Preset Count Typical Use
lipinski 6 Quick drug-likeness screening (Ro5 filter)
physchem 25 General ML features: MW, logP, TPSA, ring counts, charge stats, …
topological 56 Graph/topology indices: Balaban J, Kappa, Chi, PEOE_VSA, EState_VSA, …
all ~200 Full RDKit descriptor set (includes fragment counts, MQN, etc.)

Output Format Notes

desc output (CSV):

  • Columns: smiles, then one column per descriptor.
  • When --file is a .csv and --no-merge is not set, original CSV columns are appended.
  • Rows only contain valid SMILES (invalid ones are logged to *.skipped.csv).

fp output:

  • .npy (default): NumPy array of shape (N_valid, nbits), dtype uint8 (bit) or int32 (count).
  • .csv: smiles column followed by bit_0 … bit_{nbits-1} columns.
  • MACCS keys always produce 167 bits regardless of --nbits.

Agent Checklist

When using this skill for users:

  1. Confirm input format:
    • .csv requires a SMILES column (default smiles)
    • .smi uses the first token of each line as SMILES
  2. Quote SMILES containing special shell characters (brackets/parentheses):
    • Example: --smiles "[C@@H](O)(F)Cl"
  3. For CSV workflows, verify column names:
    • desc: --smiles-col
    • fp: --smiles-col
  4. Choose the right preset or fingerprint type for the downstream task:
    • Drug screening / Ro5: --preset lipinski
    • General ML featurization: --preset physchem or --type morgan2
    • Structural similarity search: --type morgan2 or --type rdkit
    • Substructure matching: --type maccs or --type pattern
  5. Watch for skipped SMILES:
    • Check *.skipped.csv and decide whether to fix or permanently drop them
  6. Always capture absolute output paths:
    • Look for [RESULT] ...=/abs/path in stdout
  7. If debugging is needed, enable full traceback:
    • RDKIT_HELPER_TRACE=1 uv run <skill_path>/scripts/rdkit_helper.py ...

References

当前收录版本

1.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值88/100

亮点

  • 提供标准化的 RDKit 分子描述符与指纹提取 CLI 工具,适用于药物发现、ML 特征工程等实际场景
  • 支持多种输入格式(CSV/SMI)和输出格式(CSV/NPY),内置 SMILES 验证与错误处理机制
触发精准92/100

亮点

  • description 明确说明适用场景(计算描述符/指纹、列出可用描述符),frontmatter 与 body 中 USE WHEN 条件清晰
  • 触发词覆盖合理,边界清晰,无歧义
结构规范95/100

待提升项

  • description 格式轻微不规范 原报告严重程度:轻微

    frontmatter 中 description 使用 > 换行,但未严格单行书写

    改进建议:建议将 description 写为单行字符串,避免换行符影响解析

亮点

  • 文档结构清晰,分 Quick Start、Core Tasks、Output Format、Agent Checklist 等章节
  • 每部分提供具体命令示例,frontmatter 完整,单文件长度适中
执行可靠90/100

待提升项

  • 文档长度略长 原报告严重程度:轻微

    skill_body 内容较为详尽,可能影响快速浏览

    改进建议:可考虑将部分参考信息折叠或移至附录,保持核心流程简洁

亮点

  • 依赖通过 PEP 723 内联元数据声明,uv run 自动安装,兼容性说明清晰
  • 内置 SMILES 验证与跳过机制(输出 skipped.csv),避免执行崩溃,输出路径明确打印
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • github.com
  • www.rdkit.org

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。