Generate violin plots for pathway analysis results
plotPathway(
inSCE,
resultName,
geneset,
groupBy = NULL,
boxplot = FALSE,
violin = TRUE,
dots = TRUE,
summary = "median",
axisSize = 10,
axisLabelSize = 10,
dotSize = 0.5,
transparency = 1,
defaultTheme = TRUE,
gridLine = FALSE,
title = geneset,
titleSize = NULL
)
Input SingleCellExperiment object. With
runGSVA()
or runVAM()
applied in advance.
A single character of the name of a score matrix, which
should be found in getPathwayResultNames(inSCE)
.
A single character specifying the geneset of interest. Should be found in the geneSetCollection used for performing the analysis.
Either a single character specifying a column of
colData(inSCE)
or a vector of equal length as the number of cells.
Default NULL
.
Boolean, Whether to add a boxplot. Default FALSE
.
Boolean, Whether to add a violin plot. Default TRUE
.
Boolean, If TRUE
, will plot dots for each violin plot.
Default TRUE
.
Adds a summary statistic, as well as a crossbar to the violin
plot. Options are "mean"
or "median"
, and NULL
for not
adding. Default "median"
.
Size of x/y-axis ticks. Default 10
.
Size of x/y-axis labels. Default 10
.
Size of dots. Default 0.5
.
Transparency of the dots, values will be 0-1. Default
1
.
Removes grid in plot and sets axis title size to
10
when TRUE
. Default TRUE
.
Adds a horizontal grid line if TRUE
. Will still be
drawn even if defaultTheme
is TRUE
. Default FALSE
.
Title of plot. Default using geneset
.
Size of the title of the plot. Default 15
.
A ggplot
object for the violin plot
runGSVA()
or runVAM()
should be applied in advance of
using this function. Users can group the data by specifying groupby
.
data("scExample", package = "singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
sce <- scaterlogNormCounts(sce, assayName = "logcounts")
gs1 <- rownames(sce)[seq(10)]
gs2 <- rownames(sce)[seq(11,20)]
gs <- list("geneset1" = gs1, "geneset2" = gs2)
sce <- importGeneSetsFromList(inSCE = sce, geneSetList = gs,
by = "rownames")
sce <- runVAM(inSCE = sce, geneSetCollectionName = "GeneSetCollection",
useAssay = "logcounts")
#> Tue Jun 28 22:05:15 2022 ... Running VAM
#> gene.weights not specified, defaulting all weights to 1
#> Computing VAM distances for 2 gene sets, 195 cells and 200 genes.
#> Min set size: 10, median size: 10
plotPathway(sce, "VAM_GeneSetCollection_CDF", "geneset1")