[BioC] venn diagram
Anthony Bosco
anthonyb at ichr.uwa.edu.au
Tue Jan 18 10:54:36 CET 2005
list1, list2, and list3 are lists of Affymetrix probe IDs (lists can
be of any length).
library(limma)
2-way venn diagram
list1
list2
dooby.all <- union(list1,list2))
dooby.mat <- matrix(0,nrow=length(dooby.all),ncol=2)
colnames(dooby.mat) <- c("list1","list2")
for (i in 1:length(dooby.all)) {
dooby.mat[i,1] <- dooby.all[i]%in%list1
dooby.mat[i,2] <- dooby.all[i]%in%list2}
dooby.ven <- vennCounts(dooby.mat)
vennDiagram(dooby.ven)
3-way venn
list1
list2
list3
dooby.all <- union(list1,union(list2,list3))
dooby.mat <- matrix(0,nrow=length(dooby.all),ncol=3)
colnames(dooby.mat) <- c("list1","list2","list3")
for (i in 1:length(dooby.all)) {
dooby.mat[i,1] <- dooby.all[i]%in%list1
dooby.mat[i,2] <- dooby.all[i]%in%list2
dooby.mat[i,3] <- dooby.all[i]%in%list3}
dooby.ven <- vennCounts(dooby.mat)
vennDiagram(dooby.ven)
--
______________________________________________
Anthony Bosco - PhD Student
Institute for Child Health Research
(Company Limited by Guarantee ACN 009 278 755)
Subiaco, Western Australia, 6008
Ph 61 8 9489 , Fax 61 8 9489 7700
email anthonyb at ichr.uwa.edu.au
More information about the Bioconductor
mailing list