VennDiagram是进行Venn图绘制的 R包,最多能够绘制五组数据,其中一个主要的绘图函数为venn.diagram()
针对该参数相关的参数调整,可以直接对Venn图的颜色字体等多主题进行修改。而其绘图数据,也就是venn.diagram() 对应的数据是一个list向量,
数据的读取和整理可以参考:
R语言绘制维恩图空值NA处理:https://www.omicsclass.com/article/259 数据读取方式,
1、譬如经相似读取数据和处理之后,获取一个向量xList,数据基本情况如下:
summary(xList)
Length Class Mode
AT_4000 4000 -none- character
AT_3892 3892 -none- character
AT_3593 3593 -none- character
AT_3000 3000 -none- character
AT_2987 2987 -none- character
一共五组数据,各组数据如上所示,venn.diagram()绘图:
venn.plot =venn.diagram(xList,filename = NULL)
grid.newpage()
grid.draw(venn.plot)
之后基于相关代码调整即可。
2 如何获取各区域信息是绘制Venn图的一个关键问题
可以基于VennDiagram提供的计算函数 calculate.overlap 或者get.venn.partitions
以前者为例:
area=calculate.overlap(xList)
> typeof(area)
[1] "list"
> summary(area)
Length Class Mode
a31 220 -none- character
a30 286 -none- character
a29 285 -none- character
a28 175 -none- character
a27 178 -none- character
a26 149 -none- character
a25 136 -none- character
a24 206 -none- character
a23 232 -none- character
a22 356 -none- character
a21 217 -none- character
a20 284 -none- character
a19 255 -none- character
a18 147 -none- character
a17 204 -none- character
a16 131 -none- character
a15 123 -none- character
a14 213 -none- character
a13 187 -none- character
a12 300 -none- character
a11 278 -none- character
a10 216 -none- character
a9 392 -none- character
a8 209 -none- character
a7 204 -none- character
a6 153 -none- character
a5 165 -none- character
a4 153 -none- character
a3 211 -none- character
a2 224 -none- character
a1 273 -none- character
如上结果显示 五组一共获得31各区域的数据,可以利用返回的list提取每一个区域的结果,譬如取出a1区域(共273)的前10个:
> area$a1[1:10]
[1] "AT3G27960" "AT4G12170" "AT1G58270" "AT3G55290" "AT1G27360" "AT2G02790" "AT1G42990" "AT3G25011"
[9] "AT2G24617" "AT5G55910"
后者get.venn.partitions使用方法可以参考:
如果想提升自己的绘图技能,我们推荐:R语言绘图基础(ggplot2)
1. 文章越来越难发?是你没发现新思路,基因家族分析发2-4分文章简单快速,学习链接:基因家族分析实操课程、基因家族文献思路解读
2. 转录组数据理解不深入?图表看不懂?点击链接学习深入解读数据结果文件,学习链接:转录组(有参)结果解读;转录组(无参)结果解读
3. 转录组数据深入挖掘技能-WGCNA,提升你的文章档次,学习链接:WGCNA-加权基因共表达网络分析
4. 转录组数据怎么挖掘?学习链接:转录组标准分析后的数据挖掘、转录组文献解读
5. 微生物16S/ITS/18S分析原理及结果解读、OTU网络图绘制、cytoscape与网络图绘制课程
6. 生物信息入门到精通必修基础课:linux系统使用、perl入门到精通、perl语言高级、R语言入门、R语言画图
7. 医学相关数据挖掘课程,不用做实验也能发文章:TCGA-差异基因分析、GEO芯片数据挖掘、GEO芯片数据标准化、GSEA富集分析课程、TCGA临床数据生存分析、TCGA-转录因子分析、TCGA-ceRNA调控网络分析
8.其他,二代测序转录组数据自主分析、NCBI数据上传、二代测序数据解读
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!