Search
Question: gene names disapper from heatmap.2 after adding gene descripton
0
gravatar for mictadlo
11 months ago by
mictadlo0
mictadlo0 wrote:

Hi, after I added gene description to y <- DGEList(counts=rawCountTable, group=group, genes = merged.descriptions) the gene names have replaced by numbers

> logCPM <- cpm(y, prior.count=2, log=TRUE)
> head(y$genes)
   gene_name                                    gene_description
3  sp0000003                                                <NA>
4  sp0000004                                                <NA>
5  sp0000005                                          PUA domain
6  sp0000006 Sugar efflux transporter for intercellular exchange
8  sp0000008                                                <NA>
12 sp0000012                       Ankyrin repeats (many copies)
> y$samples$group
 [1] Root_tip.1.5 Root_tip.1.5 Root_tip.1.5 Root_tip.1.5 Leaves.1.5   Leaves.1.5  
 [7] Leaves.1.5   Leaves.1.5   Root_tip.2   Root_tip.2   Root_tip.2   Root_tip.2  
[13] Leaves.2     Leaves.2     Leaves.2     Leaves.2     Root_tip.3   Root_tip.3  
[19] Root_tip.3   Root_tip.3   Leaves.3     Leaves.3     Leaves.3     Leaves.3    
Levels: Leaves.1.5 Leaves.2 Leaves.3 Root_tip.1.5 Root_tip.2 Root_tip.3
> rownames(logCPM) <- row.names(y$genes$genes)
> colnames(logCPM) <- paste(y$samples$group, 1:2, sep="-")
> o <- order(tr$table$PValue)
> logCPM <- logCPM[o[1:30],]
> logCPM <- t(scale(t(logCPM)))
> library(gplots)
> col.pan <- colorpanel(100, "blue", "white", "red")
> heatmap.2(logCPM, col=col.pan, Rowv=TRUE, scale="none",
+           trace="none", dendrogram="both", cexRow=0.6, cexCol=0.6, density.info="none")

How is it possible to get back the gene names in heatmap.2?

Best wishes,

ADD COMMENTlink modified 11 months ago • written 11 months ago by mictadlo0
0
gravatar for mictadlo
11 months ago by
mictadlo0
mictadlo0 wrote:

I think I found the solution rownames(logCPM) <- as.character(row.names(y)).

ADD COMMENTlink written 11 months ago by mictadlo0

Actually logCPM already had those row names when you created it. Then you removed the row names by

rownames(logCPM) <- row.names(y$genes$genes)

That removes the row names because you don't have any annotation column called "genes".

 

ADD REPLYlink modified 11 months ago • written 11 months ago by Gordon Smyth35k
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 2.2.0
Traffic: 270 users visited in the last hour