[Bioc-sig-seq] Pairwise comparisons of peak sets (for ChIP-seqs or anything else)

Thomas Girke thomas.girke at ucr.edu
Thu Jun 4 18:00:51 CEST 2009


Ivan,

If I understand your problem correctly, then you could easily do this with
the heatmap or heatmap.2 functions. Below is an example how to generate
and plot such a squared overlap matrix.

## Some sample data set
setlist <- lapply(11:30, function(x) sample(letters, x, replace=TRUE));
names(setlist) <- paste("S", seq(along=setlist), sep="") 

## Compute an intersect matrix for all pairwise sample comparisons stored in 'setlist'
olMA <- sapply(names(setlist), function(x) sapply(names(setlist), function(y) sum(setlist[[x]] %in% setlist[[y]])))
olMA 

## Plot squared matrix as heat map
library("gplots")
heatmap.2(olMA, trace="none", Colv="none", Rowv="none", dendrogram="none", col=colorpanel(40, "darkred", "orange", "yellow"))

Here are some more examples to related problems:
http://faculty.ucr.edu/~tgirke/Documents/R_BioCond/R_BioCondManual.html#R_graphics_overlapper


T. Girke



On Thu, Jun 04, 2009 at 10:56:52AM -0400, Ivan Gregoretti wrote:
> Hello everyone,
> 
> How do I draw a pairwise comparison table?
> 
> Simplified example of the problem:
> 
> 1) lets say I have several sets of ChIP-seq peaks from several
> experiments: setA, setB, setC, etc. Many sets.
> 
> 2) I know how many peaks in common are held by each pair of sets. For
> instance, setA and setB have 300 peaks in common (overlaps). I can
> create a square matrix to hold all pairwise values.
> 
> 3) Now I want to draw something like a square table where both columns
> and rows are labelled setA, setB, setC, etc. In position [setA, setB]
> I would write 300 (and so I would on position [setB, setA]).
> 
> Is there any R function created to address this need? Perhaps
> something like a general purpose heat map?
> 
> Any pointer would be appreciated.
> 
> Ivan
> 
> Ivan Gregoretti, PhD
> National Institute of Diabetes and Digestive and Kidney Diseases
> National Institutes of Health
> 5 Memorial Dr, Building 5, Room 205.
> Bethesda, MD 20892. USA.
> Phone: 1-301-496-1592
> Fax: 1-301-496-9878
> 
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>



More information about the Bioc-sig-sequencing mailing list