
Generate UpSet Plot for Gene Set Intersections
Source:R/visualization.R
draw_upset_intersections.RdVisualizes intersections among multiple gene sets using the classic UpSetR package. Uses grid graphics capture to ensure plot generation in all environments.
Examples
gene_sets <- list(
Upregulated = c("A", "B", "C", "D"),
Downregulated = c("C", "D", "E", "F"),
Bound_by_TF = c("B", "D", "F", "G")
)
tf <- tempfile(fileext = ".pdf")
if (requireNamespace("UpSetR", quietly = TRUE)) {
draw_upset_intersections(
gene_lists = gene_sets,
project_name = "Transcriptional Regulation",
filename = tf
)
}
#> Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
#> ℹ Please use tidy evaluation idioms with `aes()`.
#> ℹ See also `vignette("ggplot2-in-packages")` for more information.
#> ℹ The deprecated feature was likely used in the UpSetR package.
#> Please report the issue to the authors.
#> Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
#> ℹ Please use the `linewidth` argument instead.
#> ℹ The deprecated feature was likely used in the UpSetR package.
#> Please report the issue to the authors.