Last data update: 2014.03.03

R: Bar plot for intersect sets
olBarplotR Documentation

Bar plot for intersect sets

Description

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.

Usage

olBarplot(x, mincount = 0, complexity="default", myxlabel = "default", myylabel="Counts", mytitle = "default", ...)

Arguments

x

Object of class VENNset or INTERSECTset.

mincount

Sets minimum number of counts to consider in the bar plot. Default mincount=0 considers all counts.

complexity

Allows user to limit the bar plot to specific complexity levels of intersects by specifying the chosen ones with an integer vector. Default complexity="default" considers all complexity levels.

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 geom_bar from ggplot2. For instance, fill=seq(along=vennlist(x)) or fill=seq(along=intersectlist(x)) will assign a different color to each bar, or fill="blue" will color all of them blue. The default bar coloring is by complexity levels of the intersect sets.

Value

Bar plot.

Note

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

Author(s)

Thomas Girke

See Also

overLapper, vennPlot

Examples

## 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")) 

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(systemPipeR)
Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: Biostrings
Loading required package: XVector
Loading required package: ShortRead
Loading required package: BiocParallel
Loading required package: GenomicAlignments
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/systemPipeR/olBarplot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: olBarplot
> ### Title: Bar plot for intersect sets
> ### Aliases: olBarplot
> ### Keywords: utilities
> 
> ### ** Examples
> 
> ## 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)
[1] "setlist"          "intersectmatrix"  "complexitylevels" "vennlist"        
> names(interset)
[1] "setlist"          "intersectmatrix"  "complexitylevels" "intersectlist"   
> setlist(vennset)
$A
 [1] "d" "i" "w" "v" "t" "z" "e" "y" "u" "x" "g" "h" "a" "p" "r" "l" "j" "c"

$B
 [1] "h" "o" "u" "i" "q" "e" "z" "g" "x" "r" "l" "k" "c" "d" "t" "a"

$C
 [1] "a" "d" "h" "i" "z" "y" "m" "o" "s" "n" "c" "b" "l" "g" "j" "x" "f" "w" "v"
[20] "e"

$D
 [1] "p" "w" "f" "y" "t" "x" "u" "z" "n" "a" "l" "b" "g" "s" "i" "m" "e" "h" "c"
[20] "d" "v" "r"

$E
 [1] "t" "y" "c" "d" "f" "w" "p" "b" "q" "a" "o" "n" "l" "h" "e" "m" "v" "g"

$F
 [1] "q" "g" "o" "j" "v" "f" "e" "x" "c" "p" "w" "r" "a" "k" "d" "m" "y" "t" "h"
[20] "i" "s" "n"

> intersectmatrix(vennset)
  A B C D E F
a 1 1 1 1 1 1
b 0 0 1 1 1 0
c 1 1 1 1 1 1
d 1 1 1 1 1 1
e 1 1 1 1 1 1
f 0 0 1 1 1 1
g 1 1 1 1 1 1
h 1 1 1 1 1 1
i 1 1 1 1 0 1
j 1 0 1 0 0 1
k 0 1 0 0 0 1
l 1 1 1 1 1 0
m 0 0 1 1 1 1
n 0 0 1 1 1 1
o 0 1 1 0 1 1
p 1 0 0 1 1 1
q 0 1 0 0 1 1
r 1 1 0 1 0 1
s 0 0 1 1 0 1
t 1 1 0 1 1 1
u 1 1 0 1 0 0
v 1 0 1 1 1 1
w 1 0 1 1 1 1
x 1 1 1 1 0 1
y 1 0 1 1 1 1
z 1 1 1 1 0 0
> complexitylevels(vennset)
 [1] 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
[39] 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6
> vennlist(vennset)
$A
character(0)

$B
character(0)

$C
character(0)

$D
character(0)

$E
character(0)

$F
character(0)

$A_B
character(0)

$A_C
character(0)

$A_D
character(0)

$A_E
character(0)

$A_F
character(0)

$B_C
character(0)

$B_D
character(0)

$B_E
character(0)

$B_F
[1] "k"

$C_D
character(0)

$C_E
character(0)

$C_F
character(0)

$D_E
character(0)

$D_F
character(0)

$E_F
character(0)

$A_B_C
character(0)

$A_B_D
[1] "u"

$A_B_E
character(0)

$A_B_F
character(0)

$A_C_D
character(0)

$A_C_E
character(0)

$A_C_F
[1] "j"

$A_D_E
character(0)

$A_D_F
character(0)

$A_E_F
character(0)

$B_C_D
character(0)

$B_C_E
character(0)

$B_C_F
character(0)

$B_D_E
character(0)

$B_D_F
character(0)

$B_E_F
[1] "q"

$C_D_E
[1] "b"

$C_D_F
[1] "s"

$C_E_F
character(0)

$D_E_F
character(0)

$A_B_C_D
[1] "z"

$A_B_C_E
character(0)

$A_B_C_F
character(0)

$A_B_D_E
character(0)

$A_B_D_F
[1] "r"

$A_B_E_F
character(0)

$A_C_D_E
character(0)

$A_C_D_F
character(0)

$A_C_E_F
character(0)

$A_D_E_F
[1] "p"

$B_C_D_E
character(0)

$B_C_D_F
character(0)

$B_C_E_F
[1] "o"

$B_D_E_F
character(0)

$C_D_E_F
[1] "f" "m" "n"

$A_B_C_D_E
[1] "l"

$A_B_C_D_F
[1] "i" "x"

$A_B_C_E_F
character(0)

$A_B_D_E_F
[1] "t"

$A_C_D_E_F
[1] "v" "w" "y"

$B_C_D_E_F
character(0)

$A_B_C_D_E_F
[1] "a" "c" "d" "e" "g" "h"

> intersectlist(interset)
$A
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "l" "p" "r" "t" "u" "v" "w" "x" "y" "z"

$B
 [1] "a" "c" "d" "e" "g" "h" "i" "k" "l" "o" "q" "r" "t" "u" "x" "z"

$C
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "l" "m" "n" "o" "s" "v" "w" "x" "y"
[20] "z"

$D
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "l" "m" "n" "p" "r" "s" "t" "u" "v" "w"
[20] "x" "y" "z"

$E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "o" "p" "q" "t" "v" "w" "y"

$F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "j" "k" "m" "n" "o" "p" "q" "r" "s" "t" "v"
[20] "w" "x" "y"

$A_B
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "r" "t" "u" "x" "z"

$A_C
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "l" "v" "w" "x" "y" "z"

$A_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "p" "r" "t" "u" "v" "w" "x" "y" "z"

$A_E
 [1] "a" "c" "d" "e" "g" "h" "l" "p" "t" "v" "w" "y"

$A_F
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "p" "r" "t" "v" "w" "x" "y"

$B_C
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "o" "x" "z"

$B_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "r" "t" "u" "x" "z"

$B_E
 [1] "a" "c" "d" "e" "g" "h" "l" "o" "q" "t"

$B_F
 [1] "a" "c" "d" "e" "g" "h" "i" "k" "o" "q" "r" "t" "x"

$C_D
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "l" "m" "n" "s" "v" "w" "x" "y" "z"

$C_E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "o" "v" "w" "y"

$C_F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "j" "m" "n" "o" "s" "v" "w" "x" "y"

$D_E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "p" "t" "v" "w" "y"

$D_F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "m" "n" "p" "r" "s" "t" "v" "w" "x" "y"

$E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "o" "p" "q" "t" "v" "w" "y"

$A_B_C
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "x" "z"

$A_B_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "r" "t" "u" "x" "z"

$A_B_E
[1] "a" "c" "d" "e" "g" "h" "l" "t"

$A_B_F
 [1] "a" "c" "d" "e" "g" "h" "i" "r" "t" "x"

$A_C_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "v" "w" "x" "y" "z"

$A_C_E
 [1] "a" "c" "d" "e" "g" "h" "l" "v" "w" "y"

$A_C_F
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "v" "w" "x" "y"

$A_D_E
 [1] "a" "c" "d" "e" "g" "h" "l" "p" "t" "v" "w" "y"

$A_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "p" "r" "t" "v" "w" "x" "y"

$A_E_F
 [1] "a" "c" "d" "e" "g" "h" "p" "t" "v" "w" "y"

$B_C_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "x" "z"

$B_C_E
[1] "a" "c" "d" "e" "g" "h" "l" "o"

$B_C_F
[1] "a" "c" "d" "e" "g" "h" "i" "o" "x"

$B_D_E
[1] "a" "c" "d" "e" "g" "h" "l" "t"

$B_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "r" "t" "x"

$B_E_F
[1] "a" "c" "d" "e" "g" "h" "o" "q" "t"

$C_D_E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "v" "w" "y"

$C_D_F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "m" "n" "s" "v" "w" "x" "y"

$C_E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "o" "v" "w" "y"

$D_E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "p" "t" "v" "w" "y"

$A_B_C_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "x" "z"

$A_B_C_E
[1] "a" "c" "d" "e" "g" "h" "l"

$A_B_C_F
[1] "a" "c" "d" "e" "g" "h" "i" "x"

$A_B_D_E
[1] "a" "c" "d" "e" "g" "h" "l" "t"

$A_B_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "r" "t" "x"

$A_B_E_F
[1] "a" "c" "d" "e" "g" "h" "t"

$A_C_D_E
 [1] "a" "c" "d" "e" "g" "h" "l" "v" "w" "y"

$A_C_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "v" "w" "x" "y"

$A_C_E_F
[1] "a" "c" "d" "e" "g" "h" "v" "w" "y"

$A_D_E_F
 [1] "a" "c" "d" "e" "g" "h" "p" "t" "v" "w" "y"

$B_C_D_E
[1] "a" "c" "d" "e" "g" "h" "l"

$B_C_D_F
[1] "a" "c" "d" "e" "g" "h" "i" "x"

$B_C_E_F
[1] "a" "c" "d" "e" "g" "h" "o"

$B_D_E_F
[1] "a" "c" "d" "e" "g" "h" "t"

$C_D_E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "v" "w" "y"

$A_B_C_D_E
[1] "a" "c" "d" "e" "g" "h" "l"

$A_B_C_D_F
[1] "a" "c" "d" "e" "g" "h" "i" "x"

$A_B_C_E_F
[1] "a" "c" "d" "e" "g" "h"

$A_B_D_E_F
[1] "a" "c" "d" "e" "g" "h" "t"

$A_C_D_E_F
[1] "a" "c" "d" "e" "g" "h" "v" "w" "y"

$B_C_D_E_F
[1] "a" "c" "d" "e" "g" "h"

$A_B_C_D_E_F
[1] "a" "c" "d" "e" "g" "h"

> 
> ## Coerce VENNset/INTERSECTset object to list
> as.list(vennset)
$setlist
$setlist$A
 [1] "d" "i" "w" "v" "t" "z" "e" "y" "u" "x" "g" "h" "a" "p" "r" "l" "j" "c"

$setlist$B
 [1] "h" "o" "u" "i" "q" "e" "z" "g" "x" "r" "l" "k" "c" "d" "t" "a"

$setlist$C
 [1] "a" "d" "h" "i" "z" "y" "m" "o" "s" "n" "c" "b" "l" "g" "j" "x" "f" "w" "v"
[20] "e"

$setlist$D
 [1] "p" "w" "f" "y" "t" "x" "u" "z" "n" "a" "l" "b" "g" "s" "i" "m" "e" "h" "c"
[20] "d" "v" "r"

$setlist$E
 [1] "t" "y" "c" "d" "f" "w" "p" "b" "q" "a" "o" "n" "l" "h" "e" "m" "v" "g"

$setlist$F
 [1] "q" "g" "o" "j" "v" "f" "e" "x" "c" "p" "w" "r" "a" "k" "d" "m" "y" "t" "h"
[20] "i" "s" "n"


$intersectmatrix
  A B C D E F
a 1 1 1 1 1 1
b 0 0 1 1 1 0
c 1 1 1 1 1 1
d 1 1 1 1 1 1
e 1 1 1 1 1 1
f 0 0 1 1 1 1
g 1 1 1 1 1 1
h 1 1 1 1 1 1
i 1 1 1 1 0 1
j 1 0 1 0 0 1
k 0 1 0 0 0 1
l 1 1 1 1 1 0
m 0 0 1 1 1 1
n 0 0 1 1 1 1
o 0 1 1 0 1 1
p 1 0 0 1 1 1
q 0 1 0 0 1 1
r 1 1 0 1 0 1
s 0 0 1 1 0 1
t 1 1 0 1 1 1
u 1 1 0 1 0 0
v 1 0 1 1 1 1
w 1 0 1 1 1 1
x 1 1 1 1 0 1
y 1 0 1 1 1 1
z 1 1 1 1 0 0

$complexitylevels
 [1] 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
[39] 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6

$vennlist
$vennlist$A
character(0)

$vennlist$B
character(0)

$vennlist$C
character(0)

$vennlist$D
character(0)

$vennlist$E
character(0)

$vennlist$F
character(0)

$vennlist$A_B
character(0)

$vennlist$A_C
character(0)

$vennlist$A_D
character(0)

$vennlist$A_E
character(0)

$vennlist$A_F
character(0)

$vennlist$B_C
character(0)

$vennlist$B_D
character(0)

$vennlist$B_E
character(0)

$vennlist$B_F
[1] "k"

$vennlist$C_D
character(0)

$vennlist$C_E
character(0)

$vennlist$C_F
character(0)

$vennlist$D_E
character(0)

$vennlist$D_F
character(0)

$vennlist$E_F
character(0)

$vennlist$A_B_C
character(0)

$vennlist$A_B_D
[1] "u"

$vennlist$A_B_E
character(0)

$vennlist$A_B_F
character(0)

$vennlist$A_C_D
character(0)

$vennlist$A_C_E
character(0)

$vennlist$A_C_F
[1] "j"

$vennlist$A_D_E
character(0)

$vennlist$A_D_F
character(0)

$vennlist$A_E_F
character(0)

$vennlist$B_C_D
character(0)

$vennlist$B_C_E
character(0)

$vennlist$B_C_F
character(0)

$vennlist$B_D_E
character(0)

$vennlist$B_D_F
character(0)

$vennlist$B_E_F
[1] "q"

$vennlist$C_D_E
[1] "b"

$vennlist$C_D_F
[1] "s"

$vennlist$C_E_F
character(0)

$vennlist$D_E_F
character(0)

$vennlist$A_B_C_D
[1] "z"

$vennlist$A_B_C_E
character(0)

$vennlist$A_B_C_F
character(0)

$vennlist$A_B_D_E
character(0)

$vennlist$A_B_D_F
[1] "r"

$vennlist$A_B_E_F
character(0)

$vennlist$A_C_D_E
character(0)

$vennlist$A_C_D_F
character(0)

$vennlist$A_C_E_F
character(0)

$vennlist$A_D_E_F
[1] "p"

$vennlist$B_C_D_E
character(0)

$vennlist$B_C_D_F
character(0)

$vennlist$B_C_E_F
[1] "o"

$vennlist$B_D_E_F
character(0)

$vennlist$C_D_E_F
[1] "f" "m" "n"

$vennlist$A_B_C_D_E
[1] "l"

$vennlist$A_B_C_D_F
[1] "i" "x"

$vennlist$A_B_C_E_F
character(0)

$vennlist$A_B_D_E_F
[1] "t"

$vennlist$A_C_D_E_F
[1] "v" "w" "y"

$vennlist$B_C_D_E_F
character(0)

$vennlist$A_B_C_D_E_F
[1] "a" "c" "d" "e" "g" "h"


> as.list(interset)
$setlist
$setlist$A
 [1] "d" "i" "w" "v" "t" "z" "e" "y" "u" "x" "g" "h" "a" "p" "r" "l" "j" "c"

$setlist$B
 [1] "h" "o" "u" "i" "q" "e" "z" "g" "x" "r" "l" "k" "c" "d" "t" "a"

$setlist$C
 [1] "a" "d" "h" "i" "z" "y" "m" "o" "s" "n" "c" "b" "l" "g" "j" "x" "f" "w" "v"
[20] "e"

$setlist$D
 [1] "p" "w" "f" "y" "t" "x" "u" "z" "n" "a" "l" "b" "g" "s" "i" "m" "e" "h" "c"
[20] "d" "v" "r"

$setlist$E
 [1] "t" "y" "c" "d" "f" "w" "p" "b" "q" "a" "o" "n" "l" "h" "e" "m" "v" "g"

$setlist$F
 [1] "q" "g" "o" "j" "v" "f" "e" "x" "c" "p" "w" "r" "a" "k" "d" "m" "y" "t" "h"
[20] "i" "s" "n"


$intersectmatrix
  A B C D E F
a 1 1 1 1 1 1
b 0 0 1 1 1 0
c 1 1 1 1 1 1
d 1 1 1 1 1 1
e 1 1 1 1 1 1
f 0 0 1 1 1 1
g 1 1 1 1 1 1
h 1 1 1 1 1 1
i 1 1 1 1 0 1
j 1 0 1 0 0 1
k 0 1 0 0 0 1
l 1 1 1 1 1 0
m 0 0 1 1 1 1
n 0 0 1 1 1 1
o 0 1 1 0 1 1
p 1 0 0 1 1 1
q 0 1 0 0 1 1
r 1 1 0 1 0 1
s 0 0 1 1 0 1
t 1 1 0 1 1 1
u 1 1 0 1 0 0
v 1 0 1 1 1 1
w 1 0 1 1 1 1
x 1 1 1 1 0 1
y 1 0 1 1 1 1
z 1 1 1 1 0 0

$complexitylevels
 [1] 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
[39] 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 6

$intersectlist
$intersectlist$A
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "l" "p" "r" "t" "u" "v" "w" "x" "y" "z"

$intersectlist$B
 [1] "a" "c" "d" "e" "g" "h" "i" "k" "l" "o" "q" "r" "t" "u" "x" "z"

$intersectlist$C
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "l" "m" "n" "o" "s" "v" "w" "x" "y"
[20] "z"

$intersectlist$D
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "l" "m" "n" "p" "r" "s" "t" "u" "v" "w"
[20] "x" "y" "z"

$intersectlist$E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "o" "p" "q" "t" "v" "w" "y"

$intersectlist$F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "j" "k" "m" "n" "o" "p" "q" "r" "s" "t" "v"
[20] "w" "x" "y"

$intersectlist$A_B
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "r" "t" "u" "x" "z"

$intersectlist$A_C
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "l" "v" "w" "x" "y" "z"

$intersectlist$A_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "p" "r" "t" "u" "v" "w" "x" "y" "z"

$intersectlist$A_E
 [1] "a" "c" "d" "e" "g" "h" "l" "p" "t" "v" "w" "y"

$intersectlist$A_F
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "p" "r" "t" "v" "w" "x" "y"

$intersectlist$B_C
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "o" "x" "z"

$intersectlist$B_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "r" "t" "u" "x" "z"

$intersectlist$B_E
 [1] "a" "c" "d" "e" "g" "h" "l" "o" "q" "t"

$intersectlist$B_F
 [1] "a" "c" "d" "e" "g" "h" "i" "k" "o" "q" "r" "t" "x"

$intersectlist$C_D
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "l" "m" "n" "s" "v" "w" "x" "y" "z"

$intersectlist$C_E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "o" "v" "w" "y"

$intersectlist$C_F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "j" "m" "n" "o" "s" "v" "w" "x" "y"

$intersectlist$D_E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "p" "t" "v" "w" "y"

$intersectlist$D_F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "m" "n" "p" "r" "s" "t" "v" "w" "x" "y"

$intersectlist$E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "o" "p" "q" "t" "v" "w" "y"

$intersectlist$A_B_C
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "x" "z"

$intersectlist$A_B_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "r" "t" "u" "x" "z"

$intersectlist$A_B_E
[1] "a" "c" "d" "e" "g" "h" "l" "t"

$intersectlist$A_B_F
 [1] "a" "c" "d" "e" "g" "h" "i" "r" "t" "x"

$intersectlist$A_C_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "v" "w" "x" "y" "z"

$intersectlist$A_C_E
 [1] "a" "c" "d" "e" "g" "h" "l" "v" "w" "y"

$intersectlist$A_C_F
 [1] "a" "c" "d" "e" "g" "h" "i" "j" "v" "w" "x" "y"

$intersectlist$A_D_E
 [1] "a" "c" "d" "e" "g" "h" "l" "p" "t" "v" "w" "y"

$intersectlist$A_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "p" "r" "t" "v" "w" "x" "y"

$intersectlist$A_E_F
 [1] "a" "c" "d" "e" "g" "h" "p" "t" "v" "w" "y"

$intersectlist$B_C_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "x" "z"

$intersectlist$B_C_E
[1] "a" "c" "d" "e" "g" "h" "l" "o"

$intersectlist$B_C_F
[1] "a" "c" "d" "e" "g" "h" "i" "o" "x"

$intersectlist$B_D_E
[1] "a" "c" "d" "e" "g" "h" "l" "t"

$intersectlist$B_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "r" "t" "x"

$intersectlist$B_E_F
[1] "a" "c" "d" "e" "g" "h" "o" "q" "t"

$intersectlist$C_D_E
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "l" "m" "n" "v" "w" "y"

$intersectlist$C_D_F
 [1] "a" "c" "d" "e" "f" "g" "h" "i" "m" "n" "s" "v" "w" "x" "y"

$intersectlist$C_E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "o" "v" "w" "y"

$intersectlist$D_E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "p" "t" "v" "w" "y"

$intersectlist$A_B_C_D
 [1] "a" "c" "d" "e" "g" "h" "i" "l" "x" "z"

$intersectlist$A_B_C_E
[1] "a" "c" "d" "e" "g" "h" "l"

$intersectlist$A_B_C_F
[1] "a" "c" "d" "e" "g" "h" "i" "x"

$intersectlist$A_B_D_E
[1] "a" "c" "d" "e" "g" "h" "l" "t"

$intersectlist$A_B_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "r" "t" "x"

$intersectlist$A_B_E_F
[1] "a" "c" "d" "e" "g" "h" "t"

$intersectlist$A_C_D_E
 [1] "a" "c" "d" "e" "g" "h" "l" "v" "w" "y"

$intersectlist$A_C_D_F
 [1] "a" "c" "d" "e" "g" "h" "i" "v" "w" "x" "y"

$intersectlist$A_C_E_F
[1] "a" "c" "d" "e" "g" "h" "v" "w" "y"

$intersectlist$A_D_E_F
 [1] "a" "c" "d" "e" "g" "h" "p" "t" "v" "w" "y"

$intersectlist$B_C_D_E
[1] "a" "c" "d" "e" "g" "h" "l"

$intersectlist$B_C_D_F
[1] "a" "c" "d" "e" "g" "h" "i" "x"

$intersectlist$B_C_E_F
[1] "a" "c" "d" "e" "g" "h" "o"

$intersectlist$B_D_E_F
[1] "a" "c" "d" "e" "g" "h" "t"

$intersectlist$C_D_E_F
 [1] "a" "c" "d" "e" "f" "g" "h" "m" "n" "v" "w" "y"

$intersectlist$A_B_C_D_E
[1] "a" "c" "d" "e" "g" "h" "l"

$intersectlist$A_B_C_D_F
[1] "a" "c" "d" "e" "g" "h" "i" "x"

$intersectlist$A_B_C_E_F
[1] "a" "c" "d" "e" "g" "h"

$intersectlist$A_B_D_E_F
[1] "a" "c" "d" "e" "g" "h" "t"

$intersectlist$A_C_D_E_F
[1] "a" "c" "d" "e" "g" "h" "v" "w" "y"

$intersectlist$B_C_D_E_F
[1] "a" "c" "d" "e" "g" "h"

$intersectlist$A_B_C_D_E_F
[1] "a" "c" "d" "e" "g" "h"


> 
> ## Pairwise intersect matrix and heatmap
> olMA <- sapply(names(setlist), 
+ 		function(x) sapply(names(setlist), 
+ 		function(y) sum(setlist[[x]] %in% setlist[[y]])))
> olMA
   A  B  C  D  E  F
A 18 13 14 17 12 15
B 13 16 11 13 10 13
C 14 11 20 18 15 17
D 17 13 18 22 16 18
E 12 10 15 16 18 16
F 15 13 17 18 16 22
> 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))
  A B C D E F
a 1 1 1 1 1 1
b 0 0 1 1 1 0
c 1 1 1 1 1 1
d 1 1 1 1 1 1
e 1 1 1 1 1 1
f 0 0 1 1 1 1
g 1 1 1 1 1 1
h 1 1 1 1 1 1
i 1 1 1 1 0 1
j 1 0 1 0 0 1
k 0 1 0 0 0 1
l 1 1 1 1 1 0
m 0 0 1 1 1 1
n 0 0 1 1 1 1
o 0 1 1 0 1 1
p 1 0 0 1 1 1
q 0 1 0 0 1 1
r 1 1 0 1 0 1
s 0 0 1 1 0 1
t 1 1 0 1 1 1
u 1 1 0 1 0 0
v 1 0 1 1 1 1
w 1 0 1 1 1 1
x 1 1 1 1 0 1
y 1 0 1 1 1 1
z 1 1 1 1 0 0
> heatmap(paMA, Rowv=NA, Colv=NA, col=c("white", "gray")) 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>