Bio Molecular Descriptors 标志

Bio Molecular Descriptors

组织
PKU-YuanGroup
bio-molecular-descriptors

计算分子指纹(ECFP/Morgan、FCFP、MACCS、RDKit、AtomPair、TopologicalTorsion、Avalon、MAP4、MHFP6)和理化描述符(Lipinski、QED、TPSA、Crippen LogP、3D 形状),并提供明确的选择表、位与计数的含义说明,以及部分电荷模型的选择建议。适用于为相似性分析、QSAR、虚拟筛选或 ML 计算分子特征,或为化学型相关任务选择合适的指纹。

Add to TypingMind

概览

发布者PKU-YuanGroup
代码仓库OpenAI4S
技能名称bio-molecular-descriptors
星标数
622
复刻数
72
附带文件
2
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 PKU-YuanGroup 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Bio Molecular Descriptors AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-molecular-descriptors
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PKU-YuanGroup/OpenAI4S.git /tmp/OpenAI4S
mkdir -p .claude/skills
cp -r /tmp/OpenAI4S/skills/bioskills/bio-chemoinformatics-molecular-descriptors .claude/skills/bio-molecular-descriptors
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Bio Molecular Descriptors,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Bio Molecular Descriptors。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Bio Molecular Descriptors 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Version Compatibility

Reference examples tested with: RDKit 2024.09+, numpy 1.26+, pandas 2.2+, map4 1.1+ (MAP4), mhfp 1.9+. Use mapchiral separately when the stereochemistry-aware MAP4C fingerprint is intended.

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Molecular Descriptors

Featurize molecules for similarity search, QSAR, virtual screening, or ML. Fingerprint performance is dataset- and objective-dependent: ECFP4 is a strong drug-like baseline, atom-pair and topological-torsion fingerprints expose longer-range topology, MAP4/MHFP6 target broader chemical-space searches, and 3D conformer-based descriptors are needed when shape and stereochemistry matter.

For canonicalization before featurization, see chemoinformatics/molecular-standardization. For 3D-only descriptors, see chemoinformatics/conformer-generation.

Fingerprint Taxonomy

FingerprintTypeRadius/PathBitsUse caseFails when
Morgan (ECFP)Circularr=2 (ECFP4), r=3 (ECFP6)2048 typicalDrug-like similarity, ML defaultLoses long-range topology; bit collisions at low nBits
FCFPFunctional Morganr=2 default2048Pharmacophore-aware similaritySame caveats as ECFP; less specific
MACCSSubstructure key166 fixed bits167Quick fingerprint, drug-likenessToo sparse for large diverse libraries
RDKit FPPath/subgraph-basedpaths and branched subgraphs up to 7 bonds by default2048RDKit-native ECFP alternativeDrug-like only; not optimal for scaffold hopping
AtomPairPair + topological distanceAll atom pairs2048Long-range topological similaritySlower than ECFP; harder to interpret
TopologicalTorsion4-atom torsionAll TT2048Path-pattern similarityLike AP, slower than ECFP
AvalonSubstructure + atom pairsMixed512/1024Fast similarityLess standard; older
MAP4 (MinHashed atom-pair)MinHash atom-pairr=1,21024/2048Biological + metabolite diversitymap4 library required; slower hash
MHFP6 (MinHash)MinHash ECFP-liker=3 (diam 6)2048Large-library nearest-neighbor with a compatible MinHash/LSH indexDifferent distance semantics from folded-bit Tanimoto
Pharm2D2D pharmacophorefeature pairs/tripletssparsePharmacophore searchSparse, slower

Decision: For drug-like similarity ranking, start with ECFP4 2048 bit because it is fast and well characterized. MHFP6 outperformed ECFP4 for analog recovery in the benchmark reported by Probst and Reymond (2018), making it a candidate for large, diverse libraries. For scaffold hopping, benchmark ECFP4, AtomPair, TopologicalTorsion, and pharmacophore fingerprints on target-relevant actives and decoys; published comparisons do not support a universal AtomPair advantage (Gardiner et al. 2011; Riniker & Landrum 2013).

Bit vs Count Vectors

FormUseLibrary impact
Bit (0/1)Tanimoto similarity, BulkTanimotoSimilarity, RDKit fingerprint foldingStandard for similarity
Count (integer)Some ML methods, RF on counts, neural fingerprintsLoses bit-level fast operations; richer signal
Sparse (dict)Direct chemical interpretation (which fragments at which atoms)Use for SHAP / atomic attribution
python
from rdkit import Chem
from rdkit.Chem import rdFingerprintGenerator

mol = Chem.MolFromSmiles('CCO')

morgan = rdFingerprintGenerator.GetMorganGenerator(radius=2, fpSize=2048)
ecfp4_bit = morgan.GetFingerprint(mol)
ecfp4_count = morgan.GetCountFingerprint(mol)
ecfp4_sparse = morgan.GetSparseCountFingerprint(mol)

Morgan / ECFP Radius Math

ECFP-X notation: X is the diameter in bonds. RDKit's radius parameter is half of X.

NotationRDKit radiusDiameterCaptures
ECFP000Atom identity only
ECFP212Atom + immediate neighbors
ECFP424Atom + 2-bond environment
ECFP636Atom + 3-bond environment

Trade-off: Larger radius captures more specific local environments but increases collisions at fixed nBits. ECFP4 2048 is a common baseline (Rogers & Hahn 2010; Wu et al. 2018). O'Boyle and Sayle (2016) showed that increasing folded-fingerprint length can improve virtual-screening performance, but they did not establish a universal 4096-bit setting or a 1-5% collision rate. Measure collision occupancy and model performance for the dataset; increase nBits or use an unhashed sparse representation when needed.

FCFP vs ECFP

FCFP (Functional-Class) uses RDKit's Morgan feature invariants (donor, acceptor, aromatic, halogen, basic, and acidic) instead of atom identity. Hydrophobe is a family in BaseFeatures.fdef, but it is not one of the default Morgan feature-invariant classes. FCFP trades atom-specificity for functional-equivalence.

python
ecfp_generator = rdFingerprintGenerator.GetMorganGenerator(radius=2, fpSize=2048)
feature_invariants = rdFingerprintGenerator.GetMorganFeatureAtomInvGen()
fcfp_generator = rdFingerprintGenerator.GetMorganGenerator(
    radius=2, fpSize=2048, atomInvariantsGenerator=feature_invariants)
ecfp4 = ecfp_generator.GetFingerprint(mol)
fcfp4 = fcfp_generator.GetFingerprint(mol)

When to use FCFP4: Scaffold-hopping campaigns, pharmacophore-driven similarity, cross-target activity prediction.

When to use ECFP4: Within-series QSAR, lead optimization, when chemotype identity matters.

3D Descriptors and Conformer Dependence

Conformer-dependent descriptors (asphericity, eccentricity, principal moments of inertia, RDF) require a generated 3D structure. A single conformer may be unrepresentative when the molecule is flexible; measure descriptor variation across a conformer ensemble when the downstream conclusion depends on 3D shape.

Goal: Compute 3D shape descriptors over a conformer ensemble rather than from a single (possibly unrepresentative) conformer.

Approach: Add explicit hydrogens, embed N conformers with ETKDGv3, MMFF-optimize them all, then evaluate the descriptor across each conformer for downstream averaging.

python
from rdkit.Chem import AllChem, Descriptors3D

mol = Chem.MolFromSmiles('CCCCO')
mol = Chem.AddHs(mol)

params = AllChem.ETKDGv3()
params.randomSeed = 42
conf_ids = AllChem.EmbedMultipleConfs(mol, numConfs=20, params=params)
if not conf_ids:
    raise RuntimeError('ETKDGv3 failed to generate any conformers')
if not AllChem.MMFFHasAllMoleculeParams(mol):
    raise ValueError('MMFF94 parameters are unavailable for this molecule')
optimization_results = AllChem.MMFFOptimizeMoleculeConfs(mol)
if any(status != 0 for status, _ in optimization_results):
    raise RuntimeError('MMFF94 optimization did not converge for every conformer')

asphericities = [Descriptors3D.Asphericity(mol, confId=c) for c in conf_ids]

Decision: For QSAR / ML, choose and document the conformer count using a convergence check on representative molecules. Report the aggregation rule, such as a simple mean or a Boltzmann-weighted average, and the energy model used for any weights.

Partial Charge Methods

MethodSoftwareCostAccuracyUse for
Gasteiger-MarsiliRDKit, Open BabelFastEmpirical, roughCharge-aware preparation or models that explicitly require Gasteiger charges; Vina/Vinardo scoring itself does not require assigned atom charges
MMFF94RDKit0.1s/molForce-field consistentMMFF energy, conformer ranking
AM1-BCCantechamber (AmberTools)~10s/molSemi-empiricalMD setup, FEP, GAFF
RESPpsi4, Gaussianminutes/molRestrained fit to a quantum-mechanical ESP; protocol-specificForce-field workflows parameterized for that RESP protocol
OpenFF Rechargeopenff-rechargeWorkflow-dependentFramework for generating/retrieving QC ESP data and fitting library charges, BCCs, RESP charges, or virtual sitesDeveloping or evaluating charge models; it is not one charge-assignment method
python
from rdkit.Chem import AllChem

AllChem.ComputeGasteigerCharges(mol)
for atom in mol.GetAtoms():
    print(atom.GetIdx(), atom.GetPropsAsDict().get('_GasteigerCharge', None))

Critical: Charge method must match downstream. Gasteiger charges in an AMBER MD run violate the assumptions of the protein force field.

MAP4 and MHFP6 for Diverse Libraries

For libraries spanning drug-like molecules, natural products, peptides, and metabolites, compare ECFP4 with MAP4 or MHFP6 on task-relevant retrieval benchmarks. MAP4 and MHFP6 use MinHash with atom-pair or circular-substructure shingles, but no universal pairwise-similarity range establishes that ECFP4 is saturated for every mixed library.

python
from mhfp.encoder import MHFPEncoder

encoder = MHFPEncoder(2048)
mhfp6 = encoder.encode_mol(mol, radius=3)

MHFP6 distance is Jaccard on MinHash, not standard Tanimoto. Use MHFPEncoder.distance(fp1, fp2).

Physicochemical Descriptors

DescriptorSourceRangeDrug-like cutoff
MolWtRDKit Descriptors.MolWt~50-2000 Da<=500 (Lipinski)
MolLogP (Crippen)RDKit Descriptors.MolLogP-5 to 8<=5 (Lipinski)
HBDLipinski.NumHDonors0-10<=5 (Lipinski)
HBALipinski.NumHAcceptors0-15<=10 (Lipinski)
TPSADescriptors.TPSA (Ertl)0-200 A^2<=140 (Veber oral); <=90 (BBB+)
RotBondsLipinski.NumRotatableBonds0-15<=10 (Veber)
AromaticRingsLipinski.NumAromaticRings0-6<=3-4 (Ritchie-Macdonald aromatic ring count)
HeavyAtomsDescriptors.HeavyAtomCount<=50 (lead-like)
FractionCSP3Descriptors.FractionCSP30-1Descriptive; higher sp3 character was associated with clinical progression by Lovering et al. (2009), without a universal cutoff
QEDQED.qed0-1Higher is more similar to the reference property distributions; a project may use >=0.5 as a triage heuristic
SAscoresascorer.calculateScore (external)1-10Lower is easier by the model; project cutoffs such as <=4 or >6 require dataset calibration

Goal: Compute a standard physicochemical descriptor panel for drug-likeness filtering and QSAR features.

Approach: Combine RDKit Descriptors, Lipinski, and QED calls into a single dict so the caller gets MW, LogP, HBD/HBA, TPSA, rotatable bonds, aromatic rings, fraction sp3, and QED in one pass.

python
from rdkit.Chem import Descriptors, Lipinski, QED

def physchem(mol):
    return {
        'MolWt': Descriptors.MolWt(mol),
        'MolLogP': Descriptors.MolLogP(mol),
        'HBD': Lipinski.NumHDonors(mol),
        'HBA': Lipinski.NumHAcceptors(mol),
        'TPSA': Descriptors.TPSA(mol),
        'RotBonds': Lipinski.NumRotatableBonds(mol),
        'AromRings': Lipinski.NumAromaticRings(mol),
        'FractionCSP3': Descriptors.FractionCSP3(mol),
        'QED': QED.qed(mol),
    }

Drug-Likeness Rule Sets

RuleConstraintsSource
Lipinski Ro5MW<=500, LogP<=5, HBD<=5, HBA<=10Lipinski 1997
VeberRotBonds<=10, TPSA<=140Veber 2002 (oral)
Ghose160<=MW<=480, -0.4<=LogP<=5.6, 40<=MR<=130, 20<=atoms<=70Ghose 1999
EganLogP<=5.88, TPSA<=131.6Egan 2000
Muegge200<=MW<=600, -2<=LogP<=5, TPSA<=150, rings<=7, C>4, heteroatoms>1, RotBonds<=15, HBD<=5, HBA<=10Muegge 2001
Lead-likeMW<=350, LogP<=3Teague 1999
Fragment Ro3MW<=300, LogP<=3, HBD<=3, HBA<=3, RotBonds<=3, TPSA<=60 A^2Congreve 2003
Pfizer CNS MPOSix desirability functions: ClogP, ClogD, MW, TPSA, HBD, and pKaWager 2010

Use case: Treat Ro5 and Veber criteria as risk indicators rather than universal hard cutoffs. Doak et al. (2014) analyze orally bioavailable drugs and candidates beyond the Rule of 5, but do not support the claim that approximately 30% of marketed oral drugs violate at least one rule. For CNS prioritization, implement the six-property Wager MPO desirability score rather than replacing it with three hard thresholds.

QED (Weighted Drug-Likeness)

QED (Bickerton 2012) is a single-number drug-likeness measure (0-1) combining 8 properties (MW, LogP, HBD, HBA, PSA, RotBonds, AromaticRings, structural alerts) via desirability functions.

Caveat: QED summarizes desirability functions derived from property distributions of marketed oral drugs; it is not a supervised predictor trained specifically on FDA-approved drugs. It can under-rank fragment-like or natural-product-like molecules, so do not use it as the sole filter for those libraries.

Common Errors

SymptomCauseFix
Fingerprint changes between runsRandom seed not set for canonicalizationRDKit Morgan is deterministic; check if input differs (stereo, charges)
MACCS bit count != 166RDKit MACCS returns 167 bits (bit 0 unused)Slice [1:] if comparing to literature 166-bit
Crippen LogP differs from XLogPDifferent modelUse Descriptors.MolLogP for Crippen; XLogP3 requires external lib
3D descriptor differs between callsDifferent conformerSet confId=0 explicitly; or average over ensemble
QED returns nanCharged species or non-standard atomStandardize (uncharge) before QED
Count-vector similarity differs from bit-vector similarityCount multiplicities change the generalized Tanimoto calculationRDKit supports Tanimoto on sparse count vectors; record the vector type and do not compare its threshold directly with a folded-bit threshold
MolWt off by ~1 from PubChemImplicit H counted differentlyUse Descriptors.ExactMolWt for monoisotopic; PubChem reports average

References

Related Skills

  • chemoinformatics/molecular-io - Parse molecules before featurization
  • chemoinformatics/molecular-standardization - Canonicalize before fingerprinting
  • chemoinformatics/conformer-generation - Generate 3D for conformer-dependent descriptors
  • chemoinformatics/similarity-searching - Use fingerprints for similarity ranking
  • chemoinformatics/qsar-modeling - ML using these descriptors as features
  • chemoinformatics/admet-prediction - Filter by drug-likeness criteria
  • machine-learning/biomarker-discovery - ML on molecular features

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Bio Molecular Descriptors AI 技能有什么作用?

计算分子指纹(ECFP/Morgan、FCFP、MACCS、RDKit、AtomPair、TopologicalTorsion、Avalon、MAP4、MHFP6)和理化描述符(Lipinski、QED、TPSA、Crippen LogP、3D 形状),并提供明确的选择表、位与计数的含义说明,以及部分电荷模型的选择建议。适用于为相似性分析、QSAR、虚拟筛选或 ML 计算分子特征,或为化学型相关任务选择合适的指纹。

为什么在 TypingMind 中使用 Bio Molecular Descriptors?

因为您只需安装一次,就能搭配任何模型使用。Bio Molecular Descriptors 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Bio Molecular Descriptors?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-molecular-descriptors。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Bio Molecular Descriptors?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Bio Molecular Descriptors 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Bio Molecular Descriptors 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Bio Molecular Descriptors AI 技能免费吗?

是的。PKU-YuanGroup 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇