Question: Row label in heatmap
0
gravatar for krushnach80
2.5 years ago by
krushnach80590
krushnach80590 wrote:

I have data frame like this about 250 gene i taking a small subset of it

gene     `WT`           `Treated`
ACTL6A  4.5167211886    4.4304190975
ACTL6B  -4.3730103378 -9.800779238
ACTR5   1.3871253811    1.2086608355

I am plotting heatmap since I m using pheatmap since plotting requires a matrix that is I have to use the only the numeric matrix I m doing something like this rownames(VD3) <- data[,1]

mat <- as.matrix(data[,-1])

I can plot the heatmap but Im missing my gene name labels , How can i include it in my final plot ,any suggestion ?And Im using the pheatmap library

R • 2.3k views
ADD COMMENTlink modified 2.1 years ago by Biostar ♦♦ 20 • written 2.5 years ago by krushnach80590

Can you show the code and output you are getting?

ADD REPLYlink written 2.5 years ago by Deepak Tanwar4.0k
pheatmap(mat,show_rownames=T,col=mycol,breaks=bk,cluster_cols=T,cluster_rows=T,cex=0.9,clustering_distance_rows = "euclidean", clustering_distance_cols = "euclidean", clustering_method = "complete"

+ )

I have no issue in getting the heatmap but it seems that after plotting the gene names are not annotated

ADD REPLYlink written 2.5 years ago by krushnach80590
3
gravatar for theobroma22
2.5 years ago by
theobroma221.1k
theobroma221.1k wrote:

Your code is a bit confusing. You can assign the rownames to the matrix.

Mat = as.matrix( data[,-1])
rownames(Mat) = as.character( data[,1])
head(Mat)
class(Mat)

Did this help you?

ADD COMMENTlink written 2.5 years ago by theobroma221.1k

i will try your suggestion i did figure out

ADD REPLYlink written 2.5 years ago by krushnach80590
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.3.0
Traffic: 3362 users visited in the last hour