View source: R/function_calculateMetrics_from_Spectra.R
calculateMetricsFromOneSampleSpectra | R Documentation |
The function calculateMetricsFromOneSampleSpectra
calculates quality
metrics from a Spectra
containing spectral data from one sample.
calculateMetricsFromOneSampleSpectra(
spectra,
metrics = qualityMetrics(spectra),
filterEmptySpectra = FALSE,
f = spectra$dataOrigin,
...
)
spectra |
|
metrics |
|
filterEmptySpectra |
|
f |
|
... |
arguments passed to the quality metrics functions defined in
|
The metrics are defined by the argument metrics
. Further arguments
passed to the quality metric functions can be specified by the params
argument. params
can contain named entries which are matched against
the formal arguments of the quality metric functions.
The Spectra
object will only contain spectral data from one
data origin (e.g. spectra$dataOrigin
is of length 1). The grouping
is specified by the argument f
.
Setting the argument filterEmptySpectra
to TRUE
will remove
zero-length entries, zero-intensity entries, and entries with
intensities that are Inf
from the Spectra
object.
named numeric
vector
Thomas Naake
library(msdata)
library(Spectra)
fls <- dir(system.file("sciex", package = "msdata"), full.names = TRUE)[1]
spectra <- Spectra(fls, backend = MsBackendMzR())
## define the quality metrics to be calculated
metrics <- c("areaUnderTic", "chromatographyDuration", "msSignal10xChange")
## calculate the metrics
## additional parameters passed to the quality metrics functions
## (MsLevel is an argument of areaUnderTic and msSignal10xChange,
## relativeTo is an argument of msSignal10xChange) passed to ...
MsQuality:::calculateMetricsFromOneSampleSpectra(spectra = spectra,
metrics = metrics, msLevel = 1, change = "jump", relativeTo = "Q1")
MsQuality:::calculateMetricsFromOneSampleSpectra(spectra = spectra,
metrics = metrics, msLevel = 1, change = "fall", relativeTo = "previous")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.