prcompExprs: Principal component analysis of an expression matrix

View source: R/pca.R

prcompExprsR Documentation

Principal component analysis of an expression matrix

Description

Principal component analysis of an expression matrix

Usage

prcompExprs(matrix, ntop = NULL, scale = FALSE, nbin = NULL)

Arguments

matrix

Numeric matrix. Features in rows and samples in columns.

ntop

Integer or NULL. If not NULL, only ntop genes with the highest variance are used for the calculation.

scale

Logical, whether variance of features should be scaled to 1. Default FALSE, as recommended by Nguyen et al. (2019)

nbin

Integer. Genes are divided into nbin bins by their average gene expression signal, and top variable genes (approximately ntop/nbin) are selected from each bin. If NULL or NA, an automatic value (100, or nrow(matrix) %/% 10 when fewer are 1000 genes are used as input) is used. It is only used when ntop is not NULL.

References

Nguyen, Lan Huong, and Susan Holmes. "Ten Quick Tips for Effective Dimensionality Reduction." PLOS Computational Biology 15, no. 6 (2019): e1006907

See Also

topVarRowsByMeanBinning

Examples


myTestExprs <- matrix(rnorm(1000), ncol=10, byrow=FALSE)
myTestExprs[1:50, 6:10] <- myTestExprs[1:50, 6:10] + 2
myTopPca <- prcompExprs(myTestExprs, ntop=50, nbin=5)


bedapub/ribiosNGS documentation built on Feb. 10, 2025, 12:34 a.m.