"reduceDimension"(object, method = c("bin", "resample"), ..., pixel = pixels(object), plot = FALSE)
"reduceDimension"(object, ref, method = "peaks", ...)
"reduceDimension"(object, ref, method = "peaks", ...)
## Bin the signal
reduceDimension.bin(x, t, width=200, offset=0, units=c("ppm","mz"), fun=sum, ...)
## Resample the signal
reduceDimension.resample(x, t, step=1, offset=0, ...)
## Reduce the signal to peaks
reduceDimension.peaks(x, t, peaklist, type=c("height", "area"), ...)
MSImageSet
.MSImageSet
.numeric
vector giving the m/z values of the reference peaks.MSImageSet
with the dimension-reduced spectra.
method
. In this case it should take the following arguments:
x
: A numeric
vector of intensities.
t
: A numeric
vector of m/z values.
tout
: A numeric
vector of m/z values to output.
...
: Additional arguments.
The optional argument tout
was added in version 1.3.1 to avoid cases where the output m/z values may be costly and inefficient to re-calculate for every spectrum.
A user-created function should return a list
with two vectors of equal length, where the new length must be shorter than x
and t
:
x
: A numeric
vector of new intensities.
t
: A numeric
vector of new m/z values.
Internally, pixelApply
is used to apply the dimension reduction. See its documentation page for more details on additional objects available to the environment installed to the dimension reduction function.
MSImageSet
,
peakPick
,
peakAlign
,
pixelApply
data <- generateImage(as="MSImageSet")
reduceDimension(data, method="resample", step=100, plot=interactive())
Run the code above in your browser using DataLab