
vennPlot(x, mymain = "Venn Diagram", mysub = "default", setlabels = "default", yoffset = seq(0, 10, by = 0.34), ccol = rep(1, 31), colmode = 1, lcol = c("#FF0000", "#008B00", "#0000FF", "#FF00FF", "#CD8500"), lines = c("#FF0000", "#008B00", "#0000FF", "#FF00FF", "#CD8500"), mylwd = 3, diacol = 1, type = "ellipse", ccex = 1, lcex = 1, sepsplit = "_", ...)
VENNset
or list of VENNset
objects. Alternatively, a
vector
of Venn counts or a list
of vectors of Venn counts can be
provided as input. If several Venn comparisons are provided in a list
then their results are combined in a single Venn diagram, where the count sets
are organized above each other.mysub="default"
reports the number of unique
items in all sets, as well as the number of unique items in each individual set,
respectively.setlabels
allows to provide a vector of custom sample labels.
However, assigning the proper names in the name slots of the initial setlist
is preferred for tracking purposes.x
a list
with several VENNsets
or count vectors.
The positonal offset of the count sets in the plot can be controlled with the
yoffset
argument. The argument setting colmode
allows to assign
different colors to each count set. For instance, with colmode=2
one can
assign to ccol
a color vector or a list, such as ccol=c("blue", "red")
or ccol=list(1:8, 8:1)
.vector
to define colors of count values, e.g.
ccol=c("black","black","red")
.yoffset
.vector
to define colors of set labels, e.g.
lcol=c("red", "green")
vector
to define colors of lines in plot.type
.type="ellipse"
uses
ellipses. The setting type="circle"
returns an incomplete 4-way Venn diagram as
circles. This representation misses two overlap sectors, but is sometimes easier to
navigate than the default ellipse version. The missing Venn intersects are reported
below the Venn diagram. Their font color can be controled with the argument diacol
.overLapper
, olBarplot
## 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))
## 2-way Venn diagram
vennset <- overLapper(setlist[1:2], type="vennsets")
vennPlot(vennset)
## 3-way Venn diagram
vennset <- overLapper(setlist[1:3], type="vennsets")
vennPlot(vennset)
## 4-way Venn diagram
vennset <- overLapper(setlist[1:4], type="vennsets")
vennPlot(list(vennset, vennset))
## Pseudo 4-way Venn diagram with circles
vennPlot(vennset, type="circle")
## 5-way 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)
## 6-way 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)
## Presence-absence 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"))
Run the code above in your browser using DataLab