calcPCA: Calculate principal components

Description Usage Arguments Value Examples

View source: R/pca.R

Description

This performs principal component analysis on centered and scaled expression data, which is stored in @pca.scores and @pca.load. Then, the principal components that are significant are estimated using the Marchenko Pastur Law (by calling pcaMarchenkoPastur, which is stored in @pca.sig. By default, twice as many PCs are saved as are determined as significant, which can be adjusted with the store.thresh parameter.

Usage

1
2
3
4
5
6
7
8
9
calcPCA(
  object,
  genes.use = object@var.genes,
  pcs.store = NULL,
  store.thresh = 2,
  mp.factor = 1,
  do.print = T,
  verbose = T
)

Arguments

object

URD object

genes.use

(Character Vector) Genes to use for principal components analysis (default: stored variable genes. Set NULL to use all genes.)

pcs.store

(Numeric) Number of PCs to retain (if NULL, will determine using store.thresh)

store.thresh

(Numeric) If pcs.store isn't specified, stores the number of significant PCs times this number

mp.factor

(Numeric) Retain PCs than are this factor more than the estimated maximum singular value expected or random data. (This is useful in cases when there are many PCs that have standard deviations just above that expected by random, which probably represent noise and should be excluded.)

do.print

(Logical) Report determined Marchenko-Pastur values for significant PCs.

verbose

(Logical) Whether to report on progress

Value

An URD object, with loading of genes into PCs in @pca.load, PC scores for each cell in @pca.scores, and the significance of each PC stored in slot @pca.sig.

Examples

1
2
3
object <- calcPCA(object)

object <- calcPCA(object, genes.use=object@var.genes, mp.factor=1.2)

farrellja/URD documentation built on June 17, 2020, 4:48 a.m.