varTransform-msi.dataset-method: Variance stabilizing transformation.

varTransform,msi.dataset-methodR Documentation

Variance stabilizing transformation.

Description

varTransform transforms the MS intensities in order to reduce heteroscedasticity.

Usage

## S4 method for signature 'msi.dataset'
varTransform(object, method = "log", offsetZero = 1)

Arguments

object

msi.dataset-class object. See msiDataset.

method

string (default = log). Transformation method. Valid values are:

  • "log", "log2", "log10": log-transformation defined as log(x + offsetZero).

  • "sqrt": square-root transformation.

  • "clr": centered log-transformation. To be used when TIC scaling normalization is applied.

offsetZero

numeric (default = 1). This value is added to all the peak intensities to take into accounts of the zeros. It must be positive.

Value

msi.dataset-class object with transformed peaks intensities.

Examples

## 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")

paoloinglese/SPUTNIK documentation built on April 18, 2024, 8:56 p.m.