Any way to ouput the reordered gene list from heatmap.2()?
2
0
Entering edit mode
@julinaecomyuedu-1967
Last seen 10.3 years ago
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()? 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]]
• 6.4k views
ADD COMMENT
0
Entering edit mode
@steve-lianoglou-2771
Last seen 22 months ago
United States
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
ADD COMMENT
0
Entering edit mode
Di Wu ▴ 190
@di-wu-1837
Last seen 10.3 years ago
What I will do is as following. heat<- heatmap.2(ht,Rowv=TRUE,Colv=...., main="297 genes with high fold change") rownames(ht)[heat$rowInd] > This should give you the gene list from the bottom to the up. Cheers, Di b$rowInd[1:20] [1] 12 6 36 26 22 11 5 1 42 7 27 64 84 97 100 51 79 65 76 87 > lab.HSA0[ b$rowInd[1:20]] On Fri, Jan 22, 2010 at 4:20 AM, Juan Lin <julin@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()? > > > > 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@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 439 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