gplot heatmap: row names as numbers rather than gene names
1
0
Entering edit mode
4.5 years ago

My data structure: Firts Column is Gene_ID

library(RColorBrewer)
library(heatmap.plus)
library(gplots)
EZ2_Sorted <- read_csv("EZ2 Sorted.csv")
data1<-as.matrix(EZ2_Sorted[,2:7]) # 1st column gene ID #I have total 8 columns 
heatmap.2(data1, trace = "none", density = "none", col = bluered(20),cexRow = 1, margins = c(10,12), Rowv= FALSE,Colv = FALSE)

I have tried fallowing code, but didn't help

row.names<-row.names(data1[1,])

Kindly help me Thanking you in Advance

R • 1.0k views
ADD COMMENT
1
Entering edit mode
4.5 years ago
Asaf 10k

You should write instead:

row.names(data1) <- EZ2_sorted[,1]

Or even better, define row names when you read the csv file using read.csv instead of read_csv:

EZ2_Sorted <- read.csv("EZ2 Sorted.csv", row.names=1)
ADD COMMENT
0
Entering edit mode

Vooow, that was quick and it worked perfectly. Many Thanks to you :).

ADD REPLY

Login before adding your answer.

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