matchms.filtering.metadata_processing.clean_adduct module

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

Clean adduct and make it consistent in style. Will transform adduct strings of type ‘M+H+’ to ‘[M+H]+’.

Parameters:
  • spectrum_in – Matchms Spectrum object.

  • clone – Optionally clone the Spectrum.

Returns:

Spectrum with cleaned adduct, or None if not present.

Return type:

Spectrum or None