agentsclimarketplace

Spatial spectral array processing

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/spatial-spectral-array-processing

Use when you have preprocessed MSImagingArrays data (after normalization, smoothing, and baseline reduction) and need to detect peaks consistently across all spectra in an imaging experiment, create reference peak positions from a representative subset, and filter by signal-to-noise ratio and.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill spatial-spectral-array-processing

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

8.1 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

spatial-spectral-array-processing

Summary

Transform raw mass spectrometry imaging data into aligned, filtered reference peak matrices by applying noise estimation, peak picking, and frequency-based quality filtering across spatial spectral arrays. This skill bridges low-level signal processing (normalization, smoothing, baseline reduction) and high-level peak summarization for downstream statistical analysis.

When to use

Apply this skill when you have preprocessed MSImagingArrays data (after normalization, smoothing, and baseline reduction) and need to detect peaks consistently across all spectra in an imaging experiment, create reference peak positions from a representative subset, and filter by signal-to-noise ratio and frequency thresholds to produce a uniform peak table for statistical analysis or image generation.

When NOT to use

  • Input is already a peak feature table or summarized peak matrix — peakProcess() requires raw spectra
  • Spectra have not undergone normalization, smoothing, and baseline reduction — apply Cardinal preprocessing workflow first
  • Analysis requires retention of all detected peaks without frequency filtering — use peakPick() alone if no aggregate filtering is needed

Inputs

  • MSImagingArrays (preprocessed with normalization, smoothing, baseline reduction)
  • noise estimation parameter (method, SNR threshold)
  • sampleSize (fraction of spectra for reference peak detection)
  • filterFreq (peak frequency threshold)

Outputs

  • MSImagingExperiment (with aligned reference peak table)
  • reference peak positions and intensities
  • filtered peak matrix (peaks meeting SNR and frequency criteria)

How to apply

Load preprocessed MSImagingArrays data and invoke peakProcess() with method='diff' for derivative-based noise estimation, SNR threshold (e.g., SNR=6), sampleSize parameter to define the fraction of spectra used for reference peak creation (e.g., sampleSize=0.3), and filterFreq to remove infrequent peaks (e.g., filterFreq=0.02 removes peaks occurring in <2% of spectra). The function detects and aligns peaks across the sample subset using specified noise thresholds, aggregates aligned peaks into reference positions, then applies the reference peak table to all spectra in the full dataset. Filter detected peaks by frequency and SNR criteria to ensure only robust, reproducible peaks are retained. The output is a single MSImagingExperiment object containing aligned reference peaks and associated metadata ready for downstream analysis.

Related tools

  • Cardinal (Core package providing peakProcess(), MSImagingArrays, MSImagingExperiment classes, and spectral preprocessing (normalize, smooth, reduceBaseline)) — github.com/kuwisdelu/Cardinal
  • BiocParallel (Enables parallel processing of peakProcess() and other preprocessing methods across multiple cores via BPPARAM option)
  • matter (Low-level signal processing backend for Cardinal 3.6 spectral operations)

Examples

library(Cardinal); msidata_preproc <- normalize(msidata) %>% smooth(method='Gaussian') %>% reduceBaseline(method='SNIP'); peaks_exp <- peakProcess(msidata_preproc, method='diff', SNR=6, sampleSize=0.3, filterFreq=0.02)

Evaluation signals

  • Output MSImagingExperiment contains a reference peak table with m/z values and intensities for all spectra; check dimensions match input spectrum count
  • Peaks in reference table meet SNR ≥ 6 threshold and appear in ≥ filterFreq (2%) of spectra
  • Peak alignment is consistent: m/z values across spectra cluster within expected mass calibration tolerance (~ppm range)
  • Preprocessing history is preserved in metadata; peakProcess() call parameters (method, SNR, sampleSize, filterFreq) are documented
  • No spectra contain NaN or missing peak intensity values after filtering; peak table is complete and ready for statistical analysis

Limitations

  • Peak detection sensitivity depends critically on sampleSize and SNR threshold; small sampleSize may miss rare peaks, while high SNR may lose weak but consistent signals
  • filterFreq threshold is dataset-dependent; peaks rare in one tissue region may be filtered out even if biologically important in another region
  • Method='diff' noise estimation assumes derivative-based peak detection; other noise methods (quantile, SD/MAD, CWT) may perform differently on low-intensity or overlapping peaks
  • peakProcess() requires aligned spectra; if input spectra have large m/z shifts, recalibrate() should be applied before peakProcess() to avoid reference peak fragmentation

Evidence

  • [other] peakProcess() performs peak picking and alignment on a subset of spectra (specified by sampleSize) to create reference peaks, then summarizes these reference peaks for every spectrum in the full dataset, optionally filtering peaks by frequency threshold.: "peakProcess() performs peak picking and alignment on a subset of spectra (specified by sampleSize) to create reference peaks, then summarizes these reference peaks for every spectrum in the full"
  • [other] 1. Load preprocessed MSImagingArrays data containing spectra that have undergone normalization, smoothing, and baseline reduction. 2. Apply peakProcess() function in Cardinal to detect and align peaks across all spectra, using specified noise estimation and peak filtering parameters.: "Load preprocessed MSImagingArrays data containing spectra that have undergone normalization, smoothing, and baseline reduction. 2. Apply peakProcess() function in Cardinal to detect and align peaks"
  • [intro] New peak picking methods in peakPick(): Derivative-based noise estimation, Quantile-based noise estimation, SD/MAD-based noise estimatino, Dynamic peak filtering, Continuous wavelet transform (CWT): "New peak picking methods in peakPick(): Derivative-based noise estimation, Quantile-based noise estimation, SD/MAD-based noise estimatino, Dynamic peak filtering, Continuous wavelet transform (CWT)"
  • [intro] Parallel processing support via the BiocParallel package for all pre-processing methods and any statistical analysis methods with a BPPARAM option: "Parallel processing support via the BiocParallel package for all pre-processing methods and any statistical analysis methods with a BPPARAM option"
  • [intro] Updated MSImagingExperiment class with a new counterpart MSImagingArrays class for better representing raw spectra: "Updated MSImagingExperiment class with a new counterpart MSImagingArrays class for better representing raw spectra"

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.