run_pca: Principal Component Analysis (PCA) of samples

View source: R/visualization-functions.R

run_pcaR Documentation

Principal Component Analysis (PCA) of samples

Description

The counts matrix is transposed to compute principal components of each sample. The data is centered, scaled and rotated by default. The principal components (PCs) where the proportion of variance explained (PVE) meets the "percent_p_value_cutoff" are returned. The default percent cutoff is 1

Usage

run_pca(normalized_counts, scaled = TRUE, percent_p_value_cutoff = 1)

Arguments

normalized_counts

A counts data frame normalized by CQN, TMM, or another preferred method, with genes as rownames.

scaled

Defaults to TRUE. Variables scaled to have unit variance before the analysis takes place.

percent_p_value_cutoff

The p-value threshold in percent.

Value

A list with significant PCs rotated and PVE.

  • sample_pc_values - A matrix of PCs with samples as rows.

  • pve - A numeric vector of PVE greater than "percent_p_value_cutoff".


kelshmo/sageseqr documentation built on June 13, 2024, 10:48 p.m.