Jerem Flow

Connecting Agilent mass-spec data to an AI — a first mapping

· 8 mins read · #mass-spectrometry #metabolomics #lipidomics #ai #machine-learning #sirius #mcp #masshunter #lc-ms

Mass spectrometry produces thousands of features, and we annotate a handful. The question I keep coming back to: can an AI actually help us close that gap — and if so, how? 🤔

Why this reflection

In my day-to-day work as a product specialist for Agilent LC-MS, a recurring theme is the annotation bottleneck in untargeted workflows. A metabolomics or lipidomics run can easily surface several thousand features. Of those, only a small fraction gets confidently annotated: recent estimates put it around 2 % of MS/MS spectra identified against reference libraries, and under 10 % with the best machine-learning tools. Most of what we measure stays a mystery.

So I started a deliberate exploration: what does "connecting mass-spec data to an AI" actually mean today, what's already available, and what could I realistically stand up on my own equipment? This article is a record of that reasoning — the state of play, the role of MassHunter Explorer 2.0, the engines available, and the next steps I plan to work on.


Step 1 — Separating two problems that get conflated

The first useful thing I did was split "AI for metabolomics" into two genuinely different tasks:

  1. Annotation of spectra — identify the chemical structure behind a given MS/MS spectrum (exact mass, fragmentation). This is what interests me most.
  2. Biological interpretation — understand what those compounds mean in context (metabolic pathways, biomarkers). This is a separate, later stage.

A lot of the recent literature I read is about interpretation. That's not the hard part I want to solve first. The annotation of spectra is.

Keeping these two apart changed how I read the tools. Some model families are good at interpretation, others at annotation — and they don't overlap much.


Step 2 — The landscape of annotation engines

Let me sketch what exists today for structural annotation from MS/MS, from the most integrated to the most experimental.

The pragmatic baseline: SIRIUS

SIRIUS is the reference for small-molecule annotation from high-resolution MS/MS. It's a Java framework that combines several engines:

  • ZODIAC — molecular formula ranking from shared fragments and losses across a dataset.
  • CSI:FingerID — machine-learning fingerprint prediction, searched against molecular structure databases.
  • CANOPUS — automatic compound-class prediction.
  • MSNovelistde novo structure generation.

Crucially, SIRIUS is open source (AGPL). What's not free is the web-service tier: CSI:FingerID, CANOPUS and MSNovelist run through hosted services that are free for academic use but paid for commercial use (Bright Giant). The local, no-web-service features — molecular formula annotation via fragmentation trees and isotope-pattern analysis — run on your own machine, no license required.

The honest framing: SIRIUS is not "AI" as a whole. Half of it is genuinely machine learning (CSI:FingerID, CANOPUS, MSNovelist), the other half is classical algorithmic optimization (ZODIAC). It's a computational annotation suite with strong ML components — not a chat-based generative model.

The open-source models that actually run locally

Beyond SIRIUS, several fully open-source structure generators now exist with public repos and permissive licenses — interesting for a self-hosted pipeline:

Model What it does License Notes
DiffMS Diffusion-based de novo molecular generation from MS/MS MIT repo, pretrained checkpoints on Zenodo
Spec2Mol Encoder–decoder translating MS/MS → SMILES MIT repo; note: trained on a commercial NIST library
Spec2Vec Word2Vec-style spectral similarity (matching) Apache 2.0 repo
MS2DeepScore Deep-learning structural similarity Apache 2.0 repo

There are also newer foundation models (DreaMS, LSM-MS2) and LLM-derived embeddings (LLM4MS), but several are either patented, tied to specific base models with restricted commercial terms, or not yet packaged for easy local use. For a first pilot, DiffMS and Spec2Mol are the most usable on commodity hardware.


Step 3 — Where MassHunter Explorer 2.0 fits

MassHunter Explorer 2.0 is Agilent's non-targeted data-analysis application, introduced with the Revident Q-TOF. It does the pre-processing and statistics that the annotation engines don't:

  • Find & Align — feature extraction, retention-time alignment, gap filling.
  • Normalization / filtering — abundance, CV, frequency.
  • Statistics — PCA, volcano plots, ANOVA, clustering.
  • First-pass identification — against Agilent PCDL libraries and ChemVista.

What Explorer does not do is deep structural annotation of unknowns. That's the gap I'm exploring.

The native bridge: Explorer ↔ SIRIUS

MassHunter Explorer 2.0 has a built-in "Send to SIRIUS" integration — a commercial-technical bridge between Agilent and Bright Giant. One click sends unknown features to SIRIUS, and the results come back into Explorer. Agilent users get a substantial quota of free queries.

But that bundled license has a hard limit:

The MH Explorer SIRIUS license works through the GUI only. It does not include the CLI/API, and it does not include de novo structure generation (MSNovelist). That means it can't drive an automated pipeline — it's a manual, interactive bridge.

That constraint shaped everything that follows: if I want automation, I can't rely on the bundled Explorer↔SIRIUS license alone.


Step 4 — The orchestration I'm sketching

The mental model I've converged on is a small pipeline in four stages. Each element has one job, and the interfaces between them are deliberately simple (files and JSON).

┌─ Phase 1 · PRODUCE (MassHunter Explorer 2.0) ─────────────────────┐
│  .d files → Find & Align → stats → identification (PCDL)          │
│  OUTPUT: features CSV  +  MS/MS spectra (MGF)                     │
└───────────────────────────────────────────────────────────────────┘
        │  (files)
        ▼
┌─ Phase 2 · ORCHESTRATE (Hermes + an MCP server) ─────────────────┐
│  an agent reads the CSV/MGF, decides what to annotate,            │
│  calls the annotation engines, interprets the results             │
└───────────────────────────────────────────────────────────────────┘
        │
        ▼
┌─ Phase 3 · ANNOTATE (local engines) ─────────────────────────────┐
│  SIRIUS CLI (formulas)  +  DiffMS (de novo structures)           │
│  + Spec2Vec / MS2DeepScore (matching)                            │
└───────────────────────────────────────────────────────────────────┘
        │
        ▼
┌─ Phase 4 · RESTITUTION (Hermes → you) ───────────────────────────┐
│  summary in plain language, cross-reference, a report            │
└───────────────────────────────────────────────────────────────────┘

The role of each piece:

  • MassHunter Explorer is the upstream producer. It's a GUI tool — I don't orchestrate it. It prepares the features and does a first library identification. What leaves it is a CSV of features and the MS/MS spectra in an open format. That's the material the rest works on.
  • Hermes is the orchestrator. It reads the request, calls the annotation engines, and turns raw results into something useful.
  • An MCP server is the standardised bridge. Model Context Protocol lets an agent call external tools in a defined way — so an MCP server can expose annotate_features, search_structure, compare_spectra, and Hermes can just call them.
  • The local engines (SIRIUS CLI for formulas, DiffMS for structures, Spec2Vec for matching) do the actual computation.

The clean separation is what I like: the GUI (Explorer) produces the material, the agent (Hermes) reasons about it, the bridge (MCP) standardises the calls, and the engines do the heavy lifting. Nothing here depends on the commercial GUI license to automate.


Step 5 — What's realistic vs. what's a stretch

Goal Today's reality Open-source route (self-hosted)
Molecular formulas from MS/MS SIRIUS local, no license SIRIUS CLI formula — works
Structural identification (CSI:FingerID, CANOPUS) Commercial license needed Harder — services are paid; open-source structure models are younger
De novo structures MSNovelist (in SIRIUS, paid) DiffMS / Spec2Mol (MIT)
Spectral matching Libraries Spec2Vec / MS2DeepScore (Apache 2.0)
Automated orchestration Manual (GUI) Hermes + MCP server

The biggest realistic win for a self-hosted pilot, without spending on a full SIRIUS license: formulas via SIRIUS CLI (free) + de novo structures via DiffMS (MIT) + matching via Spec2Vec, all orchestrated through an MCP server. That's a concrete, legitimate pipeline.

The honest limitation: deep structural annotation with database search (CSI:FingerID) and compound-class prediction (CANOPUS) are the strongest, most mature pieces of SIRIUS — and they are the paid tier. The open-source de novo models are promising but not yet at the same confidence level.


Next steps I want to work on

  1. Validate the local engines end-to-end. Confirm SIRIUS CLI formula runs fully offline, and stand up DiffMS on a small machine. This is the foundation — no orchestration before the engines work alone.
  2. Build a minimal MCP server that exposes annotate_features, search_structure, compare_spectra — pointing at the local engines, not the paid web services.
  3. Check the data path from MassHunter Explorer. Confirm the exact CSV/MGF export shape so the MCP server can consume it without manual reshuffling.
  4. Scope a first real use case. Take a small lipidomics or metabolomics dataset, export features, run the pipeline, and compare the output to a known set — to measure how much annotation we actually recover.
  5. Write up the honest comparison of what the self-hosted stack recovers vs the paid SIRIUS tier, so the "when to buy" decision is evidence-based rather than assumed.

Sources

The annotation bottleneck is real, and the answer isn't a single magic model. It's a deliberate pipeline: Explorer prepares the analysis, local engines do the heavy lifting, and an agent makes it usable. That's the path I'll keep exploring.

← Back