Communitygithub.com

rdkit

用於精細分子操控的化學資訊學工具包。支援 SMILES/SDF 解析、描述符(分子量、LogP、TPSA)、指紋、子結構搜尋、2D/3D 生成、相似度與反應。如需更簡潔的標準工作流程,請使用 datamol(RDKit 的包裝器)。rdkit 適用於進階控制、自訂標準化與特殊演算法。

rdkit 是什麼?

RDKit 是一個全面的化學資訊學函式庫,提供 Python API 進行分子分析與操作。此技能涵蓋分子結構的讀寫、描述符計算、指紋生成、子結構搜尋、化學反應、2D/3D 座標生成以及分子視覺化,特別適用於藥物發現、計算化學與化學資訊學研究。目前最新版本為 RDKit 2026.03.3,官方建議大多數使用者透過 conda-forge 安裝,跨平台 PyPI 套件則以 `rdkit` 名稱發布。技能包含十二大核心功能,如分子 I/O、標準化與驗證、相似度聚類、藥效團特徵抽取等,並提供詳細的 API 參考文件與實用腳本。使用者應注意解析後務必檢查空值、使用 `DetectChemistryProblems()` 除錯標準化失敗、以及避免跨執行緒共用供應器物件等常見陷阱。此技能是 Scientific Agent Skills 系列的一部分,若其對稿件、報告或程式碼發布有重要貢獻,建議引用相關論文。

相容平台~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 輪子以 rdkit 套件名稱發布。rdkit-pypi 是舊的 PyPI 套件名稱,僅應在維護舊環境時使用。

安裝與設定

使用 uv 安裝至現有的 Python 環境:

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分子 I/O 與建立SMILES、MOL 檔案與區塊、InChI、SDF 與 SMILES 供應器、多執行緒讀取、寫入器
2標準化與驗證停用自動標準化、手動與部分標準化、先檢測問題
3分析與屬性原子與鍵迭代、環資訊與 SSSR、手性與立體化學、片段
4描述符分子量、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. 忘記檢查空值: 解析後務必驗證分子
  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 - 根據子結構模式過濾分子

這些腳本可以直接執行,或作為自訂工作流程的範本。

引用 Scientific Agent Skills

此技能是 K-Dense 推出的 Scientific Agent Skills 系列的一部分。若其對稿件、報告、簡報或程式碼發布有重要貢獻,請將該論文加入參考文獻或軟體章節,並告知使用者您已這麼做:

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.

相關技能