matchms.exporting.save_spectra module

matchms.exporting.save_spectra.save_as_pickled_file(spectrums, filename: str) None[source]

Stores spectra as a pickled object

Args:

spectrums:

The spectra that are saved.

filename:

Path to file containing spectra, with file extension “json”, “mgf”, “msp”

matchms.exporting.save_spectra.save_spectra(spectrums: List[Spectrum], file: str, export_style: str = 'matchms') None[source]

Saves spectra as the file type specified.

The following file extensions can be used: “json”, “mgf”, “msp”

Args:

spectrums:

The spectra that are saved.

file:

Path to file containing spectra, with file extension “json”, “mgf”, “msp”

ftype:

Optional. Filetype

export_style:

Converts the keys to the required export style. One of [“matchms”, “massbank”, “nist”, “riken”, “gnps”]. Default is “matchms”