matchms.importing.load_spectra module

matchms.importing.load_spectra.load_list_of_spectrum_files(spectrum_files: List[str] | str) List[Spectrum] | Generator[Spectrum, None, None][source]

Combines all spectra in multiple files into a list of spectra

matchms.importing.load_spectra.load_spectra(file: str, metadata_harmonization: bool = True, ftype: str | None = None) List[Spectrum] | Generator[Spectrum, None, None][source]

Loads spectra from your spectrum file into memory as matchms Spectrum object

The following file extensions can be loaded in with this function: “mzML”, “json”, “mgf”, “msp”, “mzxml”, “usi” and “pickle”. A pickled file is expected to directly contain a list of matchms spectrum objects.

Args:

file:

Path to file containing spectra, with file extension “mzML”, “json”, “mgf”, “msp”, “mzxml”, “usi” or “pickle”

ftype:

Optional. Filetype