calculateMetricsFromSpectra: Calculate QC metrics from a Spectra object

Description Usage Arguments Details Value Author(s) Examples

View source: R/function_calculateMetrics_from_Spectra_or_MsExperiment.R

Description

The function 'calculateMetricsFromSpectra' calculates quality metrics from a 'Spectra'.

Usage

1
calculateMetricsFromSpectra(spectra, metrics = qualityMetrics(spectra), ...)

Arguments

spectra

'Spectra' object

metrics

'character' specifying the quality metrics to be calculated on 'mse'

...

arguments passed to the quality metrics functions defined in 'metrics'

Details

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.

Value

named 'numeric' vector

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(msdata)
library(Spectra)
fls <- dir(system.file("sciex", package = "msdata"), full.names = TRUE)
spectra <- Spectra(fls, backend = MsBackendMzR())

## define the quality metrics to be calculated
metrics <- c("areaUnderTic", "rtDuration", "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 ...
calculateMetricsFromSpectra(spectra = spectra, metrics = metrics, 
    msLevel = 1, change = "jump", relativeTo = "Q1")
calculateMetricsFromSpectra(spectra = spectra, metrics = metrics, 
    msLevel = 1, change = "fall", relativeTo = "previous")

tnaake/MsQuality documentation built on Jan. 14, 2022, 7:34 p.m.