matchms.filtering.derive_ionmode module

matchms.filtering.derive_ionmode.derive_ionmode(spectrum_in: Spectrum) Spectrum[source]

Derive missing ionmode based on adduct.

Some input formates (e.g. MGF files) do not always provide a correct ionmode. This function reads the adduct from the metadata and uses this to fill in the correct ionmode where missing.


spectrum – Input spectrum.

Return type

Spectrum object with ionmode attribute set.