View source: R/pcaEnrichment.R
pcaEnrichment | R Documentation |
This function allows to the user to examine the distribution of principal components run on the enrichment values.
pcaEnrichment(
input.data,
dimRed = NULL,
x.axis = "PC1",
y.axis = "PC2",
facet.by = NULL,
style = c("point", "hex"),
add.percent.contribution = TRUE,
display.factors = FALSE,
number.of.factors = 10,
palette = "inferno"
)
input.data |
Single‑cell object (Seurat / SCE) **or** the raw list returned by ['performPCA()']. |
dimRed |
Name of the dimensional‑reduction slot to pull from a single‑cell object. Ignored when 'input.data' is the list output. |
x.axis , y.axis |
Character vectors naming the PCs to display (e.g. "PC1"). |
facet.by |
Metadata column to facet plot. |
style |
"point" (default) or "hex". |
add.percent.contribution |
Include percent variance explained in axis labels. |
display.factors |
Draw arrows for the top gene‑set loadings. |
number.of.factors |
Integer; how many loadings to display if 'display.factors = TRUE'. |
palette |
Character. Any palette from #' @examples 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") pcaEnrichment(pbmc_small, x.axis = "PC1", y.axis = "PC2", dimRed = "escape.PCA") |
A **ggplot2** object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.