matchms.filtering.metadata_processing.require_retention_time module

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

This function checks if the input spectrum has a ‘retention_time’ in its metadata. If the input spectrum is None or doesn’t have a ‘retention_time’, 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_time', None otherwise.)