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

Keep only peaks between mz_from and mz_to.

Peaks are kept 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.