Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

warp-functions

Run warping functions on AbstractMassObject objects.


Description

These functions run warping functions on AbstractMassObject objects (warping is also known as phase correction).

Usage

warpMassPeaks(l, w, emptyNoMatches=FALSE)

warpMassSpectra(l, w, emptyNoMatches=FALSE)

Arguments

l

list, list of MassPeaks or MassSpectrum objects.

w

a list of warping functions determined by determineWarpingFunctions. Has to be of the same length as l.

emptyNoMatches

logical, if TRUE (default: FALSE) the intensity values of MassSpectrum or MassPeaks objects with missing (NA) warping functions are set to zero.

Details

The warping function w is called in the following way:

newMass = oldMass + w(oldMass)

Value

Returns a list of warped MassPeaks or MassSpectrum objects.

Author(s)

Sebastian Gibb mail@sebastiangibb.de

See Also

Examples

## load package
library("MALDIquant")

## create a MassPeaks object
p <- createMassPeaks(mass=1:5, intensity=1:5)

## stupid warping function for demonstration
## (please use determineWarpingFunctions in real life applications)
simpleWarp <- function(x) { return(1) }

## run warping function
w <- warpMassPeaks(list(p), list(simpleWarp))[[1]]

## compare results
all(mass(w) == mass(p)+1) # TRUE

## no warping (MassPeaks object is not changed)
warpMassPeaks(list(p), list(NA))

## no warping (intensity values of MassPeaks object are set to zero)
warpMassPeaks(list(p), list(NA), emptyNoMatches=TRUE)

MALDIquant

Quantitative Analysis of Mass Spectrometry Data

v1.19.3
GPL (>= 3)
Authors
Sebastian Gibb [aut, cre] (<https://orcid.org/0000-0001-7406-4443>), Korbinian Strimmer [ths] (<https://orcid.org/0000-0001-7917-2056>)
Initial release
2019-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.