warpMassSpectra | R Documentation |
These functions run warping functions on
AbstractMassObject
objects
(warping is also known as phase correction).
warpMassPeaks(l, w, emptyNoMatches=FALSE)
warpMassSpectra(l, w, emptyNoMatches=FALSE)
l |
|
w |
a |
emptyNoMatches |
|
The warping function w
is called in the following way:
newMass = oldMass + w(oldMass)
Returns a list
of warped MassPeaks
or
MassSpectrum
objects.
Sebastian Gibb mail@sebastiangibb.de
determineWarpingFunctions
,
MassPeaks
,
MassSpectrum
Website: https://strimmerlab.github.io/software/maldiquant/
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.