Combines the results of multiple enrichment analyses, performed independently, in a single dotplot: the discoveries are displayed on the x-axis and the enriched genesets on the y-axis. The size of each dot reflects the enrichment (fold enrichment or gene ratio), its color the significance, and the number written inside the dot the count of proteins found in that geneset. The input enrichments can come from different sources (DEprot or clusterProfiler) and can be mixed.

combine.enrichments(
  enrichment.list,
  dotplot.n = 5,
  terms = NULL,
  padj.cutoff = 0.05,
  size.by = "FoldEnrichment",
  order.by = "discovery",
  show.non.significant = TRUE,
  show.numbers = TRUE,
  string.pattern.to.remove = NULL,
  size.range = c(5, 14),
  number.size = 2.7,
  max.term.length = 60,
  viridis.option = "rocket",
  title = "**Combined enrichments**"
)

Arguments

enrichment.list

Named list of enrichments. Each element can be an object of class DEprot.enrichResult (DEprot), DEprot.timecourse.enrichment (DEprot), enrichResult or gseaResult (clusterProfiler), or a data.frame with the same structure of the tables returned by clusterProfiler. The names of the list are used as labels of the x-axis and define their order. No default.

dotplot.n

Numeric value indicating the maximum number of genesets to keep for each discovery. The genesets displayed correspond to the union of these top hits. Default: 5.

terms

Character vector indicating specific geneset IDs to display. When provided, dotplot.n is ignored. Default: NULL.

padj.cutoff

Numeric value indicating the adjusted p-value threshold used to consider a geneset as significantly enriched. Default: 0.05.

size.by

String indicating the metric used for the size of the dots. One among: "FoldEnrichment", "GeneRatio". Default: "FoldEnrichment".

order.by

String indicating how the genesets are sorted on the y-axis. One among: "discovery" (by the discovery in which each geneset is the most significant, generating a diagonal pattern), "significance" (by the best adjusted p-value), "clustering" (hierarchical clustering of the enrichment values), "alphabetical". Default: "discovery".

show.non.significant

Logic value indicating whether the genesets that were tested but did not pass the padj.cutoff in a given discovery should be displayed as grey dots. Default: TRUE.

show.numbers

Logic value indicating whether the number of proteins should be written inside the dots. Default: TRUE.

string.pattern.to.remove

String with a regular expression of a pattern to be removed from the geneset names. Default: NULL (no changes).

size.range

Numeric vector of length 2 indicating the minimum and maximum size of the dots. Default: c(5, 14).

number.size

Numeric value indicating the font size of the numbers written inside the dots. Default: 2.7.

max.term.length

Numeric value indicating the maximal number of characters of the geneset names displayed on the y-axis (longer names are truncated). Default: 60.

viridis.option

String indicating the viridis palette used for the significance color scale. Default: "rocket".

title

String indicating the title of the plot, markdown formatting is supported. Default: "**Combined enrichments**".

Value

A list with two elements: results (data.frame combining the results of all the discoveries) and dotplot (ggplot object).

Author

Sebastian Gregoricchio

Examples

# Combine the ORA of two different contrasts
if (FALSE) { # \dontrun{
combined <- combine.enrichments(enrichment.list = list(`6h E2` = ora.6h,
                                                       `24h E2` = ora.24h),
                                dotplot.n = 5,
                                size.by = "FoldEnrichment")
combined$dotplot
} # }