This function is used to create a ggplot2 bubble chart displaying the enrichment results.
enrichment_chart( result_df, top_terms = 10, plot_by_cluster = FALSE, num_bubbles = 4, even_breaks = TRUE )
a data frame that must contain the following columns:
Description of the enriched term
Fold enrichment value for the enriched term
the lowest adjusted-p value of the given term over all iterations
the up-regulated genes in the input involved in the given term's gene set, comma-separated
the down-regulated genes in the input involved in the given term's gene set, comma-separated
the cluster to which the enriched term is assigned
number of top terms (according to the 'lowest_p' column)
to plot (default = 10). If
plot_by_cluster = TRUE, selects the top
top_terms terms per each cluster. Set
top_terms = NULL to plot
for all terms.If the total number of terms is less than
all terms are plotted.
boolean value indicating whether or not to group the
enriched terms by cluster (works if
result_df contains a
number of sizes displayed in the legend
(Default = 4)
whether or not to set even breaks for the number of sizes
displayed in the legend
# genes. If
TRUE (default), sets
equal breaks and the number of displayed bubbles may be different than the
number set by
num_bubbles. If the exact number set by
num_bubbles is required, set this argument to
ggplot2 object containing the bubble chart.
The x-axis corresponds to fold enrichment values while the y-axis indicates
the enriched terms. Size of the bubble indicates the number of significant
genes in the given enriched term. Color indicates the -log10(lowest-p) value.
The closer the color is to red, the more significant the enrichment is.
Optionally, if 'Cluster' is a column of
plot_by_cluster == TRUE, the enriched terms are grouped by clusters.
g <- enrichment_chart(example_pathfindR_output) #> Plotting the enrichment bubble chart