cheminformatics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCheminformatics (RDKit) — Pipeline Skill (Thin Scaffold)
化学信息学(RDKit)— Pipeline Skill(轻量脚手架)
Overview
概述
Adds fingerprint selection logic, filter cascade ordering, and version-specific gotchas for RDKit workflows. The agent already knows RDKit syntax — this skill prevents parameter mismatches and deprecated API usage.
为 RDKit 工作流增加指纹选择逻辑、过滤器级联顺序以及特定版本的注意事项。Agent 已了解 RDKit 语法;此 skill 用于防止参数不匹配和弃用 API 的使用。
Usage
使用场景
- Activate when filtering compound libraries (Lipinski/Veber/PAINS)
- Activate for fingerprint similarity search or clustering
- Activate for matched molecular pair (MMP) analysis with mmpdb
- 过滤化合物库时启用(Lipinski/Veber/PAINS)
- 进行指纹相似度搜索或聚类时启用
- 使用 mmpdb 进行匹配分子对(MMP)分析时启用
Core Concepts
核心概念
Filter cascade order: Lipinski → Veber → PAINS → similarity (cheapest first, most expensive last).
Fingerprint API: Use module exclusively (since RDKit 2024.03). The path is deprecated and will be removed.
rdFingerprintGeneratorAllChem.GetMorganFingerprintAsBitVect()SMILES validation: Always parse with then explicit in try/except. Default silently returns None on partial failures.
sanitize=FalseSanitizeMol()MolFromSmiles过滤器级联顺序: Lipinski → Veber → PAINS → 相似度(先执行成本最低的过滤器,最后执行成本最高的)。
指纹 API: 仅使用 模块(自 RDKit 2024.03 起)。 路径已弃用,并将在未来版本中移除。
rdFingerprintGeneratorAllChem.GetMorganFingerprintAsBitVect()SMILES 验证: 始终先使用 解析,再在 try/except 中显式调用 。默认的 在部分解析失败时会静默返回 None。
sanitize=FalseSanitizeMol()MolFromSmilesDecision Logic
决策逻辑
Fingerprint Selection
指纹选择
| Goal | Fingerprint | Parameters | Tanimoto threshold |
|---|---|---|---|
| General similarity | Morgan (ECFP4) | radius=2, fpSize=2048 | ≥ 0.7 |
| High-specificity matching | Morgan (ECFP6) | radius=3, fpSize=4096 | ≥ 0.6 |
| Substructure screening | MACCS 166 keys | — | ≥ 0.8 |
| Pharmacophore similarity | FCFP | radius=2, | ≥ 0.6 |
| Large-scale clustering | Morgan | radius=2, fpSize=1024 | Speed over precision |
| 目标 | 指纹 | 参数 | Tanimoto 阈值 |
|---|---|---|---|
| 通用相似度 | Morgan (ECFP4) | radius=2, fpSize=2048 | ≥ 0.7 |
| 高特异性匹配 | Morgan (ECFP6) | radius=3, fpSize=4096 | ≥ 0.6 |
| 子结构筛选 | MACCS 166 keys | — | ≥ 0.8 |
| 药效团相似度 | FCFP | radius=2, | ≥ 0.6 |
| 大规模聚类 | Morgan | radius=2, fpSize=1024 | 速度优先于精度 |
Filter Thresholds
过滤阈值
| Filter | Rule | Threshold | Notes |
|---|---|---|---|
| Lipinski MW | ≤ 500 Da | Allow ≤1 violation total | Not binary pass/fail |
| Lipinski LogP | ≤ 5 | — | — |
| Lipinski HBD | ≤ 5 | — | — |
| Lipinski HBA | ≤ 10 | — | — |
| Veber TPSA | ≤ 140 Ų | Hard cutoff | — |
| Veber RotBonds | ≤ 10 | Hard cutoff | — |
| PAINS | A+B+C catalogs | HTS triage only | Don't apply to advanced compounds |
| 过滤器 | 规则 | 阈值 | 备注 |
|---|---|---|---|
| Lipinski MW | ≤ 500 Da | 总计允许 ≤1 项违规 | 不采用二元通过/失败判定 |
| Lipinski LogP | ≤ 5 | — | — |
| Lipinski HBD | ≤ 5 | — | — |
| Lipinski HBA | ≤ 10 | — | — |
| Veber TPSA | ≤ 140 Ų | 硬性截止值 | — |
| Veber RotBonds | ≤ 10 | 硬性截止值 | — |
| PAINS | A+B+C catalogs | 仅用于 HTS 筛选分流 | 不要应用于后期优化化合物 |
MMP Analysis Decision
MMP 分析决策
| Scenario | Tool | Key parameter |
|---|---|---|
| SAR from compound pairs | mmpdb fragment → index → transform | |
| Property prediction | mmpdb predict | Requires indexed DB with property data |
| Core identification | | |
| Large libraries (>10K) | mmpdb CLI | |
| 场景 | 工具 | 关键参数 |
|---|---|---|
| 基于化合物对进行 SAR 分析 | mmpdb fragment → index → transform | |
| 性质预测 | mmpdb predict | 需要包含性质数据的已索引数据库 |
| 核心结构鉴定 | | |
| 大型化合物库(>10K) | mmpdb CLI | 使用 |
Critical Parameters
关键参数
| Parameter | Value | When to change |
|---|---|---|
| Morgan radius | 2 (ECFP4) | 3 for higher specificity |
| fpSize | 2048 | 1024 for speed; 4096 for precision |
| includeChirality | False | True for stereo-sensitive applications |
| Lipinski max_violations | 1 | 0 for strict; exempt biologics entirely |
| mmpdb --min-pairs | 3 | Lower for sparse datasets |
| mmpdb --max-variable-size | 10 | Increase for macrocycle transformations |
| PAINS catalogs | A+B+C (all three) | Never use partial sets |
| 参数 | 值 | 何时调整 |
|---|---|---|
| Morgan radius | 2 (ECFP4) | 需要更高特异性时改为 3 |
| fpSize | 2048 | 追求速度时设为 1024;追求精度时设为 4096 |
| includeChirality | False | 对立体化学敏感的应用设为 True |
| Lipinski max_violations | 1 | 严格模式设为 0;生物制剂完全豁免 |
| mmpdb --min-pairs | 3 | 稀疏数据集时调低 |
| mmpdb --max-variable-size | 10 | 大环转化时调高 |
| PAINS catalogs | A+B+C(三者全部使用) | 绝不使用部分集合 |
Common Mistakes
常见错误
-
Wrong:→ Right:
AllChem.GetMorganFingerprintAsBitVect()→ Why: AllChem FP functions deprecated since RDKit 2024.03, will be removedrdFingerprintGenerator.GetMorganGenerator(radius=2, fpSize=2048).GetFingerprint(mol) -
Wrong: Defaultwithout error handling → Right:
MolFromSmiles(smi)+MolFromSmiles(smi, sanitize=False)in try/except → Why: Default silently returns None; explicit sanitize catches partial failuresSanitizeMol() -
Wrong: Lipinski as hard binary filter → Right: Allow ≤1 violation → Why: Many approved drugs violate one rule; binary filtering rejects valid candidates
-
Wrong: PAINS on clinical candidates → Right: PAINS only for HTS library triage → Why: Designed for screening artifacts; flags valid advanced compounds
-
Wrong: Morgan radius=1 → Right: radius=2 minimum (ECFP4) → Why: Radius 1 loses structural information; too many false-positive similarities
-
Wrong: Comparing FPs with different radius or nBits → Right: Identical parameters for both FPs → Why: Tanimoto only meaningful in same parameter space
-
Wrong: Ignoring stereochemistry for chiral compounds → Right:in generator → Why: Default treats enantiomers as identical
includeChirality=True -
Wrong: Fixed 0.7 threshold for all FP types → Right: Validate threshold per fingerprint type and chemical series → Why: 0.7 convention is ECFP4-specific; other types need different cutoffs
-
Wrong: Raw SMILES into mmpdb → Right: Pre-canonicalize with→ Why: mmpdb expects canonical SMILES; non-canonical causes fragmentation errors
MolToSmiles(MolFromSmiles(smi)) -
Wrong: Confusing LogP with LogD → Right: Use LogD at pH 7.4 for ionizable compounds; RDKit computes LogP only → Why: LogP overestimates lipophilicity for ionizable molecules at physiological pH
-
错误:→ 正确:
AllChem.GetMorganFingerprintAsBitVect()→ 原因: AllChem FP 函数自 RDKit 2024.03 起已弃用,并将在未来版本中移除rdFingerprintGenerator.GetMorganGenerator(radius=2, fpSize=2048).GetFingerprint(mol) -
错误: 默认使用而不进行错误处理 → 正确:
MolFromSmiles(smi)+ 在 try/except 中调用MolFromSmiles(smi, sanitize=False)→ 原因: 默认行为会静默返回 None;显式 sanitize 可以捕获部分解析失败SanitizeMol() -
错误: 将 Lipinski 作为硬性二元过滤器 → 正确: 允许 ≤1 项违规 → 原因: 许多已批准药物会违反其中一项规则;二元过滤会排除有效候选物
-
错误: 对临床候选物使用 PAINS → 正确: PAINS 仅用于 HTS 化合物库筛选分流 → 原因: PAINS 旨在识别筛选伪影;它会误报有效的后期优化化合物
-
错误: Morgan radius=1 → 正确: radius 最低为 2(ECFP4) → 原因: 半径 1 会丢失结构信息,并造成过多假阳性相似结果
-
错误: 比较具有不同 radius 或 nBits 的 FP → 正确: 两个 FP 使用完全相同的参数 → 原因: 只有在相同参数空间内,Tanimoto 相似度才有意义
-
错误: 对手性化合物忽略立体化学 → 正确: 在 generator 中设置→ 原因: 默认设置会将对映异构体视为相同
includeChirality=True -
错误: 对所有 FP 类型使用固定的 0.7 阈值 → 正确: 根据指纹类型和化学系列验证阈值 → 原因: 0.7 是 ECFP4 特有的惯例;其他类型需要不同的截止值
-
错误: 将原始 SMILES 直接传入 mmpdb → 正确: 先使用转换为 canonical SMILES → 原因: mmpdb 预期接收 canonical SMILES;非 canonical 输入会导致片段化错误
MolToSmiles(MolFromSmiles(smi)) -
错误: 混淆 LogP 与 LogD → 正确: 对可电离化合物使用 pH 7.4 下的 LogD;RDKit 仅计算 LogP → 原因: 在生理 pH 下,LogP 会高估可电离分子的亲脂性
Response Format
响应格式
- Lead with the command or code the user needs — explain after
- Structure as: confirm inputs → working code → key parameters explained → gotchas
- One complete working example per task; do not show every alternative
- Keep code comments minimal and functional
- Target: 50-100 lines of code with brief surrounding explanation
- 先给出用户需要的命令或代码——之后再进行解释
- 结构:确认输入 → 可运行代码 → 关键参数说明 → 注意事项
- 每项任务提供一个完整可运行示例;不要展示所有替代方案
- 保持代码注释精简且实用
- 目标:提供 50-100 行代码,并附上简要说明