Performs gene ontology enrichment for individual cluster differential expression results.

perform.GO.enrichment(
  result,
  whichOnto = "BP",
  feasibleGenes = NULL,
  mapping = "org.Hs.eg.db",
  ID = "symbol",
  nodeSize = 5,
  algorithm = "classic",
  statistic = "ks",
  rank.cutoff = 0.001,
  gene.col = "gene",
  pval.col = "p_val",
  cluster.col = "cluster",
  n.top.pathways = 10
)

Arguments

result

A database containing the differential expression results

whichOnto

Character. specifying one of the three GO ontologies, namely: "BP", "MF", "CC". Default = 'BP'

feasibleGenes

Character vector. vector containing a subset of gene identifiers. Only these genes will be used to annotate GO terms. Default value is NULL which means that there are no genes filtered.

mapping

Character. The name of the Bioconductor package containing the gene mappings for a specific organism. For example: mapping = "org.Hs.eg.db".

ID

Character. Specify the gene identifier to use. Currently only the following identifiers can be used: c("entrez", "genbank", "alias", "ensembl", "symbol", "genename", "unigene")

nodeSize

Numerical. Minimum number of genes required to consider a GO term. Default = 5

algorithm

Character. Which algorithm to use when testing for significant GO terms, options: 'classic', 'elim', 'weight', 'weight01', 'lea', 'parentchild'. Default = 'classic'

statistic

Character. Which statistic to use when testing for significant GO terms, options: 'fisher', 'ks', 't', 'globaltest', 'sum', 'ks.ties'. Default = 'ks'

rank.cutoff

Numerical. Which cut off to apply for pathway significance, this value will change according to the statistic applied. Default = 0.001

gene.col

Character. Which column name within differential expression results contains the genes. Default = 'gene.col'

pval.col

Character. Which column name within differential expression results contains the p values. Default = 'p_val'

cluster.col

Character. Which column name within differential expression results contains the cluster assignments. Default = 'cluster'

n.top.pathways

Numerical. How many top pathways per group should be retained. Default = 10

Value

A dataframe containing the top enriched pathways for each cluster

Examples


SCT_DE <- perform.seurat.diffexp.all(object = object, assay = 'SCT', test = 'MAST', identity = object@sample_metadata$celltype, latent.vars = 'original.project')
#> Error in perform.seurat.diffexp.all(object = object, assay = "SCT", test = "MAST",     identity = object@sample_metadata$celltype, latent.vars = "original.project"): could not find function "perform.seurat.diffexp.all"

SCT_DE_GO <- perform.GO.enrichment(result = SCT_DE)
#> Error in is.data.frame(result): object 'SCT_DE' not found

plot.GO.output(result = SCT_DE_GO) + ggplot2::ggtitle(label = 'SCT')
#> Error in plot.GO.output(result = SCT_DE_GO): object 'SCT_DE_GO' not found