Learn R Programming

MassArray (version 1.24.0)

sum.MassArraySpectrum: Sum MassArraySpectrum objects

Description

Function to collapse multiple MassArraySpectrum objects into a single MassArraySpectrum representing the sum of each

Usage

"sum"(x, ..., trim = 0, na.rm = TRUE)

Arguments

x
One or multiple MassArraySpectrum objects to include in sum
...
Any additional MassArraySpectrum objects to include in sum
trim
Numerical value between 0 and 0.5 specifying the proportion of spectra to remove from consideration on a per peak basis, such that the SNR of each peak is calculated as the trimmed mean of the same peak across all included spectra.
na.rm
Logical value passed to mean, indicating whether NA values should be stripped before the computation proceeds.

Value

Returns a single MassArraySpectrum object that represents the union of all unique peaks from the component MassArraySpectrum objects, with SNR for each peak representing the average value of that peak across all spectra

See Also

See Also as MassArraySpectrum

Examples

Run this code
data(MassArray.example.data)
MassArray.example.data$samples[[1]]$peaks[[11]]$height
MassArray.example.data$samples[[1]] <- sum.MassArraySpectrum(MassArray.example.data$samples[[1]], MassArray.example.data$samples[[2]])
MassArray.example.data$samples[[1]]$peaks[[11]]$height

Run the code above in your browser using DataLab