Skip to contents

This function extracts enrichment terms for multiple conditions and database categories.

Usage

extractMultipleTerms(
  input,
  condition_col,
  categories,
  background = NULL,
  split_by_reg = FALSE,
  logFC_threshold = 0,
  pval_threshold = 0.05,
  n = 10,
  min_genes_threshold = 3
)

Arguments

input

A data frame containing gene data.

condition_col

A character vector of the column name(s) of the conditions to analyze.

categories

A character vector of database categories for enrichment analysis.

background

A background list of genes to use with enrichR. See enrichr documentation for details.

split_by_reg

Logical. If TRUE, splits genes by up- and down-regulation.

logFC_threshold

The threshold for determining up/down-regulation. Defaults to 0.

pval_threshold

Numeric; adjusted p-value cutoff. Default is 0.05.

n

Integer; number of top terms to return. Default is 10.

Value

A combined data frame of enrichment terms for all specified conditions and categories.

Examples

# Example usage
input <- data.frame(genes = c("Gene1", "Gene2", "Gene3"))
result <- extractMultipleTerms(
  input, 
  condition_col = c("Condition1", "Condition2"), 
  categories = c("GO_Biological_Process", "KEGG"), 
  top = TRUE
)
#> Error in extractMultipleTerms(input, condition_col = c("Condition1", "Condition2"),     categories = c("GO_Biological_Process", "KEGG"), top = TRUE): unused argument (top = TRUE)