standardizeSamples-methods {Cardinal} | R Documentation

## Standardize the Samples in an Imaging Dataset

### Description

Apply standardization across the samples in a mass spectrometry imaging dataset to correct for between-sample variation.

### Usage

    ## S4 method for signature 'MSImageSet'
    standardizeSamples(object, method = "sum", ...)

    ## TIC normalization
    standardizeSamples.sum(x, sum=length(x), ...)

### Arguments

`object` | An object of class `MSImageSet`.
`method` | The standardization method to use.
`...` | Additional arguments passed to the standardization method.
`x` | The flattened ion image to be standardized.
`sum` | The value to which to standardize the sum of the ion image intensity values.

### Details

Standardization 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`: A `numeric` vector of intensities.

- `...`: Additional arguments.

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

Internally, `featureApply` is used to apply the standardization, with `.pixel.groups=sample`. See its documentation page for more details on additional objects available to the environment installed to the standardization function.

### Value

An object of class `MSImageSet` with the ion images standardized across samples.

### Author(s)

Kylie A. Bemis

### See Also

`MSImageSet`, `featureApply`

### Examples

    data1 <- generateImage(as="MSImageSet")
    data2 <- generateImage(as="MSImageSet")
    sampleNames(data2) <- "2"
    data3 <- combine(data1, data2)
    standardizeSamples(data3, method="sum")

[Package Cardinal version 1.12.1 Index]