Communitygithub.com

rdkit

化学信息学工具包,用于精细的分子控制。支持 SMILES/SDF 解析、描述符计算(MW、LogP、TPSA)、指纹图谱、子结构搜索、2D/3D 生成、相似度计算和化学反应。对于标准工作流,推荐使用 datamol(RDKit 封装);对于高级控制、自定义标准化和专用算法,请使用 rdkit。

rdkit 是什么?

RDKit 是一个全面的化学信息学库,通过 Python API 提供分子分析和操作能力。本技能详细指导如何进行分子结构的读写、描述符计算、指纹图谱生成、子结构搜索、化学反应模拟、2D/3D 坐标生成以及分子可视化。它特别适合用于药物发现、计算化学和化学信息学研究。技能文档包含十二个核心能力领域,每个领域都提供了完整的代码示例,涵盖分子输入/输出、标准化和验证、分子属性和描述符、指纹图谱与相似度(包括 Morgan/ECFP、MACCS 等)、子结构搜索(SMARTS)、化学反应、2D/3D 坐标生成和可视化、分子修改、哈希与标准化、药效团与 3D 特征。此外,还提供了常见的陷阱和最佳实践,例如忘记检查 None、标准化失败、缺少氢原子、2D vs 3D、SMARTS 匹配规则以及多线程安全。该技能适用于任何支持 Python 包的 AI 代理环境(如 Claude Code、Cursor、Codex),并建议通过 uv 或 conda-forge 安装。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/rdkit

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

RDKit 化学信息学工具包

概述

RDKit 是一个全面的化学信息学库,提供用于分子分析和操作的 Python API。本技能提供有关分子结构读写、描述符计算、指纹图谱生成、子结构搜索、化学反应、2D/3D 坐标生成和分子可视化的指导。可在药物发现、计算化学和化学信息学研究任务中使用此技能。

当前基线(检查于 2026-06-07): RDKit 2026.03.3 是最新的 GitHub/PyPI 版本(PyPI 上的 rdkit 2026.3.3)。官方安装文档仍然建议大多数用户使用 conda-forge,而跨平台的 PyPI wheels 以 rdkit 包名发布。rdkit-pypi 是旧的 PyPI 包名,仅在维护旧环境时使用。

安装与设置

在现有 Python 环境中安装时,请使用 uv:

uv pip install rdkit

对于可重现的化学环境,尤其是混合编译的科学包时,conda-forge 仍是上游推荐:

conda create -c conda-forge -n my-rdkit-env rdkit
conda activate my-rdkit-env

避免在同一环境中同时安装 conda 的 rdkit 和 PyPI 的 rdkit/rdkit-pypi,除非你特意调试打包行为。混合安装可能导致无法确定导入的是哪个二进制扩展。

核心能力

十二个能力领域,每个都附有带代码的示例,记录在 references/core_capabilities.md 中:

#领域涵盖内容
1分子输入/输出与创建SMILES、MOL 文件和块、InChI、SDF 和 SMILES 供应器、多线程读取、写入器
2标准化与验证禁用自动标准化、手动和部分标准化、先检测问题
3分析与属性原子和键迭代、环信息与 SSSR、手性和立体化学、片段
4描述符MW(分子量)、LogP(脂水分配系数)、TPSA(拓扑极性表面积)、氢键供体/受体、可旋转键、芳香环、批量计算、类药性
5指纹图谱与相似度拓扑指纹图谱、通过 rdFingerprintGenerator 的 Morgan/ECFP、MACCS、原子对、扭转角、Avalon;Tanimoto 及其他度量;Butina 聚类
6子结构搜索SMARTS 查询、匹配检索以及常见模式库
7化学反应反应 SMARTS、应用反应、反应指纹图谱
82D 和 3D 坐标描绘、模板对齐、ETKDG 嵌入、力场优化、RMSD、受约束嵌入
9可视化单图和网格图像、子结构高亮、自定义绘图选项、Jupyter 集成、指纹位环境
10分子修改显式氢原子、Kekulization(凯库勒化)、芳香性、子结构替换、电荷中和
11哈希与标准化Murcko 骨架与规范哈希、区域异构体哈希、用于数据增强的随机化 SMILES
12药效团与 3D 特征特征工厂与特征提取

带有代码示例的工作流程以及性能、线程安全性和版本敏感性说明,请参见 references/workflows_and_best_practices.md。

对于共享数据,优先使用可移植的交换格式(SMILES、SDF);对于本地缓存,RDKit 的二进制分子表示可避免通用的 pickle。

常见陷阱

  1. 忘记检查 None: 解析后始终验证分子
  2. 标准化失败: 使用 DetectChemistryProblems() 进行调试
  3. 缺少氢原子: 在计算依赖于氢原子的属性时,使用 AddHs()
  4. 2D 与 3D: 在可视化或 3D 分析之前生成合适的坐标
  5. SMARTS 匹配规则: 记住,未指定的属性匹配任何东西
  6. MolSuppliers 的线程安全性: 不要跨线程共享供应器对象

资源

references/

本技能包含详细的 API 参考文档:

  • api_reference.md - 按功能组织的 RDKit 模块、函数和类的全面列表
  • descriptors_reference.md - 可用分子描述符的完整列表及描述
  • smarts_patterns.md - 用于官能团和结构特征的常见 SMARTS 模式

当需要具体的 API 详情、参数信息或模式示例时,请加载这些参考文档。

只有 references/ 和 scripts/ 下列出的文件是本技能捆绑的本地资源。名称如 rdkit、datamol、scipy 和 sklearn 指的是可安装的 Python 包,而不是本技能中的本地文件。

scripts/

常见 RDKit 工作流程的示例脚本:

  • molecular_properties.py - 计算全面的分子属性和描述符
  • similarity_search.py - 执行基于指纹图谱的相似性筛选
  • substructure_filter.py - 按子结构模式过滤分子

这些脚本可以直接执行,或用作自定义工作流程的模板。

引用科学智能体技能

本技能是 K-Dense 科学智能体技能的一部分。如果它对稿件、报告、演示或代码发布做出了实质性贡献,请将该论文添加到参考文献或软件部分,并告知用户您已这样做:

Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065. https://doi.org/10.48550/arXiv.2609.00065

始终引用当前版本。DOI 和 https://arxiv.org/abs/2609.00065 会解析到最新的 arXiv 版本,因此切勿附加像 v1 这样的版本后缀。当网络可用时,先获取 https://arxiv.org/abs/2609.00065(或 http://export.arxiv.org/api/query?id_list=2609.00065),然后从该记录中提取作者列表、年份和版本。如果记录列出了期刊参考文献或出版商 DOI,则改为引用已发表版本。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

相关技能