# Install packages
if (!requireNamespace("eulerr", quietly = TRUE)) {
install.packages("eulerr")
}if (!requireNamespace("ggplotify", quietly = TRUE)) {
install.packages("ggplotify")
}
# Load packages
library(eulerr)
library(ggplotify)
Eulerr Plot
Setup
System Requirements: Cross-platform (Linux/MacOS/Windows)
Programming language: R
Dependent packages:
eulerr
;ggplotify
Data Preparation
# Load data
<- read.delim("files/Hiplot/051-eulerr-data.txt", header = T)
data
# convert data structure
<- as.numeric(data[, 2])
genes names(genes) <- as.character(data[, 1])
<- euler(genes)
euler_set
# 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
<- c("#3B4992FF","#EE0000FF","#008B45FF","#631879FF","#008280FF","#BB0021FF",
fill "#5F559BFF","#A20056FF")
<- as.ggplot(
p 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
