leonardodalinky/scider/chemistry-analysis

Claude Code and agent skill by leonardodalinky/scider

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Cheminformatics and computational chemistry — SMILES/InChI parsing, molecular property prediction, spectroscopy interpretation, DFT workflow, materials characterization (XRD, SAXS), and key chemistry databases. Use when analyzing chemical or materials data.

Install

npx vskill@latest install leonardodalinky/scider/chemistry-analysis

SKILL.md

Chemistry Analysis

Overview

Cheminformatics and computational chemistry span molecular representation, property prediction, spectroscopy interpretation, quantum chemical calculations, and materials characterization. This skill covers the full workflow from parsing SMILES strings through DFT calculations and database queries.

When to Use This Skill

Use this skill when:

  • Parsing, validating, or canonicalizing molecular structures (SMILES, InChI, SDF)
  • Computing molecular descriptors (MW, logP, TPSA, fingerprints) for a set of compounds
  • Filtering compounds by drug-likeness, ADMET, or structural criteria
  • Interpreting spectroscopy data (IR, NMR, MS, UV-Vis)
  • Setting up or analyzing DFT/computational chemistry workflows
  • Characterizing materials with XRD, SAXS, or BET surface area
  • Querying chemistry databases (PubChem, Materials Project, CSD)

For genomics or protein sequence analysis, see the bioinformatics-analysis skill instead.


Cheminformatics with RDKit

Installation
bash
conda install -c conda-forge rdkit
# or
pip install rdkit
SMILES/InChI Parsing and Validation
python
from rdkit import Chem
from rdkit.Chem.inchi import MolToInchi, InchiToInchiKey
# Parse SMILES — returns None if invalid
mol = Chem.MolFromSmiles('CC(=O)Oc1ccccc1C(=O)O') # aspirin
if mol is None:
raise ValueError("Invalid SMILES")
# Canonicalize SMILES (normalize representation)
canonical_smi = Chem.MolToSmiles(mol)
# Convert to InChI and InChIKey
inchi = MolToInchi(mol)
inchikey = Chem.inchi.InchiToInchiKey(inchi)
# Validate a list of SMILES
def validate_smiles(smi_list):
valid, invalid = [], []
for smi in smi_list:
mol = Chem.MolFromSmiles(smi)
if mol is not None:
valid.append(Chem.MolToSmiles(mol)) # canonical form
else:
invalid.append(smi)
return valid, invalid
Morgan Fingerprints

Morgan fingerprints (circular fingerprints) are the standard for similarity-based tasks.

python
from rdkit.Chem import AllChem
from rdkit import DataStructs
mol = Chem.MolFromSmiles('CC(=O)Oc1ccccc1C(=O)O')
# radius=2 ≈ ECFP4, radius=3 ≈ ECFP6; nBits=2048 standard
fp = AllChem.GetMorganFingerprintAsBitVect(mol, radius=2, nBits=2048)
# Use cases:
# - radius=2 (ECFP4): general similarity, virtual screening
# - radius=3 (ECFP6): more sensitive to local environment differences
# - nBits=1024: faster computation; 2048: fewer bit collisions
# Convert to numpy for ML
import numpy as np
fp_array = np.array(fp)
Molecular Descriptors
python
from rdkit.Chem import Descriptors, rdMolDescriptors
def compute_descriptors(mol):
return {
'MW': Descriptors.MolWt(mol),
'ExactMW': Descriptors.ExactMolWt(mol),
'logP': Descriptors.MolLogP(mol), # Wildman-Crippen
'TPSA': Descriptors.TPSA(mol), # topological polar surface area
'HBD': rdMolDescriptors.CalcNumHBD(mol), # H-bond donors
'HBA': rdMolDescriptors.CalcNumHBA(mol), # H-bond acceptors
'RotBonds': rdMolDescriptors.CalcNumRotatableBonds(mol),
'AromaticRings': rdMolDescriptors.CalcNumAromaticRings(mol),
'HeavyAtoms': mol.GetNumHeavyAtoms(),
'Rings': rdMolDescriptors.CalcNumRings(mol),
}
mol = Chem.MolFromSmiles('CC(=O)Oc1ccccc1C(=O)O')
props = compute_descriptors(mol)
Tanimoto Similarity
python
from rdkit import DataStructs
from rdkit.Chem import AllChem
def tanimoto(smi1, smi2, radius=2, n_bits=2048):
m1 = Chem.MolFromSmiles(smi1)
m2 = Chem.MolFromSmiles(smi2)
fp1 = AllChem.GetMorganFingerprintAsBitVect(m1, radius, n_bits)
fp2 = AllChem.GetMorganFingerprintAsBitVect(m2, radius, n_bits)
return DataStructs.TanimotoSimilarity(fp1, fp2)
# Bulk similarity against a reference
ref_fp = AllChem.GetMorganFingerprintAsBitVect(ref_mol, 2, 2048)
fps = [AllChem.GetMorganFingerprintAsBitVect(m, 2, 2048) for m in mols]
sims = DataStructs.BulkTanimotoSimilarity(ref_fp, fps)

Rule of thumb: Tanimoto > 0.85 = very similar (often same scaffold); 0.4–0.85 = related; < 0.4 = likely dissimilar.

Substructure Search
python
# Search for a functional group using SMARTS
nitro_pattern = Chem.MolFromSmarts('[N+](=O)[O-]')
amide_pattern = Chem.MolFromSmarts('C(=O)N')
mol = Chem.MolFromSmiles('CC(=O)Nc1ccc(O)cc1') # paracetamol
has_amide = mol.HasSubstructMatch(amide_pattern)
matches = mol.GetSubstructMatches(amide_pattern) # atom index tuples
Full Dataset Workflow: Load CSV, Compute Properties, Cluster
python
import pandas as pd
import numpy as np
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem, Descriptors, rdMolDescriptors
from rdkit.ML.Cluster import Butina
# 1. Load and validate
df = pd.read_csv('compounds.csv')
df['mol'] = df['smiles'].apply(Chem.MolFromSmiles)
df = df[df['mol'].notna()].copy()
print(f"Valid: {len(df)}/{len(df)} molecules")
# 2. Compute properties
desc_df = df['mol'].apply(lambda m: pd.Series({
'MW': Descriptors.MolWt(m),
'logP': Descriptors.MolLogP(m),
'HBD': rdMolDescriptors.CalcNumHBD(m),
'HBA': rdMolDescriptors.CalcNumHBA(m),
'TPSA': Descriptors.TPSA(m),
}))
df = pd.concat([df, desc_df], axis=1)
# 3. Compute fingerprints
fps = [AllChem.GetMorganFingerprintAsBitVect(m, 2, 1024) for m in df['mol']]
# 4. Butina clustering (Taylor-Butina, distance-based)
dists = []
for i in range(1, len(fps)):
sims = DataStructs.BulkTanimotoSimilarity(fps[i], fps[:i])
dists.extend([1 - s for s in sims])
clusters = Butina.ClusterData(dists, len(fps), distThresh=0.35, isDistData=True)
df['cluster'] = -1
for cluster_id, indices in enumerate(clusters):
for idx in indices:
df.loc[df.index[idx], 'cluster'] = cluster_id
print(f"Clusters (cutoff=0.35): {len(clusters)}")

Molecular Property Prediction

Lipinski's Rule of Five (Drug-Likeness)

Oral bioavailability filter for small-molecule drugs:

PropertyThreshold
MW≤ 500 Da
logP (Wildman-Crippen)≤ 5
H-bond donors (NH + OH)≤ 5
H-bond acceptors (N + O)≤ 10

Compounds violating ≥ 2 rules are unlikely to be orally bioavailable.

python
def lipinski_ro5(mol):
mw = Descriptors.MolWt(mol)
logp = Descriptors.MolLogP(mol)
hbd = rdMolDescriptors.CalcNumHBD(mol)
hba = rdMolDescriptors.CalcNumHBA(mol)
violations = sum([mw > 500, logp > 5, hbd > 5, hba > 10])
return {
'MW': mw, 'logP': logp, 'HBD': hbd, 'HBA': hba,
'violations': violations,
'drug_like': violations <= 1
}
Delaney ESOL Solubility Estimate

The Delaney ESOL model predicts aqueous solubility (log S) from simple descriptors:

log S = 0.16 - 0.63·clogP - 0.0062·MW + 0.066·RB - 0.74·AP

where RB = rotatable bonds, AP = aromatic proportion.

python
def esol_solubility(mol):
mw = Descriptors.MolWt(mol)
logp = Descriptors.MolLogP(mol)
rb = rdMolDescriptors.CalcNumRotatableBonds(mol)
# aromatic proportion: aromatic atoms / heavy atoms
n_ar = sum(a.GetIsAromatic() for a in mol.GetAtoms())
ap = n_ar / mol.GetNumHeavyAtoms()
log_s = 0.16 - 0.63*logp - 0.0062*mw + 0.066*rb - 0.74*ap
return log_s # log10(mol/L)
ADMET Properties Overview
PropertyKey DescriptorsCommon Models
Absorption (oral)MW, TPSA, HBD, logPLipinski Ro5, Veber rules (TPSA < 140, RB < 10)
Distribution (BBB)MW < 400, logP 1–3, TPSA < 90B3DB dataset, DeepSMILES models
Metabolism (CYP)Structural alerts, reactive groupsSMARTS rules, ML classifiers
Excretion (t½)logP, protein bindingQSAR models
ToxicityAMES test, hERG, hepatotoxpkCSM, ADMETlab 2.0

For rapid ADMET screening, use pkCSM (web API) or the admet-ai Python package.


Reaction Informatics

SMARTS Patterns for Functional Group Detection
python
# Common SMARTS patterns
patterns = {
'carboxylic_acid': '[CX3](=O)[OX2H1]',
'ester': '[CX3](=O)[OX2][#6]',
'primary_amine': '[NX3;H2;!$(NC=O)]',
'alcohol': '[OX2H][#6;!$(C=O)]',
'aldehyde': '[CX3H1](=O)',
'ketone': '[CX3](=O)([#6])[#6]',
'amide': '[CX3](=O)[NX3]',
'alkene': '[CX3]=[CX3]',
}
def detect_functional_groups(smi, patterns):
mol = Chem.MolFromSmiles(smi)
found = {}
for name, smarts in patterns.items():
patt = Chem.MolFromSmarts(smarts)
found[name] = mol.HasSubstructMatch(patt)
return found
Retrosynthesis Concepts

Retrosynthetic analysis disconnects a target molecule into simpler precursors:

  • Disconnection strategy: break at C-C or C-heteroatom bonds formed in known reactions
  • Synthons: imaginary fragments that map to real reagents (e.g., carbanion → organolithium)
  • FGI (functional group interconversion): transform one FG into another to reveal a simpler precursor
  • Template-based: match known reaction SMARTS templates (e.g., ASKCOS, RDKit's ChemicalReaction)
python
from rdkit.Chem import AllChem
# Define a reaction SMARTS (esterification: acid + alcohol → ester)
rxn_smarts = '[CX3:1](=O)[OX2H:2].[OX2H:3][#6:4]>>[CX3:1](=O)[OX2:3][#6:4]'
rxn = AllChem.ReactionFromSmarts(rxn_smarts)
reactants = (Chem.MolFromSmiles('CC(=O)O'), Chem.MolFromSmiles('CCO'))
products = rxn.RunReactants(reactants)
if products:
print(Chem.MolToSmiles(products[0][0]))

Spectroscopy Data Interpretation

IR Spectroscopy

Key absorption bands (wavenumbers in cm⁻¹):

RegionAssignment
3200–3600 (broad)O-H stretch (alcohol, carboxylic acid)
3300–3500N-H stretch (amine, amide)
2850–3000C-H stretch (alkyl)
2100–2260C≡C or C≡N stretch
1700–1750C=O stretch (ester ~1735, ketone ~1715, acid ~1710, amide ~1680)
1600–1680C=C stretch (alkene, aromatic)
1000–1300C-O stretch (fingerprint region)
400–1000Fingerprint region — unique to each molecule

Diagnostic workflow: (1) check 1700-1750 for carbonyl; (2) check 3200-3600 for O-H/N-H; (3) use fingerprint region to confirm identity against library spectra.

¹H NMR Chemical Shift Ranges
δ (ppm)Proton Type
0.0–1.0TMS, cyclopropyl
0.8–1.5Alkyl (CH₃, CH₂)
1.5–2.5α to carbonyl, allylic
2.5–3.5α to aromatic, O-CH₃
3.5–5.0O-CH, N-CH, vinyl
5.0–6.5Alkene =CH
6.5–8.5Aromatic, heteroaromatic
9.0–10.5Aldehyde CHO
10–13Carboxylic acid, chelated OH

Multiplicity (n+1 rule): signal splits into n+1 lines where n = number of equivalent neighboring H. Integration: area proportional to number of protons — use to confirm molecular formula.

Mass Spectrometry
  • M⁺ (molecular ion): gives exact molecular weight; may be absent in EI for labile molecules
  • M+1, M+2 peaks: isotope patterns — 37Cl (M+2 ≈ 1/3 of M⁺), 79Br/81Br (M+2 ≈ M⁺)
  • Base peak: most abundant fragment; highest m/z considered first
  • Common losses: 15 (CH₃), 17 (OH), 18 (H₂O), 28 (CO), 29 (CHO), 31 (OCH₃), 35/37 (Cl)
  • High-resolution MS (HRMS): gives exact mass to 4+ decimal places → determine molecular formula
python
# Parse mzML files with pyteomics
from pyteomics import mzml
with mzml.MzML('spectrum.mzML') as reader:
for spectrum in reader:
mz = spectrum['m/z array']
intensity = spectrum['intensity array']
UV-Vis Spectroscopy

Beer-Lambert law: A = ε·c·l

  • A = absorbance (dimensionless)
  • ε = molar extinction coefficient (L·mol⁻¹·cm⁻¹)
  • c = concentration (mol/L)
  • l = path length (cm, typically 1 cm)

Common chromophores:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
88
Repository forks
7
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/leonardodalinky/scider/chemistry-analysis/badge)](https://verified-skill.com/skills/leonardodalinky/scider/chemistry-analysis)

Something wrong with this skill or its page? Tell us.