use gene symbol in heatmap instead of ensemble geneID
1
0
Entering edit mode
24 months ago
Claire • 0

Hi All

I plot the heat map for my logCPM successfully but using Ensemble geneIDs. I need the heatmap to have the gene symbols, I can convert the ensemble gene IDs to gene IDs fine, but don't know how to reflect this on the heatmap. My code for the heatmap and my code for ensemble IDs to gene sybmol are below if any one can help where can I reflect the gene symbol in the heatmap, thanks very much

Heatmap

    logCPM =countsPerMillion
    o = rownames(etp$table[abs(etp$table$logFC)>2 & etp$table$FDR<0.01, ])
    logCPM = logCPM[o[1:25],]
    colnames(logCPM)  = LABELS
    logCPM = t(scale(t(logCPM)))
    require("RColorBrewer")
    require("gplots")
    myCol <- colorRampPalette(c("dodgerblue", "black", "yellow"))(25)
    myBreaks <- seq(-3, 3, length.out=26)
    heatmap.2(logCPM, col=myCol, breaks=myBreaks,symkey=F, Rowv=TRUE,Colv=TRUE, main=title, key=T, keysize=0.7,scale="none",trace="none", dendrogram="both", cexRow=0.7, cexCol=0.9, density.info="none",margin=c(10,9), lhei=c(2,10), lwid=c(2,6),reorderfun=function(d,w) reorder(d, w, agglo.FUN=mean),  distfun=function(x) as.dist(1-cor(t(x))), hclustfun=function(x) hclust(x, method="ward.D2"))

Naming conversions:

library(EnsDb.Hsapiens.v79) 
geneIDs <- ensembldb::select(EnsDb.Hsapiens.v79, keys= o, keytype = "GENEID", 
columns 
= c("SYMBOL","GENEID"))

Thanks all

rnaseq heatmap • 926 views
ADD COMMENT
3
Entering edit mode
24 months ago
fracarb8 ★ 1.6k

I never used heatmap.2, but usually setting the matrix rownames (rownames(logCPM)) to the GENEID values is enough. The convertion from ensemble to symbol is never painless, so you might need to check for duplicated or missing values.

ADD COMMENT
0
Entering edit mode

yes, when I use rownames(logCPM) to geneid I get not equal size error, that I can't get around, so may this is the issue, duplication and missings. Thanks fracarb8.

ADD REPLY
1
Entering edit mode

Yes, that's the problem. Unlike humans, not every gene got a name or a symbol and they are not unique either. Uniqueness can be overcome using make.names, but missing symbols not that easily.

ADD REPLY
0
Entering edit mode

Thanks Michael. I never used make.names, but will play around and see. Thank you

ADD REPLY

Login before adding your answer.

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