matchms.filtering.metadata_processing.require_retention_index module

matchms.filtering.metadata_processing.require_retention_index.require_retention_index(spectrum_in: Spectrum, clone: bool | None = True) Spectrum | None[source]

This function checks if the input spectrum has a ‘retention_index’ in its metadata. If the input spectrum is None or doesn’t have a ‘retention_index’, the function returns None. Otherwise, it returns a clone of the input spectrum.

Parameters:
  • (SpectrumType) (spectrum_in) – The input spectrum to check.

  • clone – Optionally clone the Spectrum.

  • Returns

  • SpectrumType (A clone of the input spectrum if it has a 'retention_index', None otherwise.)