matPCs: matPCs function

Description Usage Arguments Details Value Author(s) Examples

View source: R/matPCs.R

Description

Performs PCA on a given matrix and returns a dimension reduced matrix which captures at least 80% (default) of overall variability.

Usage

1
matPCs(data, assay = NULL, percentVar = 0.8)

Arguments

data

An expression matrix or a SingleCellExperiment object.

assay

An assay to select if data is a SingleCellExperiment object

percentVar

The percentage of variance threshold. This is used to select number of Principal Components.

Details

This function performs PCA to reduce the dimension of the gene expression matrix limited from 10 to 20 PCs.

Value

Dimensionally reduced matrix.

Author(s)

Pengyi Yang, Taiyun Kim

Examples

1
2
3
4
5
6
7
8
data("gse87795_subset_sce")

mat.expr <- gse87795_subset_sce

mat.pc <- matPCs(mat.expr, assay = "logNorm")

# to capture at least 70% of overall variability in the dataset,
mat.dim.reduct.70 <- matPCs(mat.expr, assay = "logNorm", 0.7)

SydneyBioX/scReClassify documentation built on Oct. 6, 2021, 5:34 a.m.