"peakAlign"(object, ref, method = c("diff", "DP"), ..., pixel = pixels(object), plot = FALSE)
"peakAlign"(object, ref, ...)
"peakAlign"(object, ref, ...)
## Absolute difference alignment
peakAlign.diff(x, y, diff.max=200, units=c("ppm", "mz"), ...)
## Dynamic programming alignment
peakAlign.DP(x, y, gap=0, ...)
MSImageSet
.MSImageSet
with the peak aligned spectra.
MSImageSet
object is used as the reference, then the local maxima in its mean spectrum will be calculated and used as the reference m/z values. If the reference is missing, the method will use the object itself as the reference. Peak alignment is usually performed using the provided functions, but a user-created function can also be passed to method
. In this case it should take the following arguments:
x
: The vector of m/z values to be aligned.
y
: The vector of reference m/z values.
...
: Additional arguments.
A user-created function should return a vector of the same length as x
and y
where NA
values indicate no match, and non-missing values give the index of the matched peak in the reference set.
Internally, pixelApply
is used to apply the peak alignment. See its documentation page for more details on additional objects available to the environment installed to the peak alignment function.
MSImageSet
,
peakPick
,
peakFilter
,
reduceDimension
,
pixelApply
data <- generateImage(diag(2), as="MSImageSet")
peaks <- peakPick(data, method="simple", plot=interactive())
peaks <- peakAlign(peaks, data, method="diff", plot=interactive())
Run the code above in your browser using DataLab