agentsclimarketplace

Spectral mz range filtering

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/spectral-mz-range-filtering

Use when you have loaded an MsmsSpectrum object from a proteomics or metabolomics dataset and need to focus the analysis window on a specific m/z range relevant to your experiment (e.g., 100–1400 m/z for typical tryptic peptides).From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill spectral-mz-range-filtering

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

4.6 KB, 817 tokens by cl100k_base, as published. Nobody here has run it

spectral-mz-range-filtering

Summary

Restrict mass-to-charge (m/z) range of tandem MS spectra to a defined window to eliminate out-of-range noise and focus analysis on biologically relevant ion signals. This preprocessing step is applied early in the spectrum processing pipeline to improve downstream peak matching and reduce computational overhead.

When to use

Apply this skill when you have loaded an MsmsSpectrum object from a proteomics or metabolomics dataset and need to focus the analysis window on a specific m/z range relevant to your experiment (e.g., 100–1400 m/z for typical tryptic peptides). Use it before intensity filtering or peak annotation to eliminate spectral artifacts outside your region of interest.

When NOT to use

  • Spectrum has already been m/z-filtered by an upstream process or is already restricted to your target range.
  • Your analysis requires full spectral information across all m/z values (e.g., for neutral loss or imager analysis outside standard peptide range).
  • Input is not an MsmsSpectrum object but a different spectrum representation (e.g., raw binary mzML data stream).

Inputs

  • MsmsSpectrum object (loaded e.g., via MsmsSpectrum.from_usi())

Outputs

  • MsmsSpectrum object with m/z and intensity arrays restricted to the specified range

How to apply

Call set_mz_range() on the MsmsSpectrum object with min_mz and max_mz parameters defining your desired window (e.g., min_mz=100, max_mz=1400 for peptide analysis). The method modifies the spectrum's m/z and intensity arrays in place, retaining only peaks whose m/z values fall within [min_mz, max_mz]. Choose your boundaries based on the expected mass range of fragment ions from your analyte class and instrument capabilities. Verify the result by confirming that the returned spectrum's minimum and maximum m/z values respect your specified range, and that no peaks outside this window remain in the m/z array.

Related tools

Examples

spectrum = MsmsSpectrum.from_usi('mzspec:MSV000082283:f07074:scan:5475')
spectrum.set_mz_range(min_mz=100, max_mz=1400)

Evaluation signals

  • Verify that spectrum.mz.min() >= min_mz and spectrum.mz.max() <= max_mz after filtering.
  • Confirm that the length of the intensity array matches the length of the m/z array after filtering.
  • Check that no peaks remain outside the [min_mz, max_mz] window in the output spectrum.
  • Validate that peaks within the range are preserved with identical m/z and intensity values.
  • Ensure the modification preserves the pairing between m/z and intensity arrays (no index misalignment).

Limitations

  • set_mz_range() performs hard cutoff at boundary values; peaks exactly at min_mz or max_mz may be included or excluded depending on implementation detail.
  • No interpolation or smoothing is applied; edge effects near boundaries are not mitigated.
  • The method does not account for instrument mass calibration drift or systematic m/z offset; pre-calibration is assumed.

Evidence

  • [other] set_mz_range method: "spectrum.set_mz_range(min_mz=100, max_mz=1400)"
  • [intro] filter rationale: "Common spectrum processing operations (precursor & noise peak removal, intensity filtering, intensity scaling) optimized for computational efficiency."
  • [other] workflow context: "Apply set_mz_range with min_mz=100 and max_mz=1400 to restrict the m/z window."
  • [intro] tool description: "spectrum_utils is a Python package for efficient mass spectrometry data processing and visualization."

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.