peakBin-methods: Peak bin an imaging dataset

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Apply peak binning to a mass spectrometry imaging dataset.

Usage

1
2
3
4
5
6
7
## S4 method for signature 'MSImagingExperiment,numeric'
peakBin(object, ref, type=c("area", "height"),
        tolerance = NA, units = c("ppm", "mz"), ...)

## S4 method for signature 'MSImagingExperiment,missing'
peakBin(object, type=c("area", "height"),
        tolerance = NA, units = c("ppm", "mz"), ...)

Arguments

object

An imaging dataset.

ref

A reference to which the peaks are binned.

type

Should the summarized intensity of the peak by the maximum height of the peak or the area under the curve?

tolerance

The tolerance to be used when matching the m/z features in the dataset to the reference. If this is NA, then automatically guess a resolution from the data.

units

The units to use for the tolerance.

...

Ignored.

Details

Peak binning is performed by first matching the m/z-values in the dataset to those in the reference, and then finding the boundaries of the peak by detecting the nearest local minima. Then either the maximum height or the area under the curve of the peak are returned.

Internally, pixelApply is used to apply the binning. See its documentation page for more details.

Value

An object of the same class with the binned peaks.

Author(s)

Kylie A. Bemis

See Also

MSImagingExperiment, peakPick, peakAlign, peakFilter, reduceDimension, pixelApply, process

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
setCardinalBPPARAM(SerialParam())

set.seed(2)
data <- simulateImage(preset=1, npeaks=10, dim=c(3,3))
data <- data[,pData(data)$circle]
ref <- mz(metadata(data)$design$featureData)

# queue peak binning
data <- peakBin(data, ref=ref, type="height")

# apply peak binning
data_peaks <- process(data, plot=interactive())

Example output

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: BiocParallel
Loading required package: EBImage
Loading required package: S4Vectors
Loading required package: stats4

Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: ProtGenerics

Attaching package:ProtGenericsThe following object is masked frompackage:stats:

    smooth


Attaching package:CardinalThe following object is masked frompackage:stats:

    filter

Cardinal documentation built on Nov. 8, 2020, 11:10 p.m.