Run a PCA dimensionality reduction. For details about stored PCA calculation
parameters, see PrintPCAParams
.
RunPCA(object, ...)# S3 method for default
RunPCA(
object,
assay = NULL,
npcs = 50,
rev.pca = FALSE,
weight.by.var = TRUE,
verbose = TRUE,
ndims.print = 1:5,
nfeatures.print = 30,
reduction.key = "PC_",
seed.use = 42,
approx = TRUE,
...
)
# S3 method for Assay
RunPCA(
object,
assay = NULL,
features = NULL,
npcs = 50,
rev.pca = FALSE,
weight.by.var = TRUE,
verbose = TRUE,
ndims.print = 1:5,
nfeatures.print = 30,
reduction.key = "PC_",
seed.use = 42,
...
)
# S3 method for Seurat
RunPCA(
object,
assay = NULL,
features = NULL,
npcs = 50,
rev.pca = FALSE,
weight.by.var = TRUE,
verbose = TRUE,
ndims.print = 1:5,
nfeatures.print = 30,
reduction.name = "pca",
reduction.key = "PC_",
seed.use = 42,
...
)
An object
Arguments passed to other methods and IRLBA
Name of Assay PCA is being run on
Total Number of PCs to compute and store (50 by default)
By default computes the PCA on the cell x gene matrix. Setting to true will compute it on gene x cell matrix.
Weight the cell embeddings by the variance of each PC (weights the gene loadings if rev.pca is TRUE)
Print the top genes associated with high/low loadings for the PCs
PCs to print genes for
Number of genes to print for each PC
dimensional reduction key, specifies the string before the number for the dimension names. PC by default
Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed.
Use truncated singular value decomposition to approximate PCA
Features to compute PCA on. If features=NULL, PCA will be run using the variable features for the Assay. Note that the features must be present in the scaled data. Any requested features that are not scaled or have 0 variance will be dropped, and the PCA will be run using the remaining features.
dimensional reduction name, pca by default
Returns Seurat object with the PCA calculation stored in the reductions slot