agentsclimarketplace

Mean intensity aggregation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/mean-intensity-aggregation

Use when after importing imzML or vendor-specific MSI data into napari and visualizing the raw spectral dataset.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill mean-intensity-aggregation

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

6.7 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

mean-intensity-aggregation

Summary

Compute mean intensity values across all pixels in a mass spectrometry imaging (MSI) dataset by aggregating intensity arrays at each unique m/z value. This workflow step produces a representative mean spectrum and optionally exports it for downstream ROI analysis and metabolite annotation.

When to use

Apply this skill after importing imzML or vendor-specific MSI data into napari and visualizing the raw spectral dataset. Use it when you need a global intensity profile across the entire MSI experiment to identify dominant m/z peaks, normalize intensity ranges, or generate a reference spectrum for region-of-interest (ROI) comparisons.

When NOT to use

  • Input MSI data has not been imported and loaded into the napari environment—perform data import first.
  • You require intensity values for a single pixel or localized region only—use ROI selection instead.
  • The dataset is already pre-aggregated into a mean spectrum; recalculating would be redundant.

Inputs

  • Imported MSI spectral dataset in imzML or vendor-specific format
  • m/z values and intensity arrays from all pixels/samples
  • Optional pre-processing parameters (noise reduction %, normalization method, hotspot removal quantile)

Outputs

  • Mean spectrum: m/z vs. mean intensity table
  • CSV or HDF5 export file of aggregated mean intensities
  • Mean spectrum visualization plot (optional)
  • Image view of mean intensity distribution (optional)

How to apply

Load the imported MSI spectral data (imzML or converted centroid format) into the MSI-Explorer napari plugin environment. Extract m/z values and their corresponding intensity arrays for all spectra in the dataset. For each unique m/z value across all pixels/samples, calculate the arithmetic mean of intensities at that m/z. Optionally apply pre-processing steps (noise reduction as a percentage threshold, normalization methods such as TIC, RMS, or reference peak, and hotspot removal at a quantile threshold like 99.9%) before mean calculation. Aggregate results into a structured m/z vs. mean intensity table and export as CSV or HDF5 for compatibility with downstream ROI analysis and annotation workflows.

Related tools

  • napari (Plugin framework environment for loading, visualizing, and processing MSI spectral data) — https://github.com/napari/napari
  • MSI-Explorer (napari plugin that implements mean intensity calculation as a workflow step following data import and visualization) — https://github.com/MMV-Lab/MSI-Explorer
  • Python (Programming language for arithmetic aggregation and export of mean intensity arrays)

Evaluation signals

  • Output table contains all unique m/z values present in the original dataset with no missing entries
  • Each mean intensity value is the arithmetic average of intensities at that m/z across all pixels; spot-check by manual calculation on a subset
  • Output file is valid CSV or HDF5 and is compatible with downstream ROI analysis and annotation tools
  • Mean spectrum plot shows expected dominant peaks and relative intensity relationships consistent with the raw data distribution
  • When pre-processing is applied, mean intensities reflect the specified noise reduction percentage, normalization method, and hotspot removal threshold

Limitations

  • Profile mode MSI data must be converted to centroid mode before processing; the plugin prompts for this conversion but cannot be circumvented
  • Mean intensity calculation assumes all pixels have comparable sampling; highly uneven sampling or missing pixels may skew the aggregate
  • Pre-processing steps (noise reduction, normalization, hotspot removal) are applied before aggregation; the order and parameters chosen will significantly affect the final mean spectrum
  • Export format (CSV vs. HDF5) must be chosen appropriately for downstream tools; some tools may require specific formats

Evidence

  • [other] MSI-Explorer implements mean intensity calculation as a workflow step that processes imported MSI data following data import and visualization stages, operating within the napari plugin framework.: "MSI-Explorer implements mean intensity calculation as a workflow step that processes imported MSI data following data import and visualization stages, operating within the napari plugin framework."
  • [other] For each unique m/z value across all spectra, calculate the arithmetic mean of intensities at that m/z across all pixels/samples.: "For each unique m/z value across all spectra, calculate the arithmetic mean of intensities at that m/z across all pixels/samples."
  • [other] Aggregate results into a structured table (m/z vs. mean intensity) and save as a CSV or HDF5 file compatible with downstream ROI analysis and annotation workflows.: "Aggregate results into a structured table (m/z vs. mean intensity) and save as a CSV or HDF5 file compatible with downstream ROI analysis and annotation workflows."
  • [readme] To calculate the mean spectrum, click on Show true mean spectrum. Clicking Show image will create an image view of the currently plotted data: "To calculate the mean spectrum, click on Show true mean spectrum. Clicking Show image will create an image view"
  • [readme] After pre-processing steps are chosen, click Execute and Show true mean spectrum to calculate the mean intensity.: "After pre-processing steps are chosen, click Execute and Show true mean spectrum to calculate the mean intensity."

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.