View source: R/function_calculateMetrics_from_Spectra.R
transformIntoMzQC | R Documentation |
MzQCmzQC
objectsThe function transformIntoMzQC
transfers the metrics stored in
spectra_metrics
into a list of MzQCmzQC
objects. Each list
entry will refer to the corresponding entry in spectra_metrics
.
As such, each entry contains information from a single dataOrigin
of a Spectra
object.
The function transformIntoMzQC
is a helper function within
calculateMetricsFromSpectra
.
transformIntoMzQC(spectra_metrics)
spectra_metrics |
list of named vector |
The MzQCmzQC
object will only contain those quality metrics
that have a corresponding attribute with a [PSI:MS] identifier. The
matching is done via the names of each vector in spectra_metrics
.
The Field "version"
is set to the current version of the rmzqc
package.
The entry of "MzQCanalysisSoftware"
is filled with the [PSI:MS] id
of MsQuality
("MS:") and the version is taken from
packageDescription("MsQuality")[["Version"]]
.
list
containing as entries MzQCmzQC
objects for each
Spectra
with same dataOrigin
Thomas Naake, Johannes Rainer
library(msdata)
library(Spectra)
## define file names containing spectra data for the samples
fls <- dir(system.file("sciex", package = "msdata"), full.names = TRUE)
## import the data and add it to the spectra object
spectra <- Spectra(fls, backend = MsBackendMzR())
## define the quality metrics to be calculated
metrics <- c("areaUnderTic", "chromatographyDuration", "msSignal10xChange")
## obtain the spectra_metrics object
f <- dataOrigin(spectra)
f_unique <- unique(f)
## spectra_metrics <- bplapply(f_unique, function(f_unique_i) {
##calculateMetricsFromOneSampleSpectra(
## spectra = spectra[f == f_unique_i], metrics = metrics)
## }, BPPARAM = bpparam())
## transform into mzQC objects
##transformIntoMzQC(spectra_metrics)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.