韦恩图
2020-10-29 本文已影响0人
jiarf
软件1:http://bioinformatics.psb.ugent.be/webtools/Venn/
教程2:
https://mp.weixin.qq.com/s?__biz=MzI4ODE0NTE3OA==&mid=2649200879&idx=1&sn=4c3beaa405f56d05d0d91b9baa600a3f&chksm=f3d1d29ac4a65b8cb1d03817d0c1294c6eedfc152af71f560ff343f6ac54a2e1c94cc9ca8b30&token=110736215&lang=zh_CN#rd
使用R画韦恩图:
教程:https://www.jianshu.com/p/5fc46236ba2c
rm(list = ls())
setwd('/data/jiarf/test/venn')
#加载R包
library(VennDiagram)
##VennDiagram输入数据的格式是2~5个向量组成的list
#创建5个小学字母组成的随机向量
set.seed(727)
V1 <- sample(letters,size = 20)
V2 <- sample(letters,size = 20)
V3 <- sample(letters,size = 20)
V4 <- sample(letters,size = 20)
V5 <- sample(letters,size = 20)
#绘图
venn.diagram(x=list(GUO=V1,
FU=V2,
YA=V3,
SE=V4,
WANG=V5),
filename = 'test_venn.tiff')
image.png
venn.diagram(x=list(GUO=V1,
FU=V2,
YA=V3,
SE=V4,
WANG=V5),
fill=c('red','yellow','blue','grey','green'),#填充一下配色
margin = 0.05,#设置一下间距
filename = './test_venn2.tiff')
image.png
但是很神奇的是upsetplot绘制成功了
rm(list = ls())
#加载R包
library(UpSetR)
#载入movies数据集
movies <- read.csv( system.file("extdata", "movies.csv", package = "UpSetR"), header=TRUE, sep=";" )
#查看一下movie数据集
view(movies)
dim(movies)
#简单绘制UpSetplot
upset(movies, nsets = 7, #绘制的集合数目
mb.ratio = c(0.5, 0.5),#调整上下两部分的比例
order.by = c("freq"))#为按频率排序
image.png