Computes gene set enrichment based on the results of runDEA(). See details for more.

runGSEA(
  object,
  across,
  methods_de = "wilcox",
  max_adj_pval = 0.05,
  min_lfc = 0,
  n_highest_lfc = NULL,
  n_lowest_pval = NULL,
  signatures = NULL,
  test = c("hypergeometric", "kstest"),
  absolute = FALSE,
  background = 20000,
  power = 1,
  pval = 0.05,
  fdr = 0.05,
  reduce = TRUE,
  quiet = TRUE,
  chr_to_fct = TRUE,
  assay_name = activeAssay(object),
  verbose = NULL,
  ...
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

across

Character vector. All grouping variables of interest.

methods_de

Character vector. All differential expression methods of interest.

max_adj_pval

Numeric value. Sets the threshold for adjusted p-values. All genes with adjusted p-values above that threshold are ignored.

min_lfc

Numeric value. Sets the threshold for average log fold change. All genes with an average log fold change below that threshold are ignored.

n_highest_lfc

Numeric value. Affects the total number of genes that are kept. See details.

n_lowest_pval

Numeric value. Affects the total number of genes that are kept. See details.

signatures

Character vector of signature names that are taken from the assays stored signatures. Defaults to all signatures of the currently active assay.

test

Choose an enrichment type e.g. c("hypergeometric", "kstest")

absolute

Takes max-min score rather than the max deviation from null (kstest only)

background

Size or character vector of background population genes

power

Exponent for weights (kstest only)

pval

Filter results to be less than pval cutoff

fdr

Filter results to be less than fdr cutoff

reduce

Logical value. If set to TRUE (the default) the return value of hypeR::hypeR() is reduced to what is necessary for SPATA2s function to work. If FALSE, the complete objects are stored. This will grow the SPATA2 object's size quickly!

quiet

Use true to suppress logs and warnings

assay_name

Only relevant if the SPATA2 object contains more than one assay: Denotes the assay of interest and thus the molecular modality to use. Defaults to the active assay as set by activateAssay().

verbose

Logical. If TRUE, informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

...

Additional arguments given to Seurat::FindAllMarkers()

gene_set_list

A named list of character vectors. Names of slots correspond to the gene set names. The slot contains the genes of the gene sets.Holds priority over gene_set_names.

Value

The updated input object, containing the added, removed or computed results.

Details

Computes gene set enrichment analysis using hypeR::hypeR(). It does so by iterating about all possible combinations of across and methods_de. Combinations for which no DE-results are found are silently skipped.

Examples

library(SPATA2)

data("example_data")

object <- example_data$object_UKF269T_diet

# requires the results of runDEA(object, across = "histology")!
object <- runDEA(object, across = "histology")

object <- runGSEA(object, across = "histology")

plotGseaDotplot(object, across = "histology", )