Bio Molecular Descriptors logo

Bio Molecular Descriptors

Organization
PKU-YuanGroup
bio-molecular-descriptors

Calculates molecular fingerprints (ECFP/Morgan, FCFP, MACCS, RDKit, AtomPair, TopologicalTorsion, Avalon, MAP4, MHFP6) and physicochemical descriptors (Lipinski, QED, TPSA, Crippen LogP, 3D shape) with explicit choice tables, bit vs count semantics, and partial-charge model selection. Use when featurizing molecules for similarity, QSAR, virtual screening, or ML, or selecting the correct fingerprint for a chemotype-aware task.

Overview

PublisherPKU-YuanGroup
RepositoryOpenAI4S
Skill namebio-molecular-descriptors
Stars
622
Forks
72
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by PKU-YuanGroup on GitHub. Read the source before you install it.

Installation

Install the Bio Molecular Descriptors AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-molecular-descriptors
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Bio Molecular Descriptors in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Bio Molecular Descriptors on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Bio Molecular Descriptors is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Bio Molecular Descriptors AI skill do?

Calculates molecular fingerprints (ECFP/Morgan, FCFP, MACCS, RDKit, AtomPair, TopologicalTorsion, Avalon, MAP4, MHFP6) and physicochemical descriptors (Lipinski, QED, TPSA, Crippen LogP, 3D shape) with explicit choice tables, bit vs count semantics, and partial-charge model selection. Use when featurizing molecules for similarity, QSAR, virtual screening, or ML, or selecting the correct fingerprint for a chemotype-aware task.

Why use Bio Molecular Descriptors on TypingMind?

Because you install it once and use it with any model. Bio Molecular Descriptors is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Bio Molecular Descriptors in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-molecular-descriptors. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Bio Molecular Descriptors?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Bio Molecular Descriptors?

As many as you like. As long as a model supports skills, you can use Bio Molecular Descriptors with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Bio Molecular Descriptors AI skill free?

Yes. It is published on GitHub by PKU-YuanGroup under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇