Description Usage Arguments Details Value Note Author(s) References See Also Examples
Function for computing Venn intersects or standard intersects among large
numbers of label sets provided as list
of vectors
. The resulting
intersect objects can be used for plotting 25 way Venn diagrams or intersect
bar plots using the functions vennPlot
or olBarplot
, respectively.
The overLapper
function scales to 220 or more label vectors for Venn
intersect calculations and to much larger sample numbers for standard
intersects. The different intersect types are explained below under the
definition of the type
argument. The upper Venn limit around 20 label
sets is unavoidable because the complexity of Venn intersects increases
exponentially with the label set number n
according to this
relationship: 2^n  1
. The current implementation of
the plotting function vennPlot
supports Venn diagrams for 25 label
sets. To visually analyze larger numbers of label sets, a variety of intersect
methods are introduced in the olBarplot
help file. These methods are
much more scalable than Venn diagrams, but lack their restrictive intersect
logic.
1  overLapper(setlist, complexity = "default", sep = "_", cleanup = FALSE, keepdups = FALSE, type)

setlist 
Object of class 
complexity 
Complexity level of intersects specified as integer vector. For Venn intersects
it needs to be assigned 
sep 
Character used to separate set labels. 
cleanup 
If set to 
keepdups 
By default all duplicates are removed from the label sets. The setting

type 
With the default setting 
Additional Venn diagram resources are provided by the packages limma
,
gplots
, vennerable
, eVenn
and VennDiagram
, or
online resources such as shapes, Venn Diagram Generator and Venny.
overLapper
returns standard intersect and Venn intersect results as
INTERSECTset
or VENNset
objects, respectively. These S4 objects
contain the following components:
setlist 
Original label sets accessible with 
intersectmatrix 
Presentabsent matrix accessible with 
complexitylevels 
Complexity levels accessible with 
vennlist 
Venn intersects for 
intersectlist 
Standard intersects for 
The functions provided here are an extension of the Venn diagram resources on this site: http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual#TOCVennDiagrams
Thomas Girke
See examples in 'The Electronic Journal of Combinatorics': http://www.combinatorics.org/files/Surveys/ds5/VennSymmExamples.html
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60  ## Sample data
setlist < list(A=sample(letters, 18), B=sample(letters, 16),
C=sample(letters, 20), D=sample(letters, 22),
E=sample(letters, 18), F=sample(letters, 22))
## 2way Venn diagram
vennset < overLapper(setlist[1:2], type="vennsets")
vennPlot(vennset)
## 3way Venn diagram
vennset < overLapper(setlist[1:3], type="vennsets")
vennPlot(vennset)
## 4way Venn diagram
vennset < overLapper(setlist[1:4], type="vennsets")
vennPlot(list(vennset, vennset))
## Pseudo 4way Venn diagram with circles
vennPlot(vennset, type="circle")
## 5way Venn diagram
vennset < overLapper(setlist[1:5], type="vennsets")
vennPlot(vennset)
## Alternative Venn count input to vennPlot (not recommended!)
counts < sapply(vennlist(vennset), length)
vennPlot(counts)
## 6way Venn comparison as bar plot
vennset < overLapper(setlist[1:6], type="vennsets")
olBarplot(vennset, mincount=1)
## Bar plot of standard intersect counts
interset < overLapper(setlist, type="intersects")
olBarplot(interset, mincount=1)
## Accessor methods for VENNset/INTERSECTset objects
names(vennset)
names(interset)
setlist(vennset)
intersectmatrix(vennset)
complexitylevels(vennset)
vennlist(vennset)
intersectlist(interset)
## Coerce VENNset/INTERSECTset object to list
as.list(vennset)
as.list(interset)
## Pairwise intersect matrix and heatmap
olMA < sapply(names(setlist),
function(x) sapply(names(setlist),
function(y) sum(setlist[[x]] %in% setlist[[y]])))
olMA
heatmap(olMA, Rowv=NA, Colv=NA)
## Presenceabsence matrices for large numbers of sample sets
interset < overLapper(setlist=setlist, type="intersects", complexity=2)
(paMA < intersectmatrix(interset))
heatmap(paMA, Rowv=NA, Colv=NA, col=c("white", "gray"))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.