VennDetail软件包收录在Bioconductor平台 可以通过
install.packages("BiocManager")
BiocManager::install("VennDetail")
来安装。
软件包使用非常简单,只需要加载软件包
library(VennDetail)
加载例子数据
data(T2DM)
例子数据来源于一篇糖尿病相关的文章,包含来自三个组织(Cortex, kidney glomerula, and sciatic nerve)的差异基因。
T2DM data include three sets of differentially expressed genes (DEGs) from the publication by Hinder et al [1]. The three DEG datasets were obtained in three different tissues, kidney Cortex, kidney glomerula, and sciatic nerve, by comparing db/db diabetic mice and db/db mice with pioglitazone treatment. Differential expression was determined by using Cuffdiff with a false discovery rate (FDR) < 0.05.
创建venndiagram
ven <- venndetail(list(Cortex = T2DM$Cortex$Entrez, SCN = T2DM$SCN$Entrez,
Glom = T2DM$Glom$Entrez))
plot(ven)
软件包还包含了另外的展示方式“vennpie”
plot(ven, type = "vennpie")
以及upset
plot(ven, type = "upset")
当然软件包最大的特点是方便你提取你感兴趣的部分的详细信息,例如你想知道三个组织共有的以及在scn中特有的基因是哪些基因
head(getSet(ven, subset = c("Shared", "SCN")), 10)
## Subset Detail
## 1 Shared 229599
## 2 Shared 243385
## 3 Shared 99899
## 4 Shared 17001
## 5 Shared 18143
## 6 Shared 64136
## 7 Shared 117591
## 8 Shared 67866
## 9 SCN 68800
## 10 SCN 69784
当然这些信息也可以很方便的通过result功能获得
head(result(ven))
以及支持wide模式
## wide format: the first column lists all the genes, the following columns## display the groups name (three tissues) and the last column is the total ## number of the gene shared by groups.
head(result(ven, wide = TRUE))
其中vennpie支持多种定制化的方式展现结果,例如只展现只在任何一个组织中出现的基因
vennpie(ven, any = 1, revcolor = "lightgrey")
其次理论上vennpie可以支持不限组的venndiagram,并且提取信息
set.seed(123)
A <- sample(1:1000, 400, replace = FALSE)
B <- sample(1:1000, 600, replace = FALSE)
C <- sample(1:1000, 350, replace = FALSE)
D <- sample(1:1000, 550, replace = FALSE)
E <- sample(1:1000, 450, replace = FALSE)
venn <- venndetail(list(A = A, B = B, C= C, D = D, E = E))
head(result(venn))
展现最少出现在四个组中的信息
vennpie(venn, min = 4)
当然,更方便的是你可以提取每个组的信息之外,也可以结合你输入的数据,得到对应的相关信息。例如获取在三个组织中共有的基因对应的差异表达的结果,pvalue,log2FC等等
head(getFeature(ven, subset = "Shared", rlist = T2DM))
## Subset Detail Cortex_Entrez Cortex_Symbol
## 1 Shared 229599 229599 Gm129
## 2 Shared 243385 243385 Gprin3
## 3 Shared 99899 99899 Ifi44
## 4 Shared 17001 17001 Ltc4s
## 5 Shared 18143 18143 Npas2
## 6 Shared 64136 64136 Sdf2l1
## Cortex_Annotation Cortex_log2FC Cortex_FDR SCN_Entrez
## 1 predicted gene 129 4.851041 0.00156529 229599
## 2 GPRIN family member 3 2.588754 0.00156529 243385
## 3 interferon-induced protein 44 -2.186102 0.00156529 99899
## 4 leukotriene C4 synthase 3.916510 0.00156529 17001
## 5 neuronal PAS domain protein 2 -3.527904 0.00156529 18143
## 6 stromal cell-derived factor 2-like 1 -2.723979 0.00156529 64136
## SCN_Symbol SCN_Annotation SCN_log2FC SCN_FDR
## 1 Gm129 predicted gene 129 3.638130 0.000772111
## 2 Gprin3 GPRIN family member 3 2.942612 0.002032400
## 3 Ifi44 interferon-induced protein 44 -2.042164 0.012997000
## 4 Ltc4s leukotriene C4 synthase 2.852832 0.000772111
## 5 Npas2 neuronal PAS domain protein 2 -2.219165 0.015590600
## 6 Sdf2l1 stromal cell-derived factor 2-like 1 -2.092271 0.000772111
## Glom_Entrez Glom_Symbol Glom_Annotation Glom_log2FC
## 1 229599 Gm129 predicted gene 129 2.223499
## 2 243385 Gprin3 GPRIN family member 3 -2.186954
## 3 99899 Ifi44 interferon-induced protein 44 -2.146200
## 4 17001 Ltc4s leukotriene C4 synthase 2.471602
## 5 18143 Npas2 neuronal PAS domain protein 2 -11.845227
## 6 64136 Sdf2l1 stromal cell-derived factor 2-like 1 -2.875391
## Glom_FDR
## 1 0.025568700
## 2 0.000962798
## 3 0.000962798
## 4 0.011659400
## 5 0.000962798
## 6 0.000962798
当然如果你不会编程,同样有网络版的http://hurlab.med.und.edu:3838/VennDetail/