加载R包
library(VennDiagram)
数据
v1 <- c("DKK1", "NPC1", "NAPG", "ERG", "VHL", "BTD", "MALL", "HAUS1")
v2 <- c("SMAD4", "DKK1", "ASXL3", "ERG", "CKLF", "TIAM1", "VHL", "BTD", "EMP1", "MALL", "PAX3")
v3 <- c("PAX3", "SMAD4", "DKK1", "MALL", "ERG", "CDKN2A", "DENR", "NPC1", "NAPG")
vlist <- list(v1, v2, v3)
names(vlist) <- c("list1", "list2", "list3")
图1
venn.diagram(vlist[1:2],
filename="Venn_2way.png",
imagetype="png")
图2
venn.diagram(vlist,
filename="Venn_3way.png",
imagetype="png")
图3
venn.diagram(vlist,
filename="Venn_3way_more.png",
imagetype="png",
main="Venn diagram",
sub="3-way",
main.col="red",
fill=c("lightgreen", "lightblue", "lightsalmon"),
col=c("lightgreen", "lightblue", "lightsalmon"),
cat.col=c("green", "blue", "salmon"))
参考
- https://biocorecrg.github.io/CRG_RIntroduction/venn-diagram-function-from-venndiagram-package.html