matchms.importing.load_from_usi module

matchms.importing.load_from_usi.load_from_usi(usi: str, server: str = 'https://metabolomics-usi.ucsd.edu', metadata_harmonization: bool = True)[source]

Load spectrum from metabolomics USI.

USI returns JSON data with keys “peaks”, “n_peaks” and “precuror_mz”

from matchms.importing import load_from_usi

spectrum = load_from_usi("mzspec:MASSBANK::accession:SM858102")
print(f"Found spectrum with precursor m/z of {spectrum.get("precursor_mz"):.2f}.")
Parameters
  • usi – Provide the usi.

  • server (string) – USI server

  • metadata_harmonization (bool, optional) – Set to False if metadata harmonization to default keys is not desired. The default is True.