scCalcPCAVarExplained: Calculate the percent of variation explained by individual...

View source: R/Seurat.Utils.Visualization.R

scCalcPCAVarExplainedR Documentation

Calculate the percent of variation explained by individual PC's

Description

This function calculates the percentage of variation each principal component (PC) accounts for in a Seurat object. It's specifically tailored for Seurat objects and provides a convenient way to understand the variance distribution across PCs. For similar calculations on standard PCA objects, refer to github.com/vertesy/Rocinante PCA.percent.var.explained().

Usage

scCalcPCAVarExplained(obj = combined.obj)

Arguments

obj

A Seurat object from which to calculate the percentage of variation explained by each PC. Default: combined.obj.

Value

A named vector with the percentage of variation explained by each principal component.

Examples

## Not run: 
if (interactive()) {
  data("combined.obj") # Example Seurat object
  var_explained <- scCalcPCAVarExplained(combined.obj)
  print(var_explained)
}

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.