normalize-methods: Normalize an imaging dataset

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

Description

Apply normalization to the feature vectors of an imaging dataset.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'SparseImagingExperiment'
normalize(object, method = c("tic", "rms", "reference"), ...)

## S4 method for signature 'MSImageSet'
normalize(object, method = "tic",
	...,
	pixel = pixels(object),
	plot = FALSE)

## Totial-ion-current normalization
normalize.tic(x, tic=length(x), ...)

## Root-mean-square normalization
normalize.rms(x, rms=1, ...)

## Reference normalization
normalize.reference(x, feature, scale=1, ...)

Arguments

object

An imaging dataset.

method

The normalization method to use.

pixel

The pixels to normalize. If less than the extent of the dataset, this will result in a subset of the data being processed.

plot

Plot each pixel while it is being processed?

...

Additional arguments passed to the normalization method.

x

The signal to be normalized.

tic

The value to which to normalize the total ion current.

rms

The value to which to normalize the root-mean-square.

feature

The feature to use as a reference for normalization.

scale

The value to which to normalize the reference.

Details

Normalization 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:

A user-created function should return a numeric vector of the same length.

Internally, pixelApply is used to apply the normalization. See its documentation page for more details on additional objects available to the environment installed to the normalization function.

Value

An object of the same class with the normalized spectra.

Author(s)

Kylie A. Bemis

See Also

MSImagingExperiment, MSImageSet, pixelApply, process

Examples

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

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

# queue normalization
data <- normalize(data, method="tic")

# apply normalization
data_normalized <- process(data)

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.