Description Usage Arguments Value Author(s) Examples
View source: R/functions-MSpectra.R
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.
1 |
x |
a |
DataFrame()
with the full spectrum data that can be passed to the
Spectra::Spectra()
function to create a Spectra
object.
Johannes Rainer
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.