See group_enrichment for examples. NOTE the box fill and the box text have different meanings.

show_group_enrichment(
  df_enrich,
  return_list = FALSE,
  scales = "free",
  add_text_annotation = TRUE,
  fill_by_p_value = TRUE,
  use_fdr = TRUE,
  cut_p_value = FALSE,
  cut_breaks = c(-Inf, -5, log10(0.05), -log10(0.05), 5, Inf),
  cut_labels = c("↓ 1e-5", "↓ 0.05", "non-significant", "↑ 0.05", "↑ 1e-5"),
  fill_scale = scale_fill_gradient2(low = "#08A76B", mid = "white", high = "red",
    midpoint = ifelse(fill_by_p_value, 0, 1)),
  cluster_row = FALSE,
  cluster_col = FALSE,
  ...
)

Arguments

df_enrich

result data.frame from group_enrichment.

return_list

if TRUE, return a list of ggplot object so user can combine multiple plots by other R packages like patchwork.

scales

Should scales be fixed ("fixed", the default), free ("free"), or free in one dimension ("free_x", "free_y")?

add_text_annotation

if TRUE, add text annotation in box. When show p value with filled color, the text indicates relative change; when show relative change with filled color, the text indicates p value.

fill_by_p_value

if TRUE, show log10 based p values with filled color. The +/- of p values indicates change direction. If p vlaues is mapped to fill, then text shows effect size, and vice versa.

use_fdr

if TRUE, show FDR values instead of raw p-values.

cut_p_value

if TRUE, cut p values into 5 regions for better visualization. Only works when fill_by_p_value = TRUE.

cut_breaks

when cut_p_value is TRUE, this option set the (log10 based) breaks.

cut_labels

when cut_p_value is TRUE, this option set the labels.

fill_scale

a Scale object generated by ggplot2 package to set color for continuous values.

cluster_row, cluster_col

if TRUE, cluster rows (or columns) with Hierarchical Clustering ('complete' method).

...

other parameters passing to ggplot2::facet_wrap, only used when return_list is FALSE.

Value

a (list of) ggplot object.