agentsclimarketplace

Mass range window restriction

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/mass-range-window-restriction

Use when you have loaded an MsmsSpectrum object and need to focus analysis on a biologically or chemically relevant mass window.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill mass-range-window-restriction

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.6 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

mass-range-window-restriction

Summary

Restrict mass spectrometry data to a predefined m/z range to remove spectral regions outside the analyte search space and reduce computational burden. This operation filters out low and high mass-to-charge peaks before downstream analysis.

When to use

Apply this skill when you have loaded an MsmsSpectrum object and need to focus analysis on a biologically or chemically relevant mass window. Use it as a preprocessing step before precursor peak removal and noise filtering, particularly when working with peptide fragmentation spectra where the expected fragment m/z range is known (e.g., 100–1400 m/z for typical proteomics).

When NOT to use

  • When the expected m/z range of your analyte is unknown or spans the full detector range (e.g., untargeted metabolomics with wide precursor mass windows).
  • If you have already applied intensity-based filtering that discarded most low-intensity peaks; mass-range restriction may then remove few additional peaks.
  • When your analysis requires preservation of all acquired spectral data for subsequent external calibration or systematic error assessment.

Inputs

  • MsmsSpectrum object (loaded from USI or existing data structure)
  • min_mz: float (lower mass-to-charge bound, e.g., 100)
  • max_mz: float (upper mass-to-charge bound, e.g., 1400)

Outputs

  • MsmsSpectrum object with peaks outside the specified m/z range removed

How to apply

Call the set_mz_range() method on your MsmsSpectrum object with min_mz and max_mz parameters that match your analyte's expected fragment mass range. For peptide mass spectrometry, restrict to 100–1400 m/z to exclude background noise outside the biologically relevant region. This operation is applied early in the preprocessing workflow, before removing precursor and noise peaks, because it reduces the dataset size and removes irrelevant spectral information that would otherwise complicate downstream filtering. The choice of bounds depends on your instrument, ionization mode, and the chemical composition of expected fragments.

Related tools

  • spectrum_utils (Provides the set_mz_range() method to restrict MsmsSpectrum objects to a user-defined mass window; optimized for computational efficiency using NumPy and Numba.) — https://github.com/bittremieux/spectrum_utils
  • NumPy (Underlying numerical library used by spectrum_utils for efficient array-based filtering of peaks by m/z value.) — https://www.numpy.org/
  • Numba (Just-in-time compilation library used by spectrum_utils to optimize computational performance of mass-range filtering operations.) — http://numba.pydata.org/

Examples

spectrum.set_mz_range(min_mz=100, max_mz=1400)

Evaluation signals

  • All peaks in the output MsmsSpectrum fall within the specified [min_mz, max_mz] window; no peaks outside the bounds remain.
  • The number of peaks in the output spectrum is less than or equal to the input spectrum (monotonic decrease or equality).
  • Precursor m/z (if within the mass window) and expected fragment ion m/z values are preserved in the output.
  • The m/z values of remaining peaks match the original data; only peaks are removed, no values are modified.
  • When applied to a reference dataset (e.g., mzspec:MSV000082283:f07074:scan:5475 restricted to 100–1400 m/z), the output spectrum structure is valid and peak list is contiguous.

Limitations

  • Hard m/z boundaries may exclude legitimate low- or high-mass fragments if the window is chosen too narrowly; verification of the mass window against known fragment ion distributions is recommended.
  • This operation is destructive — discarded peaks cannot be recovered without reloading the raw spectrum.
  • The choice of min_mz and max_mz is domain-specific and must be justified for your experimental context (e.g., 100–1400 m/z is standard for tryptic peptides but may not suit other analytes).
  • No changelog or versioning information is available in the repository, limiting traceability of parameter defaults or breaking changes across spectrum_utils versions.

Evidence

  • [other] Restrict the mass range to 100–1400 m/z to filter out irrelevant peaks: "Restrict the mass range to 100–1400 m/z to filter out irrelevant peaks"
  • [other] set_mz_range method signature and usage in preprocessing: "Call set_mz_range(min_mz=100, max_mz=1400) to restrict the mass range."
  • [other] Position in preprocessing workflow before noise removal: "1. Load an MsmsSpectrum object (from a USI or existing data structure). 2. Call set_mz_range(min_mz=100, max_mz=1400) to restrict the mass range."
  • [other] Computational efficiency rationale using NumPy and Numba: "Spectrum processing in spectrum_utils has been optimized for computational efficiency using NumPy and Numba"
  • [intro] Core spectrum preprocessing operations include intensity filtering and scaling: "Common spectrum processing operations (precursor & noise peak removal, intensity filtering, intensity scaling) optimized for computational efficiency."

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.