agentsclimarketplace

Mzml file import xcms

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/mzml-file-import-xcms

Use when you have raw mzML files from a mass spectrometry instrument and need to begin a preprocessing workflow in xcms. This is the essential first step before any peak detection (centWave, MSWParam) or feature grouping can occur.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill mzml-file-import-xcms

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.7 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

mzml-file-import-xcms

Summary

Load raw mass spectrometry data in mzML format into xcms as an XCMSnExp object with on-disk mode to enable downstream peak detection and feature grouping workflows. This is the foundational step that prepares LC-MS, GC-MS, or LC-MS/MS data for chromatographic peak detection and feature extraction.

When to use

You have raw mzML files from a mass spectrometry instrument and need to begin a preprocessing workflow in xcms. This is the essential first step before any peak detection (centWave, MSWParam) or feature grouping can occur. Use this skill when starting fresh with instrument output files, not when data is already loaded or peak-detected.

When NOT to use

  • Data is already in NetCDF format — use xcms's NetCDF import functions instead.
  • Spectra have already been peak-detected and you have a feature table — skip to feature grouping.
  • You are working with already-preprocessed data from another tool (e.g., vendor software); import the results directly if they are in a supported format.

Inputs

  • vector of mzML file paths
  • AnnotatedDataFrame with sample metadata (phenotype information)
  • mzML files from LC-MS, GC-MS, or LC-MS/MS instrument

Outputs

  • XCMSnExp object (on-disk mode)
  • spectral data index with m/z and retention time ranges
  • linked sample metadata and file references

How to apply

Call readMSData() with the vector of mzML file paths, pass an AnnotatedDataFrame containing sample metadata (phenotype information), and set mode='onDisk' to avoid loading all spectra into memory at once. The on-disk mode defers spectrum loading until needed, enabling efficient processing of large experiments. The function returns an XCMSnExp object that retains file paths and metadata while providing access to raw spectra data on demand. Validate that the resulting object contains the expected number of samples and that mz/retention time ranges are present in the spectra index.

Related tools

  • xcms (Primary tool providing readMSData() function and XCMSnExp object class for on-disk mzML import and spectrum indexing) — https://github.com/sneumann/xcms
  • MSnbase (Provides AnnotatedDataFrame class for sample metadata and underlying spectrum data structures used by xcms)
  • MsDataHub (Optional data source for retrieving example mzML files used in workflows)
  • Spectra (Alternative modern backend for spectrum representation in xcms version 4+)

Examples

library(xcms); pd <- data.frame(sample_name=c('HAM004','HAM005'), file=c('HAM004.mzML','HAM005.mzML')); xmse <- readMSData(files=pd$file, pdata=AnnotatedDataFrame(pd), mode='onDisk')

Evaluation signals

  • Resulting XCMSnExp object has length equal to the number of input mzML files and contains sample names from metadata
  • Object is in on-disk mode (no full spectra loaded into memory) — verify via object class and memory footprint
  • Spectrum index contains valid m/z ranges and retention time ranges for each sample
  • Calling spectra() or mz() on the object successfully retrieves data without error
  • Sample metadata from AnnotatedDataFrame is accessible via phenoData() with no missing values for key experimental descriptors

Limitations

  • On-disk mode requires mzML files to remain at their original file paths; moving files after import breaks spectrum access.
  • mzML import assumes well-formed XML structure; corrupted or non-compliant mzML files will fail parsing.
  • Very large mzML files (>10 GB) may experience slow index creation; consider splitting by sample or time range.
  • Metadata in the input AnnotatedDataFrame must match the number and order of mzML files; mismatches will cause incorrect sample assignment.

Evidence

  • [intro] readMSData() function with on-disk mode documentation: "readMSData(files = mzML_files, pdata = AnnotatedDataFrame(pd), mode = "onDisk")"
  • [readme] xcms package purpose statement: "The xcms R package provides functionality to efficiently preprocess LC-MS (as well as GC-MS and LC-MS/MS) data."
  • [other] Task-level workflow confirming XCMSnExp creation from mzML: "Load the HAM004 and HAM005 mzML files from MsDataHub using readMSData() in xcms with on-disk mode to create an XCMSnExp object."
  • [readme] Version 4 support for modern data containers: "Version 4 adds native support for the Spectra package to xcms and allows to perform the pre-processing on MsExperiment objects"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.