olBarplot | R Documentation |
Generates bar plots of the intersect counts of VENNset
and
INTERSECTset
objects generated by the overLapper
function. It is
an alternative to Venn diagrames (e.g. vennPlot
) that scales to larger numbers
of label sets. By default the bars in the plot are colored and grouped by complexity
levels of the intersect sets.
olBarplot(x, mincount = 0, complexity="default", myxlabel = "default", myylabel="Counts", mytitle = "default", ...)
x |
Object of class |
mincount |
Sets minimum number of counts to consider in the bar plot. Default |
complexity |
Allows user to limit the bar plot to specific complexity levels of intersects
by specifying the chosen ones with an integer vector. Default
|
myxlabel |
Defines label of x-axis. |
myylabel |
Defines label of y-axis. |
mytitle |
Defines main title of plot. |
... |
Allows to pass on additional arguments to |
Bar plot.
The functions provided here are an extension of the Venn diagram resources on this site: http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual#TOC-Venn-Diagrams
Thomas Girke
overLapper
, vennPlot
## Sample data: list of vectors with object labels
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.