Learn R Programming

SPUTNIK (version 1.4.2)

normIntensity,msi.dataset-method: Normalize the peaks intensities.

Description

Normalize the peaks intensities.

Usage

# S4 method for msi.dataset
normIntensity(object, method = "median", peaksInd = NULL, offsetZero = 0)

Value

object msi.dataset-class object, with normalized peaks intensities.

When using TIC scaling, if zeros are present in the matrix, a positive offset must be added to all the peak intensities through the parameter offsetZero. This is necessary for applying the CLR transformation. TIC scaling transforms the spectra into compositional data; in this case the CLR transformation must be applied through the varTransform function.

Arguments

object

msi.dataset-class object.

method

string (default = "median"). The normalization method to be used. Valid values are: "median", "PQN", "TIC", TMM, or "upperQuartile". See 'Details' section.

peaksInd

numeric array (default = NULL). Array of peak indices used to calculate the scaling factors (TIC, median). If NULL, all the peaks are used.

offsetZero

numeric (default = 0). This value is added to all the peak intensities to take into accounts of the zeros.

Author

Paolo Inglese p.inglese14@imperial.ac.uk

Details

The valid values for method are:

  • "median": median of spectrum intensities is scaled to one.

  • "PQN":

    1. apply "TIC" normalization

    2. calculate the median reference spectrum (after removing the zeros)

    3. calculate the quotients of peaks intensities and reference

    4. calculate the median of quotients for each peak (after removing the zeros)

    5. divide all the peak intensities by the median of quotients

  • "TIC": total ion current normalization assign the sum of the peaks intensities to one.

  • "TMM": trimmed mean of M-values (TMM with zero pairing). Called TMMwzp in edgeR.

  • "upperQuartile": spectra are scaled by their 3rd quartile.

References

F. Dieterle, A. Ross, G. Schlotterbeck, and Hans Senn. 2006. Probabilistic quotient normalization as robust method to account for dilution of complex biological mixtures. Application in 1H NMR metabonomics. Analytical Chemistry 78(13): 4281-4290.

Robinson MD, Oshlack A (2010). A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biology 11, R25.

See Also

msi.dataset-class

Examples

Run this code
## Load package
library("SPUTNIK")

## Create the msi.dataset-class object
sz <- c(40, 40)
x <- matrix(rnorm(sz[1] * sz[2] * 20) * 1000, sz[1] * sz[2], 20)
x[x < 0] <- 0 # MS data is positive
mz <- sort(sample(100, ncol(x)))
msiX <- msiDataset(x, mz, sz[1], sz[2])

## Normalize and log-transform
msiX <- normIntensity(msiX, "median")
msiX <- varTransform(msiX, "log")

## Create the msi.dataset-class object
sz <- c(40, 40)
x <- matrix(rnorm(sz[1] * sz[2] * 20) * 1000, sz[1] * sz[2], 20)
x[x < 0] <- 0 # MS data is positive
mz <- sort(sample(100, ncol(x)))
msiX <- msiDataset(x, mz, sz[1], sz[2])

## Normalize using PQN
msiX <- normIntensity(msiX, "PQN")

Run the code above in your browser using DataLab