chemistry-rdkit
它能做什么
该技能为在 Python 中处理化学结构提供规则。适合进行分子分析或药物发现工作的化学家和研究人员。
适用场景
- ✓当你处理以 SMILES 字符串表示的分子的时候。
- ✓当你希望计算分子质量或亲脂性等分子性质的时候。
- ✓当你需要比较分子或搜索某个化学子结构的时候。
技能链接
https://github.com/aiming-lab/AutoResearchClaw/blob/main/.claude/skills/chemistry-rdkit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这十个 SMILES 字符串与利平斯基五规则进行比对,并列出通过检验的那些。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会使用 RDKit 库读取分子,计算描述符和指纹,通过相似性比较分子,并搜索结构模式。它会先检查每个输入,因为无效的 SMILES 字符串会返回空的分子。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
RDKit Cheminformatics Best Practice
Molecular I/O
- Create molecules from SMILES:
mol = Chem.MolFromSmiles('CCO') - Always check for None:
MolFromSmilesreturns None on invalid input - Convert to canonical SMILES:
Chem.MolToSmiles(mol) - Read SDF files:
suppl = Chem.SDMolSupplier('file.sdf') - Read SMILES files:
suppl = Chem.SmilesMolSupplier('file.smi') - Write molecules:
writer = Chem.SDWriter('output.sdf')
Molecular Descriptors
- Molecular weight:
Descriptors.MolWt(mol) - LogP (lipophilicity):
Descriptors.MolLogP(mol) - TPSA (polar surface area):
Descriptors.TPSA(mol) - H-bond donors/acceptors:
Descriptors.NumHDonors(mol),Descriptors.NumHAcceptors(mol) - Rotatable bonds:
Descriptors.NumRotatableBonds(mol) - Lipinski Rule of 5: MW <= 500, LogP <= 5, HBD <= 5, HBA <= 10
Fingerprints and Similarity
- Morgan (circular) fingerprints:
AllChem.GetMorganFingerprintAsBitVect(mol, radius=2, nBits=2048) - RDKit fingerprints:
Chem.RDKFingerprint(mol) - MACCS keys:
MACCSkeys.GenMACCSKeys(mol) - Tanimoto similarity:
DataStructs.TanimotoSimilarity(fp1, fp2) - Use radius=2 (ECFP4 equivalent) as default for most applications
- For virtual screening, Tanimoto > 0.7 suggests structural similarity
Substructure Search
- SMARTS patterns:
pattern = Chem.MolFromSmarts('[OH]') - Check match:
mol.HasSubstructMatch(pattern) - Get all matches:
mol.GetSubstructMatches(pattern) - Common SMARTS:
[#6](=O)[OH](carboxylic acid),[NH2](primary amine) - Filter compound libraries by functional group presence
Property Calculation Patterns
- Batch processing: iterate over SDMolSupplier, skip None entries
- Use
Chem.Descriptors.descListfor all available descriptors - For ADMET filtering, calculate Lipinski, Veber, and PAINS filters
- Generate 3D coordinates:
AllChem.EmbedMolecule(mol, AllChem.ETKDG()) - Minimize energy:
AllChem.MMFFOptimizeMolecule(mol)
Common Pitfalls
- Always sanitize molecules (default behavior) — disable only when needed
- Add hydrogens explicitly for 3D work:
Chem.AddHs(mol) - Handle stereochemistry: use
Chem.AssignStereochemistry(mol) - Large SDF files: use
ForwardSDMolSupplierfor memory efficiency - Kekulization errors usually indicate invalid SMILES input
常见问题
什么是五规则?
一组关于分子量、亲脂性和氢键的简单限制,该技能用它来判断类药分子。
相似性分数代表什么?
Tanimoto(谷本)分数高于 0.7 表示这些分子在结构上相似。
遇到无效分子会怎样?
该技能会检查这种情况,因为无效输入会返回空的分子,而不是报错。
详情
作者的原始描述
Computational chemistry with RDKit for molecular analysis, descriptors, fingerprints, and substructure search. Use when working with SMILES, drug discovery, or cheminformatics tasks.
热度
- GitHub 星标
- 15k
- 排名
- #11046
- 许可证
- MIT
- 更新时间
- 2026/8/19
评论
- …
同一仓库的更多技能
a-evolve
15k帮你的智能体通过反复运行来不断改进:诊断失败原因,根据错误模式创建有针对性的技能,并记录经验以备日后使用。
biology-biopython
15k帮你的智能体使用 Biopython 处理 DNA、RNA 和蛋白质序列,包括文件解析、序列计算、BLAST 搜索和数据库访问。
hypothesis-formulation
15k帮你的智能体把一项观察转化为可检验的假设,附上相互竞争的解释,以及能够证伪它们的明确预测。
literature-search
15k帮你的智能体规划并执行系统性文献检索,包括检索式、纳入规则、筛选步骤,以及 PRISMA 风格的结果计数。