plotVenn: Venn plot for groups of genes

View source: R/plotVenn.R

plotVennR Documentation

Venn plot for groups of genes

Description

If gene group over 4, plot will be visulized using UpSet plot.

Usage

plotVenn(
  venn_list,
  use_venn = TRUE,
  color = NULL,
  alpha_degree = 0.3,
  venn_percent = FALSE,
  ...
)

Arguments

venn_list

A list of gene id.

use_venn

Logical, use venn to plot, default is 'TRUE', the other option is upsetplot for large list.

color

Colors for gene lists, default is NULL.

alpha_degree

Alpha transparency of each circle's area, default is 0.3.

venn_percent

Logical to show both number and percentage in venn plot.

...

other arguments transfer to 'plot_theme' function

Value

A ggplot object

Examples

k1 = requireNamespace("ComplexUpset",quietly = TRUE)
k2 = requireNamespace("futile.logger",quietly = TRUE)
k3 = requireNamespace("ggsci",quietly = TRUE)
k4 = requireNamespace("RColorBrewer",quietly = TRUE)
if(k1&k2&k3&k4){
library(ggplot2)
set1 <- paste0(rep("gene", 30), sample(1:1000, 30))
set2 <- paste0(rep("gene", 40), sample(1:1000, 40))
set3 <- paste0(rep("gene", 50), sample(1:1000, 50))
set4 <- paste0(rep("gene", 60), sample(1:1000, 60))
set5 <- paste0(rep("gene", 70), sample(1:1000, 70))
sm_gene_list <- list(gset1 = set1, gset2 = set2, gset3 = set3)
la_gene_list <- list(
  gset1 = set1, gset2 = set2, gset3 = set3,
  gset4 = set4, gset5 = set5
)
plotVenn(sm_gene_list,
  use_venn = TRUE,
  alpha_degree = 0.5,
  main_text_size = 3,
  border_thick = 0,
  venn_percent = TRUE
)
plotVenn(la_gene_list,
  use_venn = FALSE,
  main_text_size = 15,
  legend_text_size = 8,
  legend_position = 'left'
)
}


genekitr documentation built on Sept. 11, 2024, 9:10 p.m.