Skip to contents

Perform gene ontology analysis and visualization for DE genesets in one go.

Usage

get_go_emap_plot(
  x,
  org_db = org.Hs.eg.db::org.Hs.eg.db,
  universe = NULL,
  ont_type = "BP",
  p_adj_method = "BH",
  pval_cutoff = 0.05,
  qval_cutoff = 0.05,
  simplify = TRUE,
  min_geneset_size = 10,
  max_geneset_size = 500,
  go_similarity_cutoff = 0.8,
  show_n_terms = 30,
  color_terms_by = "p.adjust"
)

Arguments

x

an object of class 'parcutils' or 'parcutils_ir'.

org_db

an object of the class class OrgDB, default org.Hs.eg.db

universe

a character vector of genes, default NULL, to be used as background genes for GO enrichment analysis. Currently supports only ENSEMBL gene id - e.g. ENSMUSG00000030787. When set to NULL all genes from x will be used as background genes.

ont_type

a character string, default "BP", denoting ontology type. Values can be one of the "BP", "MF" , "CC"

p_adj_method

a character string, default "BH", denoting a method for p-adjustment. Values can be one of the "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"

pval_cutoff

a numeric, default 0.05 denoting p-value cutoff.

qval_cutoff

a numeric, default 0.05 denoting q-value cutoff.

min_geneset_size

a numeric, default 10, denoting minimal size of genes annotated by ontology term for testing.

max_geneset_size

a numeric, default 500, denoting maximal size of genes annotated by ontology term for testing.

go_similarity_cutoff

a numeric value, default 0.8, denoting gene ontology similarity cutoff.

show_n_terms

a numeric, default 30, denoting number of gene ontology terms to show in the plot.

color_terms_by

a character string, default "p.adjust", denoting a variable to color gene ontology terms.

Value

An EMAP plot.

Examples

if (FALSE) {
count_file <- system.file("extdata","toy_counts.txt" , package = "parcutils")
count_data <- readr::read_delim(count_file, delim = "\t", show_col_types = FALSE)

sample_info <- count_data %>% colnames() %>% .[-1]  %>%
  tibble::tibble(samples = . , groups = rep(c("control" ,"treatment1" , "treatment2"), each = 3) )


res <- parcutils::run_deseq_analysis(counts = count_data %>% dplyr::mutate(gene_id = stringr::str_replace(gene_id, ":.*","")),
                                     sample_info = sample_info,
                                     column_geneid = "gene_id" ,
                                     group_numerator = c("treatment1", "treatment2") ,
                                     group_denominator = c("control"))

go_out <- get_go_emap_plot(res)

# display plot
go_out$go_emap_plots

# display table
 go_out$go_enrichment_output %>% tibble::as_tibble()
}