[BioC] Outputting dendrogram with large numbers of genes without losing resolution

Thomas Girke thomas.girke at ucr.edu
Thu Jul 12 17:38:16 CEST 2007


Sean's suggestion, of using an external image or pdf viewing program
for this task, works actually pretty well for heatmaps with several 
thousand genes. Below is an example for exporting a heatmap with 500
rows to a pdf file. The important step is the adjustment of the height 
argument in the pdf() function. The pdf format has the advantage over 
jpg/png formats that text components (e.g. gene names) are searchable 
in a decent pdf viewing program.

## Large heatmap example
y <- matrix(rnorm(2500), 500, 5, dimnames=list(paste("g", 1:500, sep=""), paste("t", 1:5, sep=""))) 
hr <- hclust(as.dist(1-cor(t(y), method="pearson")), method="complete")
hc <- hclust(as.dist(1-cor(y, method="pearson")), method="complete") 
library("gplots") 
pdf("test.pdf", width=6, height=48)
heatmap.2(y, Rowv=as.dendrogram(hr), Colv=as.dendrogram(hc),
		labRow=paste("g", 1:500, sep=""), col=redgreen(75),
		scale="row", trace="none", key=F)
dev.off()
	

Thomas




On Thu 07/12/07 09:11, Sean Davis wrote:
> Marie Chehani Alles wrote:
> > Dear Listserv,
> > 
> > I???m attempting to do heatmaps on large lists of genes (often well over 500 genes in each list) using heatmap.2(). Does anyone know how to output a large heatmap without losing resolution in the dendrogram? When a large list of genes is clustered (with genes on the horizontal axis), the horizontal dendrogram is often squashed so that the lines become indistinct, even when the plot area is set to its maximum. 
> > 
> > I am wondering if there is some way of setting up the R graphics so that I can assign a fixed width to each arm of the dendrogram... say a height of x pixels per gene? Or does anyone know of any other work-arounds for this issue? This must be a common problem so maybe I'm googling the wrong words!
> > 
> > Please let me know if this is an issue for the R-listserv rather than Bioconductor.
> 
> Unfortunately, screen size is limited.  If you really must use R for
> this task, then try making a large pdf or png of the same plot (say 35
> inches high by 10 inches wide).  Then, you can use an external program
> to view the resulting file.
> 
> The better alternative is to use a program such as TreeView (and,
> potentially its close relative "cluster") to interact with such large
> heatmaps.  It is available for free and is a java program, so it works
> on many platforms.
> 
> Sean
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
-- 
Thomas Girke
Assistant Professor of Bioinformatics
Director, IIGB Bioinformatic Facility
Center for Plant Cell Biology (CEPCEB)
Institute for Integrative Genome Biology (IIGB)
Department of Botany and Plant Sciences
1008 Noel T. Keen Hall
University of California
Riverside, CA 92521

E-mail: thomas.girke at ucr.edu
Website: http://faculty.ucr.edu/~tgirke
Ph: 951-827-2469
Fax: 951-827-4437



More information about the Bioconductor mailing list