matchms.importing.load_from_mzml module¶
- matchms.importing.load_from_mzml.load_from_mzml(filename: str, ms_level: int = 2, metadata_harmonization: bool = True) Generator[Spectrum, None, None] [source]¶
Load spectrum(s) from mzml file.
This function will create ~matchms.Spectrum for every spectrum of desired ms_level found in a given MzML file. For more extensive parsing options consider using pyteomics or pymzml packages.
Example:
from matchms.importing import load_from_mzml file_mzml = "testdata.mzml" spectrums = list(load_from_mzml(file_mzml))
- Parameters:
filename – Filename for mzml file to import.
ms_level – Specify which ms level to import. Default is 2.
metadata_harmonization (bool, optional) – Set to False if metadata harmonization to default keys is not desired. The default is True.