standardize,Asset-method {Allspice}R Documentation

Data standardization

Description

Standardize scale and location of variables.

Usage

standardize(obj, dat, trim = FALSE)

Arguments

obj

An object of the class Asset.

dat

A matrix that containts variables as rows and samples as columns.

trim

If true, returns only variables used as input features for classification.

Details

If the asset is so configured, the data are first transformed by log(x + 1). Values are processed with the mean and standard deviation that were calculated from the training data when the asset was assembled. The mean is subtracted and the values divided by SD. To control for outliers, extreme values are compressed by the t-distribution with 50 degrees of freedom.

Value

Returns a matrix in the same format as the input.

Examples

# Import ALL subtyping asset.
base <- system.file(package = "Allspice")
folder <- file.path(base, "subtypes")
a <- asset(folder)

# Simulated data.
simu <- bcellALL(5)

# Standardize RNA read counts.
expres <- normalize(a, dat = simu$counts)
zscores <- standardize(a, dat = expres)
print(head(simu$counts))
print(head(expres))
print(head(zscores))

[Package Allspice version 1.0.7 Index]