UpSetR包绘制多维的venn图

UpSetR包绘制多维的venn图

R 语言中的维恩图绘制有很多包,Vennerable(最多9维),VennDigram(最多5维),venn(最多7维),而UpSetR绘制的维恩图则更多,只是表现形式和其他图不太一样。示例代码不一样:

#devtools::install_github("hms-dbmi/UpSetR")
library(UpSetR)

A <-sample(1:1000, 400, replace = FALSE);
B <-sample(1:1000, 600, replace = FALSE);
C <-sample(1:1000, 350, replace = FALSE);
D <-sample(1:1000, 550, replace = FALSE);
E <-sample(1:1000, 375, replace = FALSE);
G <-sample(1:1000, 200, replace = FALSE);
H <-sample(1:1000, 777, replace = FALSE);

dataForUpSetPlot <-list(A=A, B=B, C=C, D=D, E=E, G=G, H=H)
setsBarColors <-c('#EA4335', '#FBBC05', '#34A853', '#4285F4')

### sort by degree
upset(fromList(dataForUpSetPlot),
      nsets=length(dataForUpSetPlot),
      nintersects = 1000,
      sets = c("A", "B", "C", 'D'),
      #keep.order = TRUE,
      point.size = 3,
      line.size = 1,
      number.angles = 0,
      text.scale = c(1.5, 1.2, 1.2, 1, 1.5, 1), # ytitle, ylabel, xtitle, xlabel, sets, number
      order.by="degree",
      matrix.color="black",
      main.bar.color = 'black',
      mainbar.y.label = 'Intersection Size',
      sets.bar.color=setsBarColors,
      queries = list(list(query = intersects,
           params = list('A','B','C'), color = "orange", active = T)))

attachments-2019-08-SNPmxAUw5d5a17cb44162.jpg

### sort by frequency of intersection
upset(fromList(dataForUpSetPlot),
      nsets=length(dataForUpSetPlot),
      nintersects = 1000,
      sets = c("A", "B", "C", 'D'),
      #keep.order = TRUE,
      point.size = 3,
      line.size = 1,
      number.angles = 0,
      text.scale = c(1.5, 1.2, 1.2, 1, 1.5, 1), # ytitle, ylabel, xtitle, xlabel, sets, number
      order.by="freq",
      matrix.color="black",
      main.bar.color = 'black',
      mainbar.y.label = 'Intersection Size',
      sets.bar.color=setsBarColors)

attachments-2019-08-pVMaBXkP5d5a17dee0596.jpg

### sort by degree, then frequency, keep order
upset(fromList(dataForUpSetPlot),
      nsets=length(dataForUpSetPlot),
      nintersects = 1000,
      sets = c("A", "B", "C", 'D'),
      keep.order = TRUE,
      point.size = 3,
      line.size = 1,
      number.angles = 0,
      text.scale = c(1.5, 1.2, 1.2, 1, 1.5, 1), # ytitle, ylabel, xtitle, xlabel, sets, number
      #order.by="degree",
      matrix.color="black",
      main.bar.color = 'black',
      mainbar.y.label = 'Intersection Size',
      sets.bar.color=setsBarColors)


attachments-2019-08-3tCPAXLZ5d5a17ec80878.jpg

### all sets
setsBarColors <-c("dodgerblue", "goldenrod1", "darkorange1", "seagreen3", "orchid3", 'cyan3', 'brown2')

upset(fromList(dataForUpSetPlot),
      nsets=length(dataForUpSetPlot),
      nintersects = 1000,
      #sets = c("A", "B", "C", 'D','E','G','H'),
      #keep.order = TRUE,
      point.size = 1,
      line.size = 0.5,
      number.angles = 0,
      text.scale = c(1.5, 1.2, 1.2, 1, 1.5, 1), # ytitle, ylabel, xtitle, xlabel, sets, number
      #order.by="degree",
      matrix.color="black",
      main.bar.color = 'black',
      mainbar.y.label = 'Intersection Size',
      sets.bar.color=setsBarColors)


attachments-2019-08-JKw8abTH5d5a18042ff8a.jpg

更多生物信息课程:

1. 文章越来越难发?是你没发现新思路,基因家族分析发2-4分文章简单快速,学习链接:基因家族分析实操课程基因家族文献思路解读

2. 转录组数据理解不深入?图表看不懂?点击链接学习深入解读数据结果文件,学习链接:转录组(有参)结果解读转录组(无参)结果解读

3. 转录组数据深入挖掘技能-WGCNA,提升你的文章档次,学习链接:WGCNA-加权基因共表达网络分析

4. 转录组数据怎么挖掘?学习链接:转录组标准分析后的数据挖掘转录组文献解读

5. 微生物16S/ITS/18S分析原理及结果解读OTU网络图绘制cytoscape与网络图绘制课程

6. 生物信息入门到精通必修基础课:linux系统使用biolinux搭建生物信息分析环境linux命令处理生物大数据perl入门到精通perl语言高级R语言画图R语言快速入门与提高

7. 医学相关数据挖掘课程,不用做实验也能发文章:TCGA-差异基因分析GEO芯片数据挖掘 GEO芯片数据不同平台标准化 、GSEA富集分析课程TCGA临床数据生存分析TCGA-转录因子分析TCGA-ceRNA调控网络分析

8.其他,二代测序转录组数据自主分析NCBI数据上传二代fastq测序数据解读

9.全部课程可点击:组学大讲堂视频课程



  • 发表于 2019-08-19 11:31
  • 阅读 ( 9746 )
  • 分类:R

3 条评论

请先 登录 后评论
omicsgene
omicsgene

生物信息

700 篇文章

作家榜 »

  1. omicsgene 700 文章
  2. 安生水 348 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. xun 82 文章
  6. 红橙子 78 文章
  7. rzx 75 文章
  8. CORNERSTONE 72 文章