[BioC] Creating a Venn Diagram with 4 sets

lcarvalh at btk.fi lcarvalh at btk.fi
Fri Apr 13 10:02:22 CEST 2012


I am trying to create a Venn diagram for this data, and the Venn diagram needs
to show the number of occurring cases of each different intersection, for
example in the diagram section were c1,c2 intersect each other should be the
value 13.

Data:

      c1 c2 c3 c4 Counts
 [1,]  0  0  0  0     26
 [2,]  0  0  0  1     27
 [3,]  0  0  1  0      4
 [4,]  0  0  1  1      6
 [5,]  0  1  0  0      5
 [6,]  0  1  0  1     12
 [7,]  0  1  1  0     42
 [8,]  0  1  1  1     78
 [9,]  1  0  0  0     18
[10,]  1  0  0  1     52
[11,]  1  0  1  0      4
[12,]  1  0  1  1     63
[13,]  1  1  0  0     13
[14,]  1  1  0  1     47
[15,]  1  1  1  0     88
[16,]  1  1  1  1    182

I have been trying to use the package VennDiagram, with the function
venn.diagram. But I am only able to get some of the values correct in the
diagram. Can anyone give me some help? maybe some other way of making a nice
looking venn diagram? or help me correcting this code so that I can produce the
correct venn diagram?

Code:


library (VennDiagram)
library(grid)

venn.diagram(
	x = list(
  	       comp1=c(1:18, 19:31, 32:119, 120:123, 124:186, 187:238, 239:420,
421:467),

		comp4=c(692:695,561:603,472:560,120:123, 187:238, 239:420, 603:681,682:688),
		comp2=c(468:472,19:31, 32:119, 239:420, 421:467, 561:602, 603:680, 681:6918),
		comp3=c(780:807,716:779,603:680,681:691, 239:420, 421:467, 124:186,
187:238)		),
	filename = "quadruple_Venn.tiff",
	col = "black",
	lty = "dotted",
	lwd = 4,
	fill = c("cornflowerblue", "green", "yellow", "darkorchid1"),
	alpha = 0.50,
	label.col = c("orange", "white", "darkorchid4", "white", "white", "white",
"white", "white", "darkblue", "white", "white", "white", "white", "darkgreen",
"white"),
	cex = 2.5,
	fontfamily = "serif",
	fontface = "bold",
	cat.col = c("darkblue", "darkgreen", "orange", "darkorchid4"),
	cat.cex = 2.5,
	cat.fontfamily = "serif"
	);



More information about the Bioconductor mailing list