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

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".