limma=read.table('/Users/zhangzhishuai/Downloads/31 R韦恩图/31_venn/voom-DEG-res.txt',sep = '\t', header = T, row.names = 1)
deseq=read.table('/Users/zhangzhishuai/Downloads/31 R韦恩图/31_venn/DESeq2-DEG-res.txt',sep = '\t', header = T, row.names = 1)
edger=read.table('/Users/zhangzhishuai/Downloads/31 R韦恩图/31_venn/edger-DEG-res.txt',sep = '\t', header = T, row.names = 1)
deseq_gene=rownames(deseq)
length(deseq_gene)
limma_gene=rownames(limma)
edger_gene=rownames(edger)
# 无颜色韦恩图
library(VennDiagram)
venn.diagram(
x = list(deseq_gene,limma_gene,edger_gene),
category.names = c('deseq_gene', 'limma_gene', 'edger_gene'),
filename = '/Users/zhangzhishuai/Downloads/31 R韦恩图/31_venn/gene_venn.tiff'
)
# 设置颜色
library(RColorBrewer)
mycol = brewer.pal(3,'Set1')
venn.diagram(
x = list(deseq_gene,limma_gene,edger_gene),
category.names = c('deseq_gene', 'limma_gene', 'edger_gene'),
filename = '/Users/zhangzhishuai/Downloads/31 R韦恩图/31_venn/gene_venn.tiff',
output=TRUE,
# 控制输出文件大小
height = 700,
width = 700,
resolution = 300, #分辨率
compression = 'lzw', # 压缩方法
#控制圆圈格式
lwd = 1, # 控制圆圈边界的粗细
lty = 'blank', # 控制线类型 blank:取消边界
fill = mycol, #填充颜色
col = mycol, #控制边界颜色
#控制数字格式
cex = 0.6, #字体大小
#控制标签格式
cat.cex = 0.4, #控制字体大小
)
#改变填充色透明度
library(scales)
venn.diagram(
x = list(deseq_gene,limma_gene,edger_gene),
category.names = c('deseq_gene', 'limma_gene', 'edger_gene'),
filename = '/Users/zhangzhishuai/Downloads/31 R韦恩图/31_venn/gene_venn.tiff',
output=TRUE,
# 控制输出文件大小
height = 700,
width = 700,
resolution = 300, #分辨率
compression = 'lzw', # 压缩方法
#控制圆圈格式
lwd = 1, # 控制圆圈边界的粗细
lty = 'blank', # 控制线类型 blank:取消边界
fill = c(alpha('red',0.7),alpha('blue',0.7),alpha('green',0.7)), #填充颜色 0.7指透明度
col = mycol, #控制边界颜色
#控制数字格式
cex = 0.6, #字体大小
#控制标签格式
cat.cex = 0.4, #控制字体大小
)
# 各个集合的交集
inter_deseq_limma=intersect(deseq_gene,limma_gene)
length(inter_deseq_limma)
# 集合中的减法
a <- setdiff(deseq_gene,inter_deseq_limma)
length(a)
write.table(file = '/Users/zhangzhishuai/Downloads/31 R韦恩图/31_venn/test.txt',a,quote = F,
row.names = F,# 不要行名
col.names = F # 不要列名
)
voom-DEG-res.txt
> head(limma)
logFC AveExpr t P.Value adj.P.Val B filter
ENSG00000124208 0.6202943 8.689109 4.740494 3.960869e-04 4.130219e-03 -0.7407924 1
ENSG00000101444 0.6364420 5.259826 3.384472 4.946293e-03 2.730682e-02 -2.5863960 1
ENSG00000101333 0.5917140 10.954749 9.125611 5.542845e-07 2.534317e-05 5.5825354 1
ENSG00000078699 0.6847138 8.920357 7.674096 3.728581e-06 1.108703e-04 4.0882752 1
DESeq2-DEG-res.txt:
> head(deseq)
baseMean log2FoldChange lfcSE stat pvalue padj filter
ENSG00000078699 623.80574 0.5364229 0.09915439 5.409976 6.303319e-08 1.054063e-06 1
ENSG00000203880 193.28560 0.7554123 0.16557257 4.562424 5.056639e-06 6.024733e-05 1
ENSG00000124181 91.65978 1.1255133 0.21049624 5.346952 8.944770e-08 1.453515e-06 1
ENSG00000132821 23.24575 1.0751352 0.40091565 2.681699 7.324928e-03 3.482852e-02 1
ENSG00000175063 38.47452 1.9083439 0.38829445 4.914682 8.892656e-07 1.222439e-05 1
edger-DEG-res.txt
> head(edger)
logFC logCPM LR PValue FDR filter
ENSG00000124205 4.3068727 1.352256 6.955891 8.354367e-03 3.351821e-02 1
ENSG00000101444 0.6076843 5.332983 9.153910 2.481872e-03 1.234843e-02 1
ENSG00000206794 3.9413709 1.172266 7.859416 5.055673e-03 2.233133e-02 1
ENSG00000203880 0.7417924 7.283806 20.450844 6.118258e-06 6.250478e-05 1
ENSG00000168612 0.9946011 3.791905 6.848776 8.870204e-03 3.517956e-02 1