R--分块韦恩图

R代码:

args<-commandArgs(trailingOnly=TRUE)
data<-read.table(args[1],header=F)
library(VennDiagram)
data<-read.table("*.txt",header=T)
grid.newpage()
png("*.png")
for(i in 1:6)
{
vp <- viewport(x = 0.15*i, y = 0.8, width = 0.14, height = 0.18, angle=0)
pushViewport(vp)
grid.rect()
draw.pairwise.venn(area1=data[1,i],area2=data[5,i],cross.area=data[3,i],col='white',fill=c('deepskyblue','brown1'),cat.col=c('deepskyblue','brown1'),category=c(names(data)[i],'GATK_v3.5'),cat.pos = c(0, 180),euler.d = TRUE,sep.dist = 0.03)
upViewport()
vp <- viewport(x = 0.15*i, y = 0.6, width = 0.14, height = 0.18, angle=0)
pushViewport(vp)
grid.rect()
draw.pairwise.venn(area1=data[6,i],area2=data[10,i],cross.area=data[8,i],col='white',fill=c('deepskyblue','brown1'),cat.col=c('deepskyblue','brown1'),category=c(names(data)[i],'GATK_v3.5'),cat.pos = c(0, 180),euler.d = TRUE,sep.dist = 0.03)
upViewport()
vp <- viewport(x = 0.15*i, y = 0.4, width = 0.14, height = 0.18, angle=0)
pushViewport(vp)
grid.rect()
draw.pairwise.venn(area1=data[11,i],area2=data[15,i],cross.area=data[13,i],col='white',fill=c('deepskyblue','brown1'),cat.col=c('deepskyblue','brown1'),category=c(names(data)[i],'GATK_v3.5'),cat.pos = c(0, 180),euler.d = TRUE,sep.dist = 0.03)
upViewport()
vp <- viewport(x = 0.15*i, y = 0.2, width = 0.14, height = 0.18, angle=0)
pushViewport(vp)
grid.rect()
draw.pairwise.venn(area1=data[16,i],area2=data[20,i],cross.area=data[18,i],col='white',fill=c('deepskyblue','brown1'),cat.col=c('deepskyblue','brown1'),category=c(names(data)[i],'GATK_v3.5'),cat.pos = c(0, 180),euler.d = TRUE,sep.dist = 0.03)
upViewport()
}
vp <- viewport(x = 0.5, y = 0.92, width = 0.115, height = 0.18, angle=0)
pushViewport(vp)
grid.text("BWA")
upViewport()
vp <- viewport(x = 0.05, y = 0.8, width = 0.115, height = 0.18, angle=0)
pushViewport(vp)
grid.text("C1")
upViewport()
vp <- viewport(x = 0.05, y = 0.6, width = 0.115, height = 0.18, angle=0)
pushViewport(vp)
grid.text("C2")
upViewport()
vp <- viewport(x = 0.05, y = 0.4, width = 0.115, height = 0.18, angle=0)
pushViewport(vp)
grid.text("T1")
upViewport()
vp <- viewport(x = 0.05, y = 0.2, width = 0.115, height = 0.18, angle=0)
pushViewport(vp)
grid.text("T2")
upViewport()
dev.off()

数据:

Bcftools Freebayes GATK_v4.0 Platypus SNVer VarScan
2229152 460801 305909 152986 77864 86983
2050879 294574 125412 19505 5782 12381
178273 166227 180497 133481 72082 74602
2367 14413 143 47159 108558 106038
180640 180640 180640 180640 180640 180640
2221594 466958 309191 153931 78113 87685
2041494 299340 126610 19491 5839 12572
180100 167618 182581 134440 72274 75113
2614 15096 133 48274 110440 107601
182714 182714 182714 182714 182714 182714
2041733 440616 288388 142927 74865 81587
1874440 284859 118923 17783 5365 11511
167293 155757 169465 125144 69500 70076
2327 13863 155 44476 100120 99544
169620 169620 169620 169620 169620 169620
2044015 445911 291037 144380 75393 82841
1875010 288507 119832 18067 5468 11775
169005 157404 171205 126313 69925 71066
2381 13982 181 45073 101461 100320
171386 171386 171386 171386 171386 171386

结果图:

你可能感兴趣的:(R--分块韦恩图)