rdkit
Skill8 starsChanged 8 months agoMITView on GitHub
RDKit cheminformatics toolkit — molecular I/O, descriptors, fingerprints, substructure searching, reactions, and 3D conformer generation
- Installs packages
16 other projects use a version of this.
Adopted by
Most recently taken up by
- Ivan-propio/claude-skillstheir own version, first seen Nov 16, 2026
- BrightGold70/skillstheir own version, first seen Nov 8, 2026
- MarieLynneBlock/arcanum-artifextheir own version, first seen Nov 1, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- patoangolano/bio-stacktheir own version, first seen Oct 15, 2026
- Luooops/skillstheir own version, first seen Oct 13, 2026
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- wu-yc/LabClaw★ 1.1ksame name
- LeonChaoX/qinyan-academic-skills★ 910same name
- qinyan-ai/qinyan-academic-skills★ 80same name
- K-Dense-AI/drug-discovery-agent-skills★ 56same name
- lamm-mit/ScienceSkills★ 38same name
- tondevrel/scientific-agent-skills★ 22same name
- MarieLynneBlock/arcanum-artifex★ 4same name
- BrightGold70/skills★ 1same name
- djw920/claude-skills★ 1same name
- garri333/Skills★ 1same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- validate-skillsSkill
- alchemi-toolkit-opsSkill
- autoresearch-setupSkill
- bionemoSkill
- biosimspaceSkill
- cuda-quantumSkill
- cutileSkill
- daskSkill
- flashinferSkill
- materials-projectSkill
- mpiSkill
- nemotronSkill
- omniverse-simreadySkill
- physicsnemoSkill
- polarsSkill
- prime-verifiersSkill
- qiskitSkill
- raySkill
- slurmSkill
- tinkerSkill
- tritonSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 256
Sanitize Once: Don't sanitize multiple times
- Distinctive: line 257
Reuse Fingerprint Generators: Create once, use many times
- Very specific: line 258
Bulk Operations: Use BulkTanimotoSimilarity for batch calculations
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RDKit Skill
Cheminformatics and machine learning toolkit for molecular operations, property calculation, and chemical analysis.
Official Sources:
Installation
# Via conda (recommended)
conda install -c conda-forge rdkit
# Via pip
pip install rdkit
# Verify installation
python -c "from rdkit import Chem; print(Chem.__version__)"Quick Start
from rdkit import Chem
from rdkit.Chem import AllChem, Descriptors, Draw
# Create molecule from SMILES
mol = Chem.MolFromSmiles('CC(=O)Oc1ccccc1C(=O)O') # Aspirin
# Calculate properties
mw = Descriptors.MolWt(mol)
logp = Descriptors.MolLogP(mol)
# Generate fingerprint
fp = AllChem.GetMorganFingerprintAsBitVect(mol, radius=2, nBits=2048)
# Draw molecule
img = Draw.MolToImage(mol)Molecular I/O
from rdkit import Chem
# Read/write single molecules
mol = Chem.MolFromSmiles('c1ccccc1')
mol = Chem.MolFromMolFile('input.mol')
smiles = Chem.MolToSmiles(mol)
Chem.MolToMolFile(mol, 'output.mol')
# Read/write multiple molecules
suppl = Chem.SDMolSupplier('molecules.sdf')
mols = [m for m in suppl if m is not None]
with Chem.SDWriter('output.sdf') as w:
for mol in mols:
w.write(mol)Molecular Operations
# Atoms and bonds
for atom in mol.GetAtoms():
print(atom.GetSymbol(), atom.GetAtomicNum())
atom = mol.GetAtomWithIdx(0)
bond = mol.GetBondWithIdx(0).GetBondType()
# Rings
atom.IsInRing()
atom.IsInRingSize(6)
ssr = Chem.GetSymmSSSR(mol)
# Modify
mol_with_h = Chem.AddHs(mol)
mol_no_h = Chem.RemoveHs(mol)
Chem.Kekulize(mol)
Chem.SanitizeMol(mol)Molecular Descriptors
from rdkit.Chem import Descriptors, AllChem
# Common descriptors
Descriptors.MolWt(mol)
Descriptors.MolLogP(mol)
Descriptors.TPSA(mol)
Descriptors.NumHDonors(mol)
Descriptors.NumHAcceptors(mol)
Descriptors.NumRotatableBonds(mol)
# All descriptors
all_desc = Descriptors.CalcMolDescriptors(mol)
# Partial charges
AllChem.ComputeGasteigerCharges(mol)
charge = mol.GetAtomWithIdx(0).GetDoubleProp('_GasteigerCharge')Fingerprints and Similarity
from rdkit.Chem import AllChem, MACCSkeys, rdMolDescriptors
from rdkit import DataStructs
# Morgan (ECFP)
fp1 = AllChem.GetMorganFingerprintAsBitVect(mol1, radius=2, nBits=2048)
fpgen = AllChem.GetMorganGenerator(radius=2, fpSize=2048)
fp = fpgen.GetFingerprint(mol)
# RDKit fingerprint
fpgen = AllChem.GetRDKitFPGenerator()
fp = fpgen.GetFingerprint(mol)
# Atom pair, topological torsion, MACCS
ap = rdMolDescriptors.GetAtomPairFingerprint(mol)
tt = rdMolDescriptors.GetTopologicalTorsionFingerprint(mol)
maccs = MACCSkeys.GenMACCSKeys(mol)
# Similarity
sim = DataStructs.TanimotoSimilarity(fp1, fp2)
sims = DataStructs.BulkTanimotoSimilarity(fp1, [fp2, fp3])Substructure Searching
# SMARTS pattern matching
pattern = Chem.MolFromSmarts('c1ccccc1')
has_match = mol.HasSubstructMatch(pattern)
match = mol.GetSubstructMatch(pattern)
matches = mol.GetSubstructMatches(pattern)
# With chirality
matches = mol.GetSubstructMatches(pattern, useChirality=True)
# Functional groups
carboxylic_acid = Chem.MolFromSmarts('C(=O)[OH]')
has_acid = mol.HasSubstructMatch(carboxylic_acid)Chemical Reactions
from rdkit.Chem import AllChem
# Reaction SMARTS (amide bond formation)
rxn = AllChem.ReactionFromSmarts('[C:1](=[O:2])-[OD1].[N!H0:3]>>[C:1](=[O:2])[N:3]')
acid = Chem.MolFromSmiles('CC(=O)O')
amine = Chem.MolFromSmiles('CN')
products = rxn.RunReactants((acid, amine))
# From file
rxn = AllChem.ReactionFromRxnFile('reaction.rxn')
# Protect atoms
amide = Chem.MolFromSmarts('[N;$(NC=[O,S])]')
for m in mol.GetSubstructMatches(amide):
mol.GetAtomWithIdx(m[0]).SetProp('_protected', '1')2D and 3D Coordinates
from rdkit.Chem import AllChem
# 2D coordinates
AllChem.Compute2DCoords(mol)
# 3D conformers
mol = Chem.AddHs(mol)
AllChem.EmbedMolecule(mol) # Single conformer
conf_ids = AllChem.EmbedMultipleConfs(mol, numConfs=10) # Multiple
# Optimize
for conf_id in conf_ids:
AllChem.UFFOptimizeMolecule(mol, confId=conf_id)
# Align
rms_list = []
AllChem.AlignMolConformers(mol, RMSlist=rms_list)Drawing Molecules
from rdkit.Chem import Draw
from rdkit.Chem.Draw import rdMolDraw2D
# Basic drawing
img = Draw.MolToImage(mol, size=(300, 300))
Draw.MolToFile(mol, 'molecule.png')
img = Draw.MolsToGridImage(mols, molsPerRow=2, legends=['A', 'B'])
# Highlight substructures
match = mol.GetSubstructMatch(pattern)
d = rdMolDraw2D.MolDraw2DSVG(400, 400)
rdMolDraw2D.PrepareAndDrawMolecule(d, mol, highlightAtoms=list(match))Molecular Fragmentation
from rdkit.Chem import BRICS, Recap, rdFMCS
# BRICS
fragments = BRICS.BRICSDecompose(mol)
new_mols = BRICS.BRICSBuild(fragments)
# Recap
hierarch = Recap.RecapDecompose(mol)
leaves = hierarch.GetLeaves()
# Maximum common substructure
mcs = rdFMCS.FindMCS([mol1, mol2, mol3], ringMatchesRingOnly=True)
print(mcs.smartsString)Serialization
import pickle
# Pickle (fast)
pkl = pickle.dumps(mol)
mol2 = pickle.loads(pkl)
# Binary
bin_str = mol.ToBinary()
mol3 = Chem.Mol(bin_str)
# JSON
json_str = Chem.MolToJSON(mol)
mol = Chem.MolFromJSON(json_str)Performance Tips
- Use Suppliers for Large Files:
SDMolSupplierinstead of loading all molecules - Pickle Molecules: Much faster than reparsing SMILES/SDF
- Remove Hydrogens: Smaller molecules, faster operations
- Sanitize Once: Don't sanitize multiple times
- Reuse Fingerprint Generators: Create once, use many times
- Bulk Operations: Use
BulkTanimotoSimilarityfor batch calculations
Common Patterns
# Virtual screening
query_fp = AllChem.GetMorganFingerprintAsBitVect(query, 2, 2048)
hits = []
for mol in Chem.SDMolSupplier('library.sdf'):
if mol:
fp = AllChem.GetMorganFingerprintAsBitVect(mol, 2, 2048)
if DataStructs.TanimotoSimilarity(query_fp, fp) > 0.7:
hits.append(mol)
# Lipinski's Rule of Five
def passes_lipinski(mol):
return (Descriptors.MolWt(mol) <= 500 and Descriptors.MolLogP(mol) <= 5 and
Descriptors.NumHDonors(mol) <= 5 and Descriptors.NumHAcceptors(mol) <= 10)
# PAINS filtering
pains = [Chem.MolFromSmarts(s) for s in ['C1=CC=CC=C1N=NC1=CC=CC=C1']]
clean = [m for m in mols if not any(m.HasSubstructMatch(p) for p in pains)]References
- Molecular I/O - SMILES, SDF, Mol files, suppliers, writers
- Descriptors and Fingerprints - Molecular properties, fingerprints, similarity
- Substructure and Reactions - Pattern matching, SMARTS, chemical reactions
- 3D Conformers - Coordinate generation, conformer optimization, alignment
- Stereochemistry - Chirality, CIP rules, stereo groups, atropisomers, enumeration
- Sanitization and Aromaticity - Molecular sanitization, aromaticity models, kekulization
- Scaffold Analysis - Murcko scaffolds, generic scaffolds, scaffold-based splits
- Advanced Features - Drawing, fragmentation, serialization, MCS
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

