setwd("F://张秀秀//过程性文件//8//8//OX1931B10")
new_gremline<-read.table("germline_mutations_hg38_new.txt",sep = "\t",header = T)
old_gremline<-read.table("germline_mutations_hg38_old.txt",sep = "\t",header = T)
dim(new_gremline) #2572
dim(old_gremline) #2367
#为了确保准确性,这次不进行位点的比较(因为不同染色体会有不同的位点。这也没办法说服我自己),
#而是将我们关注的几个信息合并后进行比较
new_gremline<-within(new_gremline, mutation<- paste(Chr,Start,Ref,Alt,sep=" "))
old_gremline<-within(old_gremline, mutation<- paste(Chr,Start,Ref,Alt,sep=" "))
new_mutation<-new_gremline$mutation #需要进行画图的对象1
old_mutation<-old_gremline$mutation #需要进行画图的对象2
#然后就是一个简单的venn plot
library(VennDiagram)
# 二维韦恩图
venn.plot <- venn.diagram(
x = list(Removal=new_mutation,Original=old_mutation),
filename = NULL,
lwd = 4,
fill = c("cornflowerblue", "darkorchid1"),
alpha = 0.75,
label.col = "black",
cex = 2,
fontfamily = "serif",
fontface = "bold",
cat.col = c("cornflowerblue", "darkorchid1"),
cat.cex = 1,
cat.fontfamily = "serif",
cat.fontface = "bold",
cat.dist = c(0.03, 0.03),
cat.pos = c(-20, 14),
main = "OX1931B10 patient(9.6%)"
)
grid.draw(venn.plot)
grid.newpage()
最后的结果: