- Jupyter Notebook 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| PH-LCMS | ||
| spectra-convert | ||
| LICENSE | ||
| README.md | ||
An example notebook for analysis of flux changes from raw LCMS data.
Convert spectra
Before running notebooks, spectra must be converted to mzML. Thermo RAW spectra can be converted using thermorawfileparser as shown in [spectra-convert/convert.sh].
PH-LCMS
Phenylhydrazine derivatives of ketoacids are analyzed on Thermo Exactive HF. LCMS settings are attached in TXT and instrument format.
flux-an-xcms-ms1.ipynb is an R-based Jupyter notebook for metabolic flux analysis using 13C-labeled
metabolomics data, specifically targeting pyruvate and alpha-ketoglutarate (α-KG) via MS1 mass
spectrometry with XCMS library. Here's how to use it:
Purpose
The notebook analyzes isotopomer distributions from 13C-labeled metabolites (pyruvate and α-KG)
in LC-MS/MS data, comparing experimental (D) versus control (m/M) conditions to study changes in metabolic
flux.
Requirements
R Libraries
You need the following R packages installed before running the notebook:
xcms— core MS data processingenviPat— theoretical isotope pattern generationggplot2,ggtext,ggRColorBrewer,gridExtra,pheatmap— visualizationdplyr,reshape2,magrittr,stringr— data manipulation
Input Data
The notebook expects .mzML files located at a path like data/com/con1/ketoacids/mzml/sc13*. Files are named according to the condition following a certain pattern.
Workflow Steps
- Load libraries — Run the first cell to import all required R packages.
- Define file sources — We use
Sys.glob()to locate and list all.mzMLfiles. Update the glob pattern to point to your own data directory. - Assign sample conditions — The
fileCondsvector maps each file to a condition label (d1–d4,D1–D6,m1–m6,M1–M6). Adjust these to match your experimental design. - Compute theoretical isotope patterns — The notebook uses
enviPat::isopattern()to calculate expected 13C isotopomer distributions for pyruvate (C9H9O2N2) and α-KG (C11H11O4N2). Note that we used phenylhydrazine derivatives. - Load and filter MS data —
readMSData()fromxcmsreads the.mzMLfiles inonDiskmode. Scans are then filtered by thescanWindowLowerLimit/scanWindowUpperLimitfor the relevant m/z windows (e.g., 176–180 for pyruvate, 234–238 for α-KG). - Extract chromatograms — The helper function
genChrom()converts XCMS chromatogram objects intoggplot2-compatible data frames for visualization. - Quantify isotopomer peaks —
genPData()extracts peak areas for each isotopomer (M+0, M+1, M+2, …) across all samples by matching m/z windows from the theoretical patterns. - Plot isotopomeric distributions —
preparePlotImer()normalizes the data relative to M+0 and formats it for bar or line plots comparing measured vs. theoretical distributions across conditions. - Pyruvate analysis — Repeat steps 5–8 for pyruvate specifically, using the left and right chromatographic peaks (it is known to come as two peaks due two unknown reasons) at its retention time.
- Alpha-KG analysis — Repeat the same pipeline for α-KG in the 234–238 m/z window.
Key Parameters to Customize
| Parameter | Description |
|---|---|
fileSrc glob pattern |
Path to your .mzML files |
fileConds |
Condition labels per file |
mzr (m/z range) |
Adjust per compound |
nMeres |
Number of isotopomers to analyze (e.g., 3 for M0–M2) |
threshold |
Mass tolerance in Da (default: 0.002) |
This work is licensed under a Creative Commons Attribution 4.0 International License.
