ematAdjust: matrix row-wise scaling and centering

Description Usage Arguments Details Value See Also Examples

View source: R/ematAdjust.R

Description

Centers and scales gene expression matrix so that each row has mean=0 and sd=1. If input data is non-normalized sequencing count data, normalization should be performed by setting normMethod. This also enforces log2-transformation.

Usage

1
2
3
4
5
6
7
8
9
ematAdjust(
  emat,
  center = TRUE,
  scale = TRUE,
  normMethod = NULL,
  signalFilt = 0,
  verbose = getOption("verbose"),
  ...
)

Arguments

emat

a numeric matrix with row features and sample columns.

center

numeric of same length as nrow(emat).

scale

numeric of same length as nrow(emat).

normMethod

a character, passed to edgeR calcNormFactors if element in c("TMM","RLE", "upperquartile","none") or voom normalizeBetweenArrays if in c("scale", "quantile", "cyclicloess").

signalFilt

numeric setting feature filtering. Specifically rows where rowMax(emat) < quantile(emat, probs = signalFilt) are discarded.

verbose

logical, console messages output.

...

additional arguments passed to normalizeBetweenArrays and calcNormFactors depending normalization method selected.

Details

ematAdjust performs row-wise scaling and centering by passing matrix to scale. Setting scale and center may be useful for predicting new samples based on row-wise means and standard deviations from prior (identically processed) datasets. If e.g. signalFilt=.1 features with maximum below emat 10th percentile are discarded.

Value

A row-wise centered and scaled matrix. Output matrix will have fewer rows than input if signalFilt>0.

See Also

scale, voom, normalizeBetweenArrays

Examples

1
2
3
4
5
library(Biobase)
emat <- ematAdjust(crcTCGAsubset[1:100,], normMethod = "quantile")
mean(Biobase::exprs(crcTCGAsubset))    # E[>2]
mean(emat,na.rm=TRUE)             # E[~0]
stats::sd(emat,na.rm=TRUE)        # E[~1]

peterawe/CMScaller documentation built on June 13, 2020, 4:49 a.m.