UC7_FTMS_issue

UC7 / Molecular-formula assignment & van Krevelen chemical-space (FT-MS) — interview input

Pulled-down GitHub issue used as the effective result of the INTERVIEW → GALAXY interview (the live interview mechanics are harness-owned and precede pipeline phase 1). Source: https://github.com/jmchilton/galaxy-brain/issues/30 Paired aspirational target: none yet — workflow not yet extracted from a Galaxy history.


Plain-language science (why this is interesting)

Ultrahigh-resolution mass spectrometry (FT-ICR or Orbitrap) measures the mass of each molecule so precisely that you can deduce its exact molecular formula — how many carbons, hydrogens, oxygens, nitrogens, sulfurs — from the mass alone. A single complex environmental sample (dissolved organic matter from water, soil, or sediment) can contain thousands of distinct formulas.

The signature way to look at that chemistry is the van Krevelen diagram: each assigned formula is a point plotted by its O/C ratio (x-axis) against its H/C ratio (y-axis). Where a point lands tells you its compound class — lipids (low O/C, high H/C), carbohydrates (high O/C, high H/C), lignins/aromatics and tannins (lower H/C, mid O/C), proteins, etc. So one plot is a fingerprint of the sample’s entire chemical space.

Before the formulas can be trusted, the mass axis must be recalibrated — tiny systematic mass errors are corrected against a series of confident reference peaks, which is what tightens part-per-million accuracy enough to make assignment unambiguous. The error-vs-m/z plot literally shows that ppm error shrinking after recalibration. The workflow’s job is exactly this sequence: estimate noise, separate isotope peaks, make a first formula pass, pick recalibrant series, recalibrate, re-assign with heteroatoms, and draw the diagnostic plots.

Purpose

Add a metabolomics / mass-spectrometry vignette to the Galaxy Notebooks paper that is novel on both axes the genomics-only corpus lacks: a new modality (FT-MS) and a new analytical shape (descriptive chemical-space characterization of a single sample, rather than a two-condition differential). Every displayed figure/table is a genuine on-graph Galaxy tool output, so the linear assignment+recalibration pipeline extracts to a reusable single-sample workflow via the history provenance graph. This belongs in galaxy-brain because the deliverable is a paper/demo notebook, not a change to an IWC workflow.

Objective (MVP + stretch)

MVP: Run the IWC mfassignr workflow on its shipped single high-resolution mass list to produce, all on-graph: noise estimate, isotope-filtered peaks, recalibrated mass series, final molecular-formula tables (Unambig / Ambig / None), and the diagnostic plot collection — then build a notebook whose money shot is the embedded van Krevelen diagram, narrated as “what chemical families make up this sample,” with the recalibration error-m/z plot as the QC story.

Stretch: A small on-graph chemical-class composition summary derived from the assigned formulas (e.g. counts/fractions of formulas falling in lipid / carbohydrate / lignin / aromatic regions of van Krevelen space, or by heteroatom class CHO vs CHON vs CHOS) as a ranked table or bar chart — turning the qualitative van Krevelen picture into a quantitative on-graph table. (Confirm an on-graph tool can compute the class binning, or it becomes a documented limitation.)

Why this is a useful demo deviation

Existing analysis anchors (real tool ids / paths)

Anchor workflow: iwc/workflows/metabolomics/mfassignr/mfassignr.ga (RECETOX/MUNI; MIT). Tools (all recetox/mfassignr_*, 1.1.2+galaxy*):

IWC repo: galaxyproject/iwc, workflows/metabolomics/mfassignr/.

Public data candidates (real shipped data)

From mfassignr-tests.yml:

Notebook workflow plan (numbered, on-graph)

  1. Upload the high-resolution mass list (mfassignr_input.txt, Zenodo 13768009); show a head of the input as an on-graph table.
  2. Noise estimation — mfassignr_kmdnoise (and/or mfassignr_histnoise) → noise threshold; embed the SN plot (mfassignr_snplot) as the first QC figure.
  3. Isotope filtering — mfassignr_isofiltr → monoisotopic peak list.
  4. First-pass assignment — mfassignr_mfassignCHO → CHO formulas used as recalibration anchors.
  5. Recalibrant selection — mfassignr_recallistmfassignr_findRecalSeries → chosen recalibrant series.
  6. Recalibration — mfassignr_recalrecal_series, final_series, and the error-m/z plot (MZplot); embed the error-m/z plot and narrate the ppm-accuracy improvement.
  7. Final assignment — mfassignr_mfassignUnambig / Ambig / None formula tables and the per-element plots collection (VK, MSgroups, errorMZ, msassign).
  8. Embed the van Krevelen diagram (the VK element) as the money shot, with the Unambig formula table beside it; narrate the chemical-family interpretation.
  9. (Stretch) Compute an on-graph chemical-class composition summary from the Unambig table (van-Krevelen-region or heteroatom-class binning) → ranked table / bar chart.
  10. Walk the provenance graph backward from the van Krevelen plot to extract the reusable assignment+recalibration workflow.

Expected paper/demo artifacts

Scope and risks

Tasks