matchms.filtering.metadata_processing.require_correct_ionmode module¶
- matchms.filtering.metadata_processing.require_correct_ionmode.require_correct_ionmode(spectrum_in: Spectrum, ion_mode_to_keep) Spectrum | None [source]¶
Validates the ion mode of a given spectrum. If the spectrum’s ion mode doesn’t match the ion_mode_to_keep, it will be removed and a log message will be generated.
- Parameters:
- Returns:
The validated spectrum if its ion mode matches the desired one, or None otherwise.
- Return type:
Spectrum or None