Generate principal component analysis data that can be used in downstream analyses.

generatePCs(mat, vars, nFeatures)

Arguments

mat

A data matrix where rows are features and columns are samples

vars

A vector of gene variances (can calculate using RGenEDA::plotVariance)

nFeatures

Number of top features to generate principal components on.

Value

A list consisting of 3 slots: Loadings, Eigenvectors, and percent_var