Eulerr Plot

Authors

[Editor] Hu Zheng;

[Contributors]

Note

Hiplot website

This page is the tutorial for source code version of the Hiplot Eulerr Plot plugin. You can also use the Hiplot website to achieve no code ploting. For more information please see the following link:

https://hiplot.cn/basic/eulerr?lang=en

Setup

  • System Requirements: Cross-platform (Linux/MacOS/Windows)

  • Programming language: R

  • Dependent packages: eulerr; ggplotify

# Install packages
if (!requireNamespace("eulerr", quietly = TRUE)) {
  install.packages("eulerr")
}
if (!requireNamespace("ggplotify", quietly = TRUE)) {
  install.packages("ggplotify")
}

# Load packages
library(eulerr)
library(ggplotify)

Data Preparation

# Load data
data <- read.delim("files/Hiplot/051-eulerr-data.txt", header = T)

# convert data structure
genes <- as.numeric(data[, 2])
names(genes) <- as.character(data[, 1])
euler_set <- euler(genes)
  
# View data
head(data)
      Term Value
1       SE    13
2    Treat    28
3 Anti-CCP   101
4    DAS28    91
5 SE&Treat     1
6 SE&DAS28    14

Visualization

# Eulerr Plot
fill <- c("#3B4992FF","#EE0000FF","#008B45FF","#631879FF","#008280FF","#BB0021FF",
          "#5F559BFF","#A20056FF")
p <- as.ggplot(
  plot(euler_set,
    labels = list(col = rep("white", length(genes))),
    fills = list(fill = fill),
    quantities = list(type = c("percent", "counts"),
    col = rep("white", length(genes))),
    main = "Eulerr")
)

p
FigureΒ 1: Eulerr Plot