Learn R Programming

MALDIquant (version 1.2)

warpMassSpectra: 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)

warpMassSpectra(l, w)

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.

Value

  • Returns a list of warped MassPeaks or MassSpectrum objects.

Details

The warping function w is called in the following way: $$newMass = oldMass + w(oldMass)$$

References

See website: http://strimmerlab.org/software/maldiquant/

See Also

determineWarpingFunctions, MassPeaks, MassSpectrum

Examples

Run this code
## load library
library("MALDIquant");

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

## simple warping function (see determineWarpingFunctions for details)
simpleWarp <- function(x) { return(1); }

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

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

Run the code above in your browser using DataLab