#交集
my_disease_markers_for_AM3=openxlsx::read.xlsx("G:/silicosis/sicosis/Supplementary Table.xlsx",
sheet = "Sheet1")
head(my_disease_markers_for_AM3)
library(dplyr)
disease_markers_for_AM3=list()
for (eachcolumn in colnames(my_disease_markers_for_AM3)) {
disease_markers_for_AM3[[paste0(eachcolumn)]]=my_disease_markers_for_AM3[,eachcolumn] %>%
na.omit() %>% unique()
}
head(disease_markers_for_AM3)
library(VennDiagram)#https://www.jianshu.com/p/b5a4c40c3a33
venn_list <- list(AM3_Silicosis = disease_markers_for_AM3[[1]],
MoAM_GSE184854 = disease_markers_for_AM3[[2]])
venn.diagram(venn_list, filename = 'venn2_for_humanPF-Silicosi-Bleomycin.png', imagetype = 'png',
fill = c('red', 'blue'), alpha = 0.50, cat.col = rep('black', 2),
col = 'black', cex = 1.3, fontfamily = 'serif',
cat.cex = 1.3, cat.fontfamily = 'serif')
getwd()
#继续以上述4个分组为例,组间交集元素获得
inter <- get.venn.partitions(venn_list)
for (i in 1:nrow(inter)) inter[i,'values'] <- paste(inter[[i,'..values..']], collapse = ', ')
write.table(inter[-c(5, 6)], 'venn4_inter.txt', row.names = FALSE, sep = '\t', quote = FALSE)
for (i in 1:nrow(inter)) inter[i,'values'] <- paste(inter[[i,'..values..']], collapse = ', ')
openxlsx::write.xlsx(inter[-c(5, 6)], 'venn4_inter.xlsx', row.names = FALSE, sep = ',', quote = FALSE)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33