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
)

## Arguments

result_df a data frame that must contain the following columns: Term_DescriptionDescription of the enriched term Fold_EnrichmentFold enrichment value for the enriched term lowest_pthe lowest adjusted-p value of the given term over all iterations Up_regulatedthe up-regulated genes in the input involved in the given term's gene set, comma-separated Down_regulatedthe down-regulated genes in the input involved in the given term's gene set, comma-separated Cluster(OPTIONAL)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 top_terms, all terms are plotted. boolean value indicating whether or not to group the enriched terms by cluster (works if result_df contains a "Cluster" column). number of sizes displayed in the legend # genes (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 FALSE

## Value

a 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 result_df and plot_by_cluster == TRUE, the enriched terms are grouped by clusters.

## Examples

g <- enrichment_chart(RA_output)