Extract data from MSnbase objects for use in Spectra
extractSpectraData
extracts the spectra data (m/z and intensity values
including metadata) from MSnExp, OnDiskMSnExp,
Spectrum1, Spectrum2 objects (or list
of such objects) and
returns these as a DataFrame
that can be used to create a
Spectra::Spectra object.This function enables thus
to convert data from the old MSnbase
package to the newer Spectra
package.
extractSpectraData(x)
DataFrame()
with the full spectrum data that can be passed to the
Spectra::Spectra()
function to create a Spectra
object.
Johannes Rainer
## Read an mzML file with MSnbase fl <- system.file("TripleTOF-SWATH", "PestMix1_SWATH.mzML", package = "msdata") data <- filterRt(readMSData(fl, mode = "onDisk"), rt = c(1, 6)) ## Extract the data as a DataFrame res <- extractSpectraData(data) res ## This can be used as an input for the Spectra constructor of the ## Spectra package: ## sps <- Spectra::Spectra(res) ## sps
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.