getSpectra {IDSL.MXP} | R Documentation |
This function creates a spectraList for the chromatogram scans of the mass spectrometry data.
getSpectra(xmlData, msFormat)
xmlData |
a structured data of the mass spectrometry data created by the 'read_xml' function. |
msFormat |
format extension of the mass spectrometry file c("mzML", "mzXML") |
a list of matrices of m/z and intensity values for each chromatogram scan
temp_wd <- tempdir()
temp_wd_zip <- paste0(temp_wd,"/idsl_ipa_test_files.zip")
download.file(paste0("https://github.com/idslme/IDSL.IPA/blob/main/",
"IPA_educational_files/idsl_ipa_test_files.zip?raw=true"),
destfile = temp_wd_zip, mode = "wb")
unzip(temp_wd_zip, exdir = temp_wd)
xmlData <- xml2::read_xml(paste0(path = temp_wd, "/", MSfile = "003.mzML"))
spectraList <- getSpectra(xmlData, msFormat = "mzML")