mzBin-methods {Cardinal} | R Documentation |
Apply mass binning to a mass spectrometry imaging dataset.
## S4 method for signature 'MSImagingExperiment,numeric' mzBin(object, ref, tolerance = NA, units = c("ppm", "mz"), fun=sum, ...) ## S4 method for signature 'MSImagingExperiment,missing' mzBin(object, from=min(mz(object)), to=max(mz(object)), by, resolution = NA, units = c("ppm", "mz"), fun=sum, ...)
object |
An imaging dataset. |
ref |
A reference to which the m/z values are binned. |
tolerance |
The half-width(s) of the bins. If this is NA, then automatically guess a resolution from the data. |
from, to |
The starting amd (maximal) end values of the sequence of m/z values. |
by |
The (approximate) interval between m/z values. For |
resolution |
Another way to specify the interval between m/z values. For |
units |
The units for |
fun |
The function used to summarize each mass bin. |
... |
Ignored. |
The reference masses are considered to be the center of each bin. The bin is then expanded on either side according to half the value of width
, and the intensities in each bin are summarized by applying fun
.
Internally, pixelApply
is used to apply the binning. See its documentation page for more details.
An object of the same class with the binned spectra.
Kylie A. Bemis
MSImagingExperiment
,
mzAlign
,
peakBin
,
reduceDimension
,
pixelApply
,
process
setCardinalBPPARAM(SerialParam()) set.seed(2) data <- simulateImage(preset=1, npeaks=10, dim=c(3,3)) data <- data[,pData(data)$circle] # queue m/z binning data <- mzBin(data, resolution=10, units="mz", fun=max) # apply m/z binning data_binned <- process(data, plot=interactive())