matchms.filtering.peak_processing.select_by_relative_intensity module
- matchms.filtering.peak_processing.select_by_relative_intensity.select_by_relative_intensity(spectrum_in: Spectrum, intensity_from: float = 0.0, intensity_to: float = 1.0, clone: bool | None = True) Spectrum | None
Keep only peaks within set relative intensity range (keep if intensity_from >= intensity >= intensity_to).
- Parameters:
spectrum_in – Input spectrum.
intensity_from – Set lower threshold for relative peak intensity. Default is 0.0.
intensity_to – Set upper threshold for relative peak intensity. Default is 1.0.
clone – Optionally clone the Spectrum.
- Returns:
Spectrum with peaks within the relative intensity range, or None if not present.
- Return type:
Spectrum or None