| Title: | Tools for benchmarking single-cell gene set analysis methods |
|---|---|
| Description: | GSABenchmark is a package designed for benchmarking scRNA-seq gene set analysis (scGSA) methods. It provides both traditional and novel benchmark metrics, as well as visualization tools. Currently, GSABenchmark supports 17 scGSA methods. |
| Authors: | Andrei-Florian Stoica [aut, cre] (ORCID: <https://orcid.org/0000-0002-5253-0826>) |
| Maintainer: | Andrei-Florian Stoica <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.0 |
| Built: | 2026-05-30 09:18:05 UTC |
| Source: | https://github.com/bioc/GSABenchmark |
This function creates an aggregate rank plot from a summary object.
aggregateRankPlot( smr, title = NULL, xLab = "Method", sigDigits = 2, rankMethod = c("min", "average", "first", "last", "random", "max"), ... )aggregateRankPlot( smr, title = NULL, xLab = "Method", sigDigits = 2, rankMethod = c("min", "average", "first", "last", "random", "max"), ... )
smr |
Complete summary list generated with |
title |
Plot title. |
xLab |
x axis label. |
sigDigits |
Number of significant digits used when displaying mean
ranks. If |
rankMethod |
Rank method. Choose between 'min', 'average', 'first', 'last', 'random' and 'max'. Default in 'min'. |
... |
Additional parameters passed to other functions. |
A ggplot object.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) p <- aggregateRankPlot(smr)sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) p <- aggregateRankPlot(smr)
This function plots the complete list of benchmark summaries.
allBenchmarkPlots(smr, titleSuffix = NULL, ...)allBenchmarkPlots(smr, titleSuffix = NULL, ...)
smr |
Complete summary list generated with |
titleSuffix |
Suffix used to create plot titles If |
... |
Additional parameters passed to other functions. |
A list of ggplot objects.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- allBenchmarkPlots(smr)sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- allBenchmarkPlots(smr)
normSilDF, dimMat and maxDist.Generate all benchmark results with some precomputed arguments.
This function generates all benchmark results by using precomputed values
for normSilDF, dimMat and maxDist.
allBenchmarkResults( scObj, labelCol, geneSets, gsaMethods, checkLabels = TRUE, normSilDF = NULL, dimMat = NULL, maxDist = NULL, efBenchmark = NULL, runEFBenchmark = TRUE, verbose = TRUE )allBenchmarkResults( scObj, labelCol, geneSets, gsaMethods, checkLabels = TRUE, normSilDF = NULL, dimMat = NULL, maxDist = NULL, efBenchmark = NULL, runEFBenchmark = TRUE, verbose = TRUE )
scObj |
A |
labelCol |
The metadata column containing the ground truth annotation. |
geneSets |
A list of gene sets. If not |
gsaMethods |
Character vector of gene set analysis methods. |
checkLabels |
Whether to check that |
normSilDF |
Data frame of normalized silhouettes. |
dimMat |
UMAP dimensionality reduction matrix of the single-cell
expression object. Unused if |
maxDist |
Maximum UMAP distance in the single-cell expression object.
Unused if |
efBenchmark |
A list of data frames generated with efficiencyBenchmark. |
runEFBenchmark |
Whether to run efficiency benchmark. |
verbose |
Whether the output of the efficiency benchmark should be
verbose. Ignored if |
This function is designed to save some computational time when
multiple runs are sequentially performed for the same single-cell expression
object and cell identity classes, but different choices of gene sets
(so long as they still describe the same classes) or methods. If a single
run is planned rather than multiple ones, runBenchmark is a more
straightforward choice, as it takes care of generating
normSilDF and dimMat.
A list of benchmark results.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- hammers::computeSilhouette(scObj, 'label') normSilDF <- hammers::normalizeSilhouette(scObj, 'label') dimMat <- scLang::scPCAMat(scObj) maxDist <- max(dist(dimMat)) smr <- allBenchmarkResults(scObj, 'label', geneSets, c('CSOA', 'Zscore'), TRUE, normSilDF, dimMat, maxDist, runEFBenchmark=FALSE)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- hammers::computeSilhouette(scObj, 'label') normSilDF <- hammers::normalizeSilhouette(scObj, 'label') dimMat <- scLang::scPCAMat(scObj) maxDist <- max(dist(dimMat)) smr <- allBenchmarkResults(scObj, 'label', geneSets, c('CSOA', 'Zscore'), TRUE, normSilDF, dimMat, maxDist, runEFBenchmark=FALSE)
This function plots a list of summary data frames with methods as rows, gene sets and the average of scores across all gene sets as columns.
benchmarkPlots(smr, titleSuffix = NULL, lastPlotLegendLab = "Metric", ...)benchmarkPlots(smr, titleSuffix = NULL, lastPlotLegendLab = "Metric", ...)
smr |
List of summary data frames, whether boundary, MCC or global. |
titleSuffix |
Suffix used to create plot titles If |
lastPlotLegendLab |
The legend label of the last plot. |
... |
Additional arguments passed to |
A list of ggplot objects.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- benchmarkPlots(smr[[1]])sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- benchmarkPlots(smr[[1]])
This function creates correlation plots for method results.
corrPlots( scObj, smr, titlePrefix = "Correlation plot", titleInfixes = NULL, titleSuffix = NULL, ... )corrPlots( scObj, smr, titlePrefix = "Correlation plot", titleInfixes = NULL, titleSuffix = NULL, ... )
scObj |
A |
smr |
Complete summary list generated with |
titlePrefix |
Prefix used to create a title with |
titleInfixes |
A character vector of title infixes used to create a
title with |
titleSuffix |
Suffix used to create plot titles If |
... |
Additional arguments passed to |
A named list of ggplot objects.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- corrPlots(scObj, smr)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- corrPlots(scObj, smr)
This function calculates the correlation matrix for all the methods for an identity class.
corrSummary(scObj, smr, corMethod = "spearman")corrSummary(scObj, smr, corMethod = "spearman")
scObj |
A |
smr |
List containing boundary, MCC and global lists of data frames. |
corMethod |
Correlation method. |
A list of correlation matrices.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) m <- corrSummary(scObj, smr)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) m <- corrSummary(scObj, smr)
This function extracts running times and peak memory usage for gene set analysis methods.
efficiencyBenchmark( scObj, labelCol, geneSets, gsaMethods, checkLabels = TRUE, verbose = TRUE )efficiencyBenchmark( scObj, labelCol, geneSets, gsaMethods, checkLabels = TRUE, verbose = TRUE )
scObj |
A |
labelCol |
The metadata column containing the ground truth annotation. |
geneSets |
A list of gene sets. If not |
gsaMethods |
Character vector of gene set analysis methods. |
checkLabels |
Whether to check that |
verbose |
Whether output should be verbose. |
A list of two data frames, the first comprising running times in seconds, the second comprising peak memory usage in mebibytes.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) ef <- efficiencyBenchmark(scObj, 'label', geneSets[1], 'CSOA', verbose=FALSE)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) ef <- efficiencyBenchmark(scObj, 'label', geneSets[1], 'CSOA', verbose=FALSE)
This function creates gene set rank plots for method results.
geneSetRankPlots( smr, rankMethod = "min", titlePrefix = "Distribution of ranks", titleInfixes = NULL, titleSuffix = NULL, xLab = "Method", ... )geneSetRankPlots( smr, rankMethod = "min", titlePrefix = "Distribution of ranks", titleInfixes = NULL, titleSuffix = NULL, xLab = "Method", ... )
smr |
Complete summary list generated with |
rankMethod |
Rank method. Choose between 'min', 'average', 'first', 'last', 'random' and 'max'. Default in 'min'. |
titlePrefix |
Prefix used to create a title with |
titleInfixes |
A character vector of title infixes used to create a
title with |
titleSuffix |
Suffix used to create plot titles If |
xLab |
x axis label. |
... |
Additional arguments passed to |
A named list of ggplot objects.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- geneSetRankPlots(smr)sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- geneSetRankPlots(smr)
This function creates MDS plots for method results.
mdsPlots( scObj, smr, titlePrefix = "MDS plot", titleInfixes = NULL, titleSuffix = NULL, drawScores = TRUE, ... )mdsPlots( scObj, smr, titlePrefix = "MDS plot", titleInfixes = NULL, titleSuffix = NULL, drawScores = TRUE, ... )
scObj |
A |
smr |
Complete summary list generated with |
titlePrefix |
Prefix used to create a title with |
titleInfixes |
A character vector of title infixes used to create a
title with |
titleSuffix |
Suffix used to create plot titles If |
drawScores |
Whether to render scores on the plot. If set to
|
... |
Additional arguments passed to |
A named list of ggplot objects.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- mdsPlots(scObj, smr)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- mdsPlots(scObj, smr)
Plot a data frame consisting of gene set analysis method peak memory usage This function plots data frame consisting of method peak memory usages with methods as rows, gene sets and the gene set average as columns.
memoryPlot(efBenchmark, title = NULL, xLab = "Peak memory usage (MiB)", ...)memoryPlot(efBenchmark, title = NULL, xLab = "Peak memory usage (MiB)", ...)
efBenchmark |
A list of dataframes generated
with |
title |
Plot title. |
xLab |
x axis label. |
... |
Additional parameters to be passed to |
A ggplot object.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) memoryPlot(smr[[5]])sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) memoryPlot(smr[[5]])
This function creates metric rank plots for method results.
metricRankPlots( smr, titlePrefix = "Distribution of ranks", titleInfixes = metricNames(), titleSuffix = NULL, rankMethod = "min", xLab = "Method", ... )metricRankPlots( smr, titlePrefix = "Distribution of ranks", titleInfixes = metricNames(), titleSuffix = NULL, rankMethod = "min", xLab = "Method", ... )
smr |
Complete summary list generated with |
titlePrefix |
Prefix used to create a title with |
titleInfixes |
A character vector of title infixes used to create a
title with |
titleSuffix |
Suffix used to create plot titles If |
rankMethod |
Rank method. Choose between 'min', 'average', 'first', 'last', 'random' and 'max'. Default in 'min'. |
xLab |
x axis label. |
... |
Additional arguments passed to |
A named list of ggplot objects.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- metricRankPlots(smr)sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- metricRankPlots(smr)
This function creates Jaccard tile plots for method binary predictions.
predJaccardPlots( predictionsSmr, titlePrefix = "Binary prediction Jaccard plot", titleInfixes = NULL, titleSuffix = NULL, ... )predJaccardPlots( predictionsSmr, titlePrefix = "Binary prediction Jaccard plot", titleInfixes = NULL, titleSuffix = NULL, ... )
predictionsSmr |
Binary predictions summary. |
titlePrefix |
Prefix used to create a title with |
titleInfixes |
A character vector of title infixes used to create a
title with |
titleSuffix |
Suffix used to create plot titles If |
... |
Additional arguments passed to |
A named list of ggplot objects.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- predJaccardPlots(smr$predictions)sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) plots <- predJaccardPlots(smr$predictions)
This function creates a ratio rank plot for the method results.
ratioPlot( smr, title = NULL, nItems = 25, xLab = "Maximum over mean ratio", yLab = "Metric", legendLab = "Method", ... )ratioPlot( smr, title = NULL, nItems = 25, xLab = "Maximum over mean ratio", yLab = "Metric", legendLab = "Method", ... )
smr |
Complete summary list generated with |
title |
Plot title. |
nItems |
Number of retained iterms. |
xLab |
x axis label. |
yLab |
y axis label. |
legendLab |
Legend label. |
... |
Additional arguments passed to |
A ggplot object.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) p <- ratioPlot(smr)sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) p <- ratioPlot(smr)
This function runs AddModuleScore.
runAddModuleScore( scObj, geneSets, slot = "data", pool = rownames(scObj), nbin = 24, ctrl = 100, seed = 1 )runAddModuleScore( scObj, geneSets, slot = "data", pool = rownames(scObj), nbin = 24, ctrl = 100, seed = 1 )
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
pool |
The set from which features to be compared with signature genes are selected. Defaults to all features. |
nbin |
Number of bins of aggregate expression levels for pool features. |
ctrl |
Number of control features chosen from the same bin for each feature. |
seed |
Random seed. |
Reimplemented from https://github.com/satijalab.
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runAddModuleScore(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runAddModuleScore(scObj, geneSets)
This function runs AUCell using escape.
runAUCell(scObj, geneSets, slot = "data", ...)runAUCell(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
if (requireNamespace("AUCell", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runAUCell(scObj, geneSets) }if (requireNamespace("AUCell", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runAUCell(scObj, geneSets) }
GSABenchmark pipeline.Generate all benchmark results
This function performs the entire GSABenchmark pipeline.
runBenchmark( scObj, labelCol, geneSets, gsaMethods, runEFBenchmark = TRUE, verbose = TRUE )runBenchmark( scObj, labelCol, geneSets, gsaMethods, runEFBenchmark = TRUE, verbose = TRUE )
scObj |
A |
labelCol |
The metadata column containing the ground truth annotation. |
geneSets |
A list of gene sets. If not |
gsaMethods |
Character vector of gene set analysis methods. |
runEFBenchmark |
Whether to run efficiency benchmark. |
verbose |
Whether the output of the efficiency benchmark should be
verbose. Ignored if |
A wrapper around allBenchmarkResults. Slower for repeated
runs, but it does not require users to manually generate normSilDF
and dimMat.
A list of benchmark results.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) smr <- runBenchmark(scObj, 'label', geneSets, c('CSOA', 'Zscore'), FALSE)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) smr <- runBenchmark(scObj, 'label', geneSets, c('CSOA', 'Zscore'), FALSE)
Generate all benchmark results for shuffled gene sets This function generates all benchmark results for shuffled gene sets.
runBenchmarkShuffle( scObj, labelCol, geneSets, gsaMethod, runEFBenchmark = TRUE )runBenchmarkShuffle( scObj, labelCol, geneSets, gsaMethod, runEFBenchmark = TRUE )
scObj |
A |
labelCol |
The metadata column containing the ground truth annotation. |
geneSets |
A list of gene sets. If not |
gsaMethod |
Name of the gene set analysis method. |
runEFBenchmark |
Whether to run efficiency benchmark. |
A list of benchmark results.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMethodShuffle(scObj, 'label', geneSets, 'CSOA', 0.2, 0.2) smr <- runBenchmarkShuffle(scObj, 'label', geneSets, 'CSOA', FALSE)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMethodShuffle(scObj, 'label', geneSets, 'CSOA', 0.2, 0.2) smr <- runBenchmarkShuffle(scObj, 'label', geneSets, 'CSOA', FALSE)
This function runs the gene set analysis methods.
runGSAMethods( scObj, labelCol, geneSets, gsaMethods, infix = NULL, outputFun = silently_run )runGSAMethods( scObj, labelCol, geneSets, gsaMethods, infix = NULL, outputFun = silently_run )
scObj |
A |
labelCol |
The metadata column containing the ground truth annotation. |
geneSets |
A named list of gene sets. |
gsaMethods |
Character vector of gene set analysis methods. |
infix |
Infix to add between method name and gene set name in single-cell expression object. The string consisting of the method name and the infix is separated by the gene set name with a '_' character. |
outputFun |
Choose between silently_run (suppress all warnings and messages) or identity (do not suppress them). Default is silently_run. |
A Seurat or SingleCellExpression object
with the results of the runs stored as metadata columns.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runGSAMethods(scObj, 'label', geneSets, c('CSOA', 'Zscore'))scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runGSAMethods(scObj, 'label', geneSets, c('CSOA', 'Zscore'))
This function runs GSVA using GSVA.
runGSVA(scObj, geneSets, slot = "data", ...)runGSVA(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runGSVA(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runGSVA(scObj, geneSets)
This function runs JASMINE.
runJASMINE( scObj, geneSets, slot = "data", method = c("oddsratio", "likelihood") )runJASMINE( scObj, geneSets, slot = "data", method = c("oddsratio", "likelihood") )
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
method |
One of 'oddsratio' and 'likelihood'. |
Reimplemented from https://github.com/NNoureen/JASMINE.
The method's paper can be found at
https://doi.org/10.7554/eLife.71994.
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runJASMINE(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runJASMINE(scObj, geneSets)
This function runs MDT using decoupleR.
runMDT(scObj, geneSets, slot = "data", ...)runMDT(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
if (requireNamespace("ranger", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMDT(scObj, geneSets) }if (requireNamespace("ranger", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMDT(scObj, geneSets) }
This function runs a gene set analysis method on shuffled gene sets.
runMethodShuffle( scObj, labelCol, geneSets, gsaMethod, loss = c(0, 0.2), noise = c(0, 0.2), doGrid = TRUE, averageReplicates = TRUE, seeds = c(1, 2, 3), outputFun = identity )runMethodShuffle( scObj, labelCol, geneSets, gsaMethod, loss = c(0, 0.2), noise = c(0, 0.2), doGrid = TRUE, averageReplicates = TRUE, seeds = c(1, 2, 3), outputFun = identity )
scObj |
A |
labelCol |
The metadata column containing the ground truth annotation. |
geneSets |
A named list of gene sets. |
gsaMethod |
Name of the gene set analysis method. |
loss |
A numeric vector of gene loss values. Must be in [0, 1). |
noise |
A numeric vector of noise values. Must be in [0, 1). |
doGrid |
Whether to run the methods for each loss-noise combination. |
averageReplicates |
Whether to average replicates. If |
seeds |
A numeric vector of random seeds passed
to |
outputFun |
Choose between silently_run (suppress all warnings and messages) or identity (do not suppress them). Default is silently_run. |
A Seurat or SingleCellExpression object
with the results of the runs stored as metadata columns.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMethodShuffle(scObj, 'label', geneSets, 'CSOA', 0.2, 0.2)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMethodShuffle(scObj, 'label', geneSets, 'CSOA', 0.2, 0.2)
This function runs MLM using decoupleR.
runMLM(scObj, geneSets, slot = "data", ...)runMLM(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMLM(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runMLM(scObj, geneSets)
This function runs ORA using decoupleR.
runORA(scObj, geneSets, slot = "data", ...)runORA(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runORA(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runORA(scObj, geneSets)
This function runs pagoda2.
runPagoda2(scObj, geneSets, slot = "data", ...)runPagoda2(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional arguments passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runPagoda2(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runPagoda2(scObj, geneSets)
This function runs PLAGE using GSVA.
runPLAGE(scObj, geneSets, slot = "data", ...)runPLAGE(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runPLAGE(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runPLAGE(scObj, geneSets)
This function runs Singscore.
runSingscore(scObj, geneSets, slot = "data", ...)runSingscore(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional arguments passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runSingscore(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runSingscore(scObj, geneSets)
This function runs SiPSiC.
runSiPSiC(scObj, geneSets, slot = "counts", ...)runSiPSiC(scObj, geneSets, slot = "counts", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional arguments passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runSiPSiC(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runSiPSiC(scObj, geneSets)
This function runs ssGSEA using escape.
runssGSEA(scObj, geneSets, slot = "data", ...)runssGSEA(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runssGSEA(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runssGSEA(scObj, geneSets)
This function runs UCell using escape.
runUCell(scObj, geneSets, slot = "data", ...)runUCell(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
if (requireNamespace("UCell", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runUCell(scObj, geneSets) }if (requireNamespace("UCell", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runUCell(scObj, geneSets) }
This function runs UDT using decoupleR.
runUDT(scObj, geneSets, slot = "data", ...)runUDT(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
if (requireNamespace("rpart", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runUDT(scObj, geneSets) }if (requireNamespace("rpart", quietly=TRUE)){ scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runUDT(scObj, geneSets) }
This function runs VAM.
runVAM(scObj, geneSets, slot = "data", ...)runVAM(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional arguments passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runVAM(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runVAM(scObj, geneSets)
This function runs Zscore using GSVA.
runZscore(scObj, geneSets, slot = "data", ...)runZscore(scObj, geneSets, slot = "data", ...)
scObj |
A |
geneSets |
A named list of gene sets. |
slot |
Gene expression slot. |
... |
Additional parameters passed to |
A single-cell expression object with the results saved as a metadata column.
scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runZscore(scObj, geneSets)scoPath <- system.file('extdata', 'scObj.qs2', package='GSABenchmark') scObj <- qs2::qs_read(scoPath) gsPath <- system.file('extdata', 'geneSets.qs2', package='GSABenchmark') geneSets <- qs2::qs_read(gsPath) scObj <- runZscore(scObj, geneSets)
Plot a data frame consisting of gene set analysis method scores This function plots a data frame consisting of method scores with methods as rows, gene sets and the gene set average as columns.
scorePlot( scoreDF, title = NULL, xLab = "Score", yLab = "Method", isDecreasing = FALSE, palette = "grDevices::Plasma", legendLab = "Gene set", pointSize = 1.5 )scorePlot( scoreDF, title = NULL, xLab = "Score", yLab = "Method", isDecreasing = FALSE, palette = "grDevices::Plasma", legendLab = "Gene set", pointSize = 1.5 )
scoreDF |
A summary data frame. |
title |
Plot title. |
xLab |
x axis label. |
yLab |
y axis label. |
isDecreasing |
Logical; whether the methods should be displayed on the
plot in decreasing order of the obtained average scores. If |
palette |
Color palette. |
legendLab |
Legend label. |
pointSize |
Point size. |
A ggplot object.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) scorePlot(smr[[1]][[1]])sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) scorePlot(smr[[1]][[1]])
This function shows the methods currently supported by GSABenchmark.
supportedMethods()supportedMethods()
A character vector of supported methods.
supportedMethods()supportedMethods()
Plot a data frame consisting of gene set analysis method running times This function plots data frame consisting of method running times with methods as rows, gene sets and the gene set average as columns.
timePlot(efBenchmark, title = NULL, xLab = "Running time (s)", ...)timePlot(efBenchmark, title = NULL, xLab = "Running time (s)", ...)
efBenchmark |
A list of dataframes generated
with |
title |
Plot title. |
xLab |
x axis label. |
... |
Additional parameters to be passed to |
A ggplot object.
sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) timePlot(smr[[5]])sPath <- system.file('extdata', 'smr.qs2', package='GSABenchmark') smr <- qs2::qs_read(sPath) timePlot(smr[[5]])