findPCs: Find maximum recommended PC to use.

View source: R/findPCs.R

findPCsR Documentation

Find maximum recommended PC to use.

Description

Using a seurat object with PCA dimensional reduction run on it, determine the highest PC that still provides information about variance between cells. Adapted from: https://hbctraining.github.io/scRNA-seq/lessons/elbow_plot_metric.html

Usage

findPCs(seurat_obj, drName_v = "pca", min_v = T, elbow_v = T, ndims_v = 30)

Arguments

seurat_obj

A standard seurat object that has a "pca" dimensional reduction

drName_v

Name of pca dimensional reduction. Default is 'pca', which is Seurat default. If you create a PCA on specific genes and label it something else, provide that label name here (e.g. ccs_pca) for a PCA on cell cycle genes.

min_v

logical indicating to take the minimum cut-off of the two

elbow_v

logical indicating to make elbow plot

ndims_v

number of PCs to print in elbow plot

Details

Two cut-offs are calculated 1. The point where an individual PC contributes less than 5 and the cumulative PCs contribute at least 90 1. The point where the percent change in variation between the consecutive PCs is less than 0.1

Value

A single numeric value with the recommended PC cut-off


weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.