chem-msms-predict
Skill174 starsChanged 6 months agoMITView on GitHub
Predict LC-MS/MS (MS2, tandem mass spectra) from SMILES via ICEBERG, a two-stage deep neural network. Outputs predicted m/z vs intensity spectrum, fragment ion SMILES, and a spectrum plot.
In this repository133 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/atomisticskills.mdcCursor rule
- .cursor/rules/use-agent-skills.mdcCursor rule
- chem-bond-dissociationSkill
- chem-conformer-searchSkill
- chem-db-mofSkill
- chem-db-qmofSkill
- chem-db-spectraSkill
- chem-dft-orca-advanced-calculationSkill
- chem-dft-orca-optimizationSkill
- chem-dft-orca-singlepointSkill
- chem-docking-voidSkill
- chem-hazard-toxicitySkill
- chem-irc-verificationSkill
- chem-neb-barrierSkill
- chem-nmr-analysisSkill
- chem-nmr-predictSkill
- chem-react-otSkill
- chem-similarity-searchSkill
- chem-solution-mdSkill
- chem-sorption-gcmcSkill
- chem-sorption-relaxSkill
- chem-sorption-widomSkill
- chem-spectrum-matcherSkill
- chem-thermochemistrySkill
- chem-ts-optimizationSkill
- chem-vibrationSkill
- drug-admet-predictionSkill
- drug-binding-site-definitionSkill
- drug-bioactivity-assaySkill
- drug-complex-system-builderSkill
- drug-db-chemblSkill
- drug-db-pdbSkill
- drug-db-pubchemSkill
- drug-docking-analysisSkill
- drug-docking-vinaSkill
- drug-ligand-prepSkill
- drug-mmpbsa-gbsaSkill
- drug-molecular-fingerprintsSkill
- drug-pocket-detectionSkill
- drug-pose-validationSkill
- drug-protein-ligand-mdSkill
- drug-protein-prepSkill
- drug-redocking-rmsdSkill
- drug-retrosynthesisSkill
- drug-trajectory-analysisSkill
- general-arxiv-searchSkill
- general-biorxiv-searchSkill
- general-chemical-literatureSkill
- general-chemical-pricingSkill
- general-deep-researchSkill
- general-fair-data-reviewSkill
- general-patent-searchSkill
- general-peer-reviewSkill
- general-plot-digitizerSkill
- general-presentationSkill
- general-property-unitsSkill
- general-publisher-access-guardSkill
- general-query-literature-databaseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
No reference spectrum exists, or comparison to a predicted spectrum is desired.
- Distinctive: line 39
Flag error and stop: if either checkpoint is missing.
- Distinctive: line 95
Use this to rationalize which bonds fragment at which energy.
- Distinctive: line 99
If an experimental spectrum is available, use the companion skill:
- Very specific: line 122
Environment: All scripts require the ms-gen conda environment.
- Very specific: line 124
Collision energy units: Use absolute eV values. To convert NCE → eV, set nce=True in iceberg_prediction() directly.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LC-MS/MS Spectrum Prediction
Goal
Predict the LC-MS/MS (tandem mass) spectrum of a molecule given its SMILES string using ICEBERG — a two-stage GNN that first generates a fragmentation DAG (fragment ions) and then predicts their intensities. Output is a predicted spectrum (m/z, intensity) with optional fragment SMILES assignments per peak.
When to Use This Skill
- A SMILES string is known and a predicted LC-MS/MS spectrum (m/z vs intensity) is needed.
- Fragment ion assignments (SMILES per peak) are required.
- No reference spectrum exists, or comparison to a predicted spectrum is desired.
- Companion skill
chem-spectrum-matchercan compare predicted vs experimental spectra.
When NOT to Use This Skill
- Experimental spectrum already available — use it directly; no prediction needed.
- Only compound name known — first resolve to SMILES via
drug-db-pubchem, then call this skill. - GC-MS or other MS types — ICEBERG is trained on LC-MS/MS only; flag a warning before proceeding.
- Organometallics or MW > 1000 — predictions may be unreliable or fail due to unsupported element types.
Prerequisites
1. Download ICEBERG checkpoints
Download from coleygroup/ms-pred releases and place in downloads/:
downloads/
├── iceberg_dag_gen_msg_best.ckpt # generator (stage 1)
└── iceberg_dag_inten_msg_best.ckpt # intensity predictor (stage 2)Flag error and stop if either checkpoint is missing.
2. Set up the conda environment
bash conda-envs/msms-agent/install.shThe ms_pred Python package is installed from GitHub automatically by the install script.
Instructions
Step 1 — Run inference and generate spectrum
# Env: ms-gen
python .agents/skills/chem-msms-predict/scripts/predict_msms.py \
--smiles "c1ccccc1C(=O)OCCN" \
--gen_ckpt downloads/iceberg_dag_gen_msg_best.ckpt \
--inten_ckpt downloads/iceberg_dag_inten_msg_best.ckpt \
--collision_energies 20 40 \
--adduct "[M+H]+" \
--instrument "Orbitrap" \
--output_dir results/msms_predictionKey parameters:
--smiles— input molecule as SMILES string--gen_ckpt/--inten_ckpt— paths to ICEBERG checkpoints--collision_energies— one or more collision energies in eV (e.g.20 40 60); model was trained on absolute eV values--adduct— supported adducts:[M+H]+,[M-H]-,[M+Na]+,[M+NH4]+, and others fromms_pred.common.ion2mass--instrument— instrument type for intensity prediction (e.g."Orbitrap","QTOF")--threshold— confidence cutoff for DAG fragment generator (default0.1; lower = more fragments)--sparse_k— maximum number of peaks returned (default100)--cuda_devices— GPU device IDs (e.g."0"or"0,1"); omit or set toNonefor CPU
Outputs written to --output_dir:
| File | Description |
spectrum.png | Stem plot of predicted spectrum, one panel per collision energy |
fragments.json | JSON list per CE: {mz, intensity, fragment_smiles} sorted by intensity |
input_configs.yaml | All run parameters for reproducibility |
Step 2 — Inspect fragment assignments (optional)
fragments.json maps each predicted peak to the fragment ion SMILES responsible for it:
{
"20": [
{"mz": 122.0600, "intensity": 1.0, "fragment_smiles": "c1ccccc1C=O"},
...
]
}Use this to rationalize which bonds fragment at which energy.
Step 3 — Compare with experimental spectrum (optional)
If an experimental spectrum is available, use the companion skill:
→ chem-spectrum-matcher
Examples
2-Aminoethyl benzoate (c1ccccc1C(=O)OCCN)
# Env: ms-gen
python .agents/skills/chem-msms-predict/examples/predict_smiles.py \
--gen_ckpt downloads/iceberg_dag_gen_msg_best.ckpt \
--inten_ckpt downloads/iceberg_dag_inten_msg_best.ckpt \
--output_dir .agents/test/msms_exampleExpected output:
spectrum.png— two-panel spectrum (20 eV + 40 eV)fragments.json— fragment assignments for both energies- Precursor
[M+H]+≈ 166.087 Da
Constraints
- Environment: All scripts require the
ms-genconda environment.ms_predis installed automatically from GitHub byconda-envs/msms-agent/install.sh. - Checkpoints required: Script raises
FileNotFoundErrorif--gen_ckptor--inten_ckptare missing. - Collision energy units: Use absolute eV values. To convert NCE → eV, set
nce=Trueiniceberg_prediction()directly. - Non-binned output only: This skill uses
binned_out=False(high-precision m/z). Binned output disables fragment assignment. - Single-compound inference: Provide one SMILES per call. For batch prediction, loop over SMILES and use separate output dirs.
- Unsupported elements: Molecules containing metals, lanthanides, or rare main-group elements may fail or produce low-quality predictions.
- MW limit: ICEBERG is unreliable for MW > 1000 Da.
References
- Alberts, M. et al., "Artificial intelligence for context-aware mass spectrometry", Nature Methods, 2025. DOI:10.1038/s41592-025-02658-z
- ICEBERG source code: github.com/coleygroup/ms-pred
Author: Magdalena Lederbauer Contact: GitHub @mlederbauer
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.

