Getting Gene Name From Heatmap.2
1
4
Entering edit mode
13.1 years ago
Ly ▴ 130

Hello,

I am trying to get a list/table of genes from my heatmap. I am using the limma package to generate my gene list and then graphed it using gplots with the function heatmap.2 (see below). However, when I try to get the gene list, I can only get a list of the feature numbers and not the labRow names that I had directed to in the heatmap.2 function. Does anyone know how to cross reference the list of feature numbers that I got here back to the GeneName on my heatmap?

Thanks in advance, Ly

Tumor.c<-topTable(fit2,coef=4, n=500)

Tumor.c.FC<-Tumor.c$logFC

Tumor.t<-topTable(fit2,coef=5, n=500)

Tumor.T.FC<-Tumor.t$logFC

a<-cbind(Tumor.c.FC,Tumor.T.FC)

heatmap.2(a, labRow=Tumor.c$GeneName, col=greenred,Colv=FALSE)

geneName.a<-heatmap.2(a,labRow=Tumor.c$GeneName, col=greenred, Colv=FALSE)

geneName.a$rowInd

heatmap gene limma r • 9.1k views
ADD COMMENT
5
Entering edit mode
13.1 years ago

In your example, to get the GeneNames back, you simply use the geneName.a$rowInd vector to to do so, eg:

R> geneName.a<-heatmap.2(a,labRow=Tumor.c$GeneName, col=greenred, Colv=FALSE)
R> Tumor.c$GeneName[geneName.a$rowInd]

The order is "backwards" though, the first gene name that comes out of that is actually the last row of the heatmap.

ADD COMMENT

Login before adding your answer.

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