performPCA | R Documentation |
This function allows users to calculate the principal components
for the gene set enrichment values. For single-cell data, the PCA
will be stored with the dimensional reductions. If a matrix is used
as input, the output is a list for further plotting. Alternatively,
users can use functions for PCA calculations based on their desired
workflow in lieu of using performPCA
, but will not be
compatible with downstream pcaEnrichment
visualization.
performPCA(
input.data,
assay = NULL,
scale = TRUE,
n.dim = 1:10,
reduction.name = "escape.PCA",
reduction.key = "PCA"
)
input.data |
Enrichment output from |
assay |
Name of the assay to plot if data is a single-cell object. |
scale |
Standardize the enrichment value (TRUE) or not (FALSE) |
n.dim |
The number of components to calculate. |
reduction.name |
Name of the reduced dimensions object to add if data is a single-cell object. |
reduction.key |
Name of the key to use with the components. |
single-cell object or list with PCA components to plot.
GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"),
Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A"))
pbmc_small <- SeuratObject::pbmc_small
pbmc_small <- runEscape(pbmc_small,
gene.sets = GS,
min.size = NULL)
pbmc_small <- performPCA(pbmc_small,
assay = "escape")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.