matchms.filtering.require_minimum_number_of_peaks module

matchms.filtering.require_minimum_number_of_peaks.require_minimum_number_of_peaks(spectrum_in: Spectrum, n_required: int = 10, ratio_required: Optional[float] = None) Spectrum[source]

Spectrum will be set to None when it has fewer peaks than required.

Parameters
  • spectrum_in – Input spectrum.

  • n_required – Number of minimum required peaks. Spectra with fewer peaks will be set to ‘None’.

  • ratio_required – Set desired ratio between minimum number of peaks and parent mass. Default is None.