Skip to contents

This function forms genesets basing on the differential expression result, and calls gene ontology (GO) analysis method provided by gprofiler2.

Usage

runGOEnrich(
  result,
  group = NULL,
  useBg = TRUE,
  orderBy = "padj",
  logFCThresh = 1,
  padjThresh = 0.05,
  splitReg = FALSE,
  ...
)

Arguments

result

Data frame of unfiltered output from runMarkerDEG or runPairwiseDEG.

group

Selection of one group available from result$group. Default NULL uses all groups involved in DE result table.

useBg

Logical, whether to set all genes involved in DE analysis (before threshold filtering) as a domain background of GO analysis. Default TRUE.

orderBy

Name of DE statistics metric to order the gene list for each group. Choose from "logFC" (default), "pval" or "padj". Or set NULL to turn off ranked mode.

logFCThresh

The log2FC threshold above which the genes will be used. Default 1.

padjThresh

The adjusted p-value threshold less than which the genes will be used. Default 0.05.

splitReg

Whether to have queries of both up-regulated and down-regulated genes for each group. Default FALSE only queries up-regulated genes and should be preferred when result comes from marker detection test. When result comes from group-to-group DE test, it is recommended to set splitReg = TRUE.

...

Additional arguments passed to gprofiler2::gost(). Arguments query, custom_bg, domain_scope, and ordered_query are pre-specified by this wrapper function. Users must set organism = "mmusculus" when working on mouse data.

Value

A list object where each element is a result list for a group. Each result list contains two elements:

result

data.frame of main GO analysis result.

meta

Meta information for the query.

See gprofiler2::gost(). for detailed explanation.

References

Kolberg, L. et al, 2020 and Raudvere, U. et al, 2019

Examples

res <- runMarkerDEG(pbmcPlot)
#>  Running Wilcoxon rank-sum test
#>  Running Wilcoxon rank-sum test ... done
#> 
# Setting `significant = FALSE` because it's hard for a gene list obtained
# from small test dataset to represent real-life biology.
# \donttest{
if (requireNamespace("gprofiler2", quietly = TRUE)) {
    go <- runGOEnrich(res, group = 0, significant = FALSE)
}
# }