View source: R/MsExperiment-functions.R
readMsExperiment | R Documentation |
Read/import MS spectra data of an experiment from the respective (raw)
data files into an MsExperiment()
object. Files provided with the
spectraFiles
parameter are imported as a Spectra
object and each
file is automatically linked to rows (samples) of a sampleData
data frame (if provided).
readMsExperiment(spectraFiles = character(), sampleData = data.frame(), ...)
spectraFiles |
|
sampleData |
|
... |
additional parameters for the |
MsExperiment
.
Johannes Rainer
## Define the files of the experiment to import
fls <- c(system.file("microtofq/MM14.mzML", package = "msdata"),
system.file("microtofq/MM8.mzML", package = "msdata"))
## Define a data frame with some sample annotations
ann <- data.frame(
injection_index = 1:2,
sample_id = c("MM14", "MM8"))
## Import the data
library(MsExperiment)
mse <- readMsExperiment(spectraFiles = fls, ann)
mse
## Access the spectra data
spectra(mse)
## Access the sample annotations
sampleData(mse)
## Import the data reading all MS spectra directly into memory
mse <- readMsExperiment(spectraFiles = fls, ann,
backend = Spectra::MsBackendMemory())
mse
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.