Question: multiple ColSideColors-type annotations on a heatmap
0
gravatar for Levi Waldron
10.6 years ago by
Levi Waldron980
CUNY Graduate School of Public Health and Health Policy, New York, NY
Levi Waldron980 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]]
cancer annotate • 3.6k views
ADD COMMENTlink modified 10.6 years ago by James F. Reid610 • written 10.6 years ago by Levi Waldron980
Answer: multiple ColSideColors-type annotations on a heatmap
0
gravatar for Sean Davis
10.6 years ago by
Sean Davis21k
United States
Sean Davis21k wrote:
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 COMMENTlink written 10.6 years ago by Sean Davis21k
Answer: multiple ColSideColors-type annotations on a heatmap
0
gravatar for James F. Reid
10.6 years ago by
James F. Reid610
James F. Reid610 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 >
ADD COMMENTlink written 10.6 years ago by James F. Reid610
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 REPLYlink written 10.6 years ago by Levi Waldron980
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 456 users visited in the last hour