Perform Gene-set Enrichment Analyses Using SuSiE
perform_gsea(
gene_signals,
gene_sets,
gene_set_info = NULL,
min_size = 10,
max_size = 400,
top_genes = 10,
L = 10,
coverage = 0.95,
max_iter = 100,
tol = 0.001,
verbose = TRUE
)
A matrix of signals in which rows correspond to genes and columns correspond to the different signals. If there is only one signal, this can be a vector.
A binary matrix (sparse or dense) of gene sets in which rows correspond to genes and columns correspond to gene sets. An entry of 1 means the gene is a member of the gene set.
Optional data frame containing additional information about the gene sets.
Gene sets with fewer genes than this will not be considered.
Gene sets with more genes than this will not be considered.
The number of “top genes” to include in the
The maximum number of selected gene sets; passed as the
“L” argument to susie
.
The “coverage” parameter in
susie
.
The “max_iter” parameter in
susie
.
The “tol” parameter in
susie
.
If verbose = TRUE
, print updates about
progress of the analysis.
A list containing (a) the SuSiE model fits (one for each signal); (b) a tibble containing the gene set enrichment results.
# Add an example here illustrating the use of perform_gsea().
library(Matrix)
library(pathways)
#>
#> Attaching package: ‘pathways’
#> The following object is masked from ‘package:singlecelljamboreeR’:
#>
#> perform_gsea
set.seed(1)
data(gene_sets_human)
i <- which(!is.na(gene_sets_human$gene_info$Ensembl))
y <- gene_sets_human$gene_sets[i,"M973"] + 0.1 * rnorm(length(i))
out <- singlecelljamboreeR::perform_gsea(y,gene_sets_human$gene_sets[i,])
#> Number of gene signals: 1
#> Number of gene sets: 28649
#> Number of genes: 34954
#> signal k1:
#> [1] "objective:30273.0903457171"
#> [1] "objective:30551.4920829527"
#> [1] "objective:30734.0400488999"
#> [1] "objective:30734.0428220968"
#> [1] "objective:30737.3019186511"
#> [1] "objective:30737.3020603809"
#> [1] "objective:30743.8271067539"
#> [1] "objective:30743.8274125568"
#> [1] "objective:30743.845098598"
#> [1] "objective:30743.8450986074"
#> [1] "objective:30743.8451031422"
#> Compiling the results.
out$selected_gene_sets
#> # A tibble: 1 × 8
#> signal CS gene_set lbf pip coef genes top_genes
#> <fct> <fct> <chr> <dbl> <dbl> <dbl> <dbl> <list>
#> 1 k1 L1 M973 3504. 1 1.01 70 <chr [10]>