Compute variance explained by PCA, given a Seurat object for which the PCA dim. reduction has been calculated

getVarianceExplained(seurat, n = 10)

Arguments

seurat

Seurat object

n

Numeric, number of PCs for which variance should be reported. Default: 10

Value

List with two vectors, "percent.var.explained" and "cumulative.var.explained", reported for the first n PCs

Examples

getVarianceExplained(pbmc, n = 5)
#> $percent.var.explained #> [1] 19.311828 10.830010 8.439170 6.816315 6.230545 #> #> $cum.var.explained #> [1] 19.31183 30.14184 38.58101 45.39732 51.62787 #>