multiple ColSideColors-type annotations on a heatmap
2
0
Entering edit mode
Levi Waldron ★ 1.1k
@levi-waldron-3429
Last seen 5 hours ago
CUNY Graduate School of Public Health a…
Can someone recommend a more sophisticated way to annotate heatmaps than the ColSideColors argument of heatmap and heatmap.2? In particular, I would like to be able to annotate columns with more than one piece of information, like in Figure 1 of the article at http://www3.interscience.wiley.com/cgi- bin/fulltext/117905619/HTMLSTART / doi:10.1002/hep.22256. Some example data and a heatmap: set.seed(1) y <- matrix(rnorm(100),nrow=20,ncol=5) colnames(x) <- LETTERS[1:5] rownames(x) <- paste("r",1:20,sep="") set.seed(1) annotation <- matrix(sample(c("+","-"),15,replace=TRUE),ncol=5) colnames(annotation) <- colnames(x) rownames(annotation) <- paste("annotation",1:3) heatmap(x,Rowv=NA, ColSideColors=sapply(annotation[1,],function(x) switch(x,"+"="red","-"="blue"))) This heatmap annotates the columns by the first of the three annotations with a colored bar along the top of the heatmap, but ideally I would like to put all three annotations on the heatmap by putting three rows of +/- symbols between the top of the heatmap and the dendrogram, or alternatively three colored bars. Specific or general suggestions would be welcome. Thank you, Levi -- Levi Waldron post-doctoral fellow Jurisica Lab, Ontario Cancer Institute Division of Signaling Biology IBM Life Sciences Discovery Centre TMDT 9-304D 101 College Street Toronto, Ontario M5G 1L7 (416)581-7453 [[alternative HTML version deleted]]
Cancer annotate Cancer annotate • 6.2k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
On Fri, May 1, 2009 at 1:53 PM, Levi Waldron <lwaldron.research@gmail.com>wrote: > Can someone recommend a more sophisticated way to annotate heatmaps than > the > ColSideColors argument of heatmap and heatmap.2? In particular, I would > like to be able to annotate columns with more than one piece of > information, > like in Figure 1 of the article at > http://www3.interscience.wiley.com/cgi- bin/fulltext/117905619/HTMLSTART / > doi:10.1002/hep.22256. > > Some example data and a heatmap: > > set.seed(1) > y <- matrix(rnorm(100),nrow=20,ncol=5) > colnames(x) <- LETTERS[1:5] > rownames(x) <- paste("r",1:20,sep="") > set.seed(1) > annotation <- matrix(sample(c("+","-"),15,replace=TRUE),ncol=5) > colnames(annotation) <- colnames(x) > rownames(annotation) <- paste("annotation",1:3) > > heatmap(x,Rowv=NA, > ColSideColors=sapply(annotation[1,],function(x) > switch(x,"+"="red","-"="blue"))) > > This heatmap annotates the columns by the first of the three annotations > with a colored bar along the top of the heatmap, but ideally I would like > to > put all three annotations on the heatmap by putting three rows of +/- > symbols between the top of the heatmap and the dendrogram, or alternatively > three colored bars. Specific or general suggestions would be welcome. > You might check out the HeatPlus package. Also, there are probably some threads in the archives. Sean [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
James F. Reid ▴ 610
@james-f-reid-3148
Last seen 10.2 years ago
Hi Levi, maybe Heatplus is what you are looking for: <http: www.bioconductor.org="" packages="" release="" bioc="" html="" heatplus.html=""> HTH. J. Levi Waldron wrote: > Can someone recommend a more sophisticated way to annotate heatmaps than the > ColSideColors argument of heatmap and heatmap.2? In particular, I would > like to be able to annotate columns with more than one piece of information, > like in Figure 1 of the article at > http://www3.interscience.wiley.com/cgi- bin/fulltext/117905619/HTMLSTART / > doi:10.1002/hep.22256. > > Some example data and a heatmap: > > set.seed(1) > y <- matrix(rnorm(100),nrow=20,ncol=5) > colnames(x) <- LETTERS[1:5] > rownames(x) <- paste("r",1:20,sep="") > set.seed(1) > annotation <- matrix(sample(c("+","-"),15,replace=TRUE),ncol=5) > colnames(annotation) <- colnames(x) > rownames(annotation) <- paste("annotation",1:3) > > heatmap(x,Rowv=NA, > ColSideColors=sapply(annotation[1,],function(x) > switch(x,"+"="red","-"="blue"))) > > This heatmap annotates the columns by the first of the three annotations > with a colored bar along the top of the heatmap, but ideally I would like to > put all three annotations on the heatmap by putting three rows of +/- > symbols between the top of the heatmap and the dendrogram, or alternatively > three colored bars. Specific or general suggestions would be welcome. > > Thank you, > Levi >
ADD COMMENT
0
Entering edit mode
Very nice, thank you James and Sean. -levi On Fri, May 1, 2009 at 2:28 PM, James F. Reid <james.reid@ifom-ieo- campus.it=""> wrote: > Hi Levi, > > maybe Heatplus is what you are looking for: > <http: www.bioconductor.org="" packages="" release="" bioc="" html="" heatplus.html=""> > > HTH. > J. > > > Levi Waldron wrote: > >> Can someone recommend a more sophisticated way to annotate heatmaps than >> the >> ColSideColors argument of heatmap and heatmap.2? In particular, I would >> like to be able to annotate columns with more than one piece of >> information, >> like in Figure 1 of the article at >> http://www3.interscience.wiley.com/cgi- bin/fulltext/117905619/HTMLSTART / >> doi:10.1002/hep.22256. >> >> Some example data and a heatmap: >> >> set.seed(1) >> y <- matrix(rnorm(100),nrow=20,ncol=5) >> colnames(x) <- LETTERS[1:5] >> rownames(x) <- paste("r",1:20,sep="") >> set.seed(1) >> annotation <- matrix(sample(c("+","-"),15,replace=TRUE),ncol=5) >> colnames(annotation) <- colnames(x) >> rownames(annotation) <- paste("annotation",1:3) >> >> heatmap(x,Rowv=NA, >> ColSideColors=sapply(annotation[1,],function(x) >> switch(x,"+"="red","-"="blue"))) >> >> This heatmap annotates the columns by the first of the three annotations >> with a colored bar along the top of the heatmap, but ideally I would like >> to >> put all three annotations on the heatmap by putting three rows of +/- >> symbols between the top of the heatmap and the dendrogram, or >> alternatively >> three colored bars. Specific or general suggestions would be welcome. >> >> Thank you, >> Levi >> >> -- Levi Waldron post-doctoral fellow Jurisica Lab, Ontario Cancer Institute Division of Signaling Biology IBM Life Sciences Discovery Centre TMDT 9-304D 101 College Street Toronto, Ontario M5G 1L7 (416)581-7453 [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 581 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6