matchms.filtering.peak_processing.select_by_mz module
- matchms.filtering.peak_processing.select_by_mz.select_by_mz(spectrum_in: Spectrum, mz_from: float = 0.0, mz_to: float = 1000.0, clone: bool | None = True) Spectrum | None[source]
Keep only peaks between mz_from and mz_to (keep if mz_from >= m/z >= mz_to).
- Parameters:
spectrum_in – Input spectrum.
mz_from – Set lower threshold for m/z peak positions. Default is 0.0.
mz_to – Set upper threshold for m/z peak positions. Default is 1000.0.
clone – Optionally clone the Spectrum.
- Returns:
Spectrum with peaks within the specified mz range, or None if not present.
- Return type:
Spectrum or None