[BioC] Any way to ouput the reordered gene list from heatmap.2()?
Steve Lianoglou
mailinglist.honeypot at gmail.com
Thu Jan 21 18:40:09 CET 2010
Hi Juan,
On Thu, Jan 21, 2010 at 12:20 PM, Juan Lin <julin at aecom.yu.edu> wrote:
> Hi dear all
>
> I am using the heatmap.2 function in the gplots package to draw a heatmap of
> 297 gene list. The plot looks very nice. But since the rows(genes) were
> reordered along with the dendrogram, is there any way to output this
> reordered gene list from heatmap.2()?
Yes ... take a closer look at the documentation for ?heatmap.2 and in
particular look at the "Value" section.
You'll see that you are (invisibly) returned a list that contains a
component named "rowInd" which contains the permutation of rows used
in the display. So, in your example, simply assign the returned value
from heatmap.2 to a variable, and grab the appropriate component, eg:
R> h <- heatmap.2(ht, Rowv=TRUE, ...)
R> h$rowInd
or
R> rownames(ht)[h$rowInd]
Hope that helps,
-steve
>
>
>
> The code I used is as below:
>
>
>
> heatmap.2(ht,Rowv=TRUE,Colv=FALSE,
>
> dendrogram= "row",
>
> labRow=rownames(ht),
>
> distfun = dist,
>
> hclustfun = hclust,
>
> key=TRUE,
>
> keysize=1,
>
> lhei=c(0.5,4.5),
>
> trace="none",
>
> density.info="none",
>
> margins=c(3,8),
>
> col=rev(redgreen(256)),
>
> main="297 genes with high fold change"
>
> )
>
> Many thanks!
>
> Juan
>
> -----------------------------
>
> Juan Lin
>
> Faculty Associate
>
> Department of Epidemiology and Population Health
>
> Albert Einstein College of Medicine
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> 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
>
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact
More information about the Bioconductor
mailing list