Skip to contents

This function generates a plot for enrichment analysis of Canopus-predicted terms across all levels, showing fold enrichment, p-value, and subset count for each term level.

Usage

CanopusAllLevelEnrichmentPlot(
  mmo = mmo,
  comp.list,
  terms = "all_terms",
  term_levels = NULL,
  pthr = 0.1,
  representation = "greater",
  prefix = "enrichment",
  height = 10,
  width = 8
)

Arguments

mmo

The mmo object with sirius annotation and normalized data

comp.list

A list to analyze, where each element is a vector of feature names

terms

The terms to analyze. Options are 'all_terms', 'NPC', 'ClassyFire', or 'custom' (default: 'all_terms')

term_levels

list of custom term levels to use

pthr

The threshold for adjusted p-value to be considered significant (default: 0.1)

representation

The representation type for enrichment analysis. Options are 'greater' for overrepresentation (default: 'greater')

prefix

The prefix for output files (default: 'enrichment')

height

The height of the output plot in inches (default: 10)

width

The width of the output plot in inches (default: 8)

Examples

if (FALSE) {
comp.list <- list(
  comparison1 = DAMs_up$control_vs_treatment1.up,
  comparison2 = DAMs_up$control_vs_treatment2.up
)
CanopusAllLevelEnrichmentPlot(
 mmo, comp.list = comp.list, terms = 'all_terms', 
 pthr = 0.1, representation = 'greater', prefix = 'enrichment_all_levels', 
 height = 10, width = 8
)
CanopusAllLevelEnrichmentPlot(
 mmo, comp.list = comp.list, terms = 'NPC', 
 pthr = 0.1, representation = 'greater', prefix = 'enrichment_NPC_levels', 
 height = 10, width = 8
)
CanopusAllLevelEnrichmentPlot(
 mmo, comp.list = comp.list, terms = 'ClassyFire', 
 pthr = 0.1, representation = 'greater', prefix = 'enrichment_ClassyFire_levels', 
 height = 10, width = 8
)
}