Hi,
I am a newbie in R language. Trying to make heatmap2 in R studio (latest version/Window). I tried to import csv, xls and trying all option but can't put gene names on heatmap. The data.matrix file doesn't recognise first column at all.
I also tried:
> x <- read.csv("~/Configuration/Desktop/Chapter1/TFs.csv", sep = ",")
> row.names(TFs) <- TFs$Names
> x <- read.csv("~/Configuration/Desktop/Chapter1/TFs.csv", sep = ",")
> x
Name JG11LC ICCV2LC JG11C ICCV2C
1 Ca01823 2.7 1.2 1.3 -0.3
2 Ca02518 -1.3 -2.4 -1.2 -2.3
3 Ca02645 2.6 -0.7 -0.8 -0.1
4 Ca03029 -0.5 0.0 0.0 0.0
5 Ca03418 0.5 -0.1 0.9 -0.8
6 Ca03510 3.0 2.7 -0.7 -0.5
7 Ca03580 6.4 -1.0 0.4 0.7
> TFs <- TFs[,2:6]
Error: Invalid column indexes: 5, 6
And the resulting heatmap is without gene names on the rows (attached).
The code I am using is:
library(gplots)
library(edgeR)
myclust<-function(c) { hclust(c,method='ward.D2') }
x<-data.matrix(TFs)
heatmap.2(x,distfun=dist,dendrogram="both",hclustfun=myclust,trace="none",density.info="none",cexRow=0.8,cexCol=0.8,las=2,col=redgreen(75),lhei=c(1.4,6),sepcolor="black", sepwidth0.1,margin=c(10,12),scale="row",Rowv =TRUE,Colv=TRUE, key=T)
I never had this problem with old version of R studio. Please help!
I am a newbie in R language. Trying to make heatmap2 in R studio (latest version/Window). I tried to import csv, xls and trying all option but can't put gene names on heatmap. The data.matrix file doesn't recognise first column at all.
I also tried:
> x <- read.csv("~/Configuration/Desktop/Chapter1/TFs.csv", sep = ",")
> row.names(TFs) <- TFs$Names
> x <- read.csv("~/Configuration/Desktop/Chapter1/TFs.csv", sep = ",")
> x
Name JG11LC ICCV2LC JG11C ICCV2C
1 Ca01823 2.7 1.2 1.3 -0.3
2 Ca02518 -1.3 -2.4 -1.2 -2.3
3 Ca02645 2.6 -0.7 -0.8 -0.1
4 Ca03029 -0.5 0.0 0.0 0.0
5 Ca03418 0.5 -0.1 0.9 -0.8
6 Ca03510 3.0 2.7 -0.7 -0.5
7 Ca03580 6.4 -1.0 0.4 0.7
> TFs <- TFs[,2:6]
Error: Invalid column indexes: 5, 6
And the resulting heatmap is without gene names on the rows (attached).
The code I am using is:
library(gplots)
library(edgeR)
myclust<-function(c) { hclust(c,method='ward.D2') }
x<-data.matrix(TFs)
heatmap.2(x,distfun=dist,dendrogram="both",hclustfun=myclust,trace="none",density.info="none",cexRow=0.8,cexCol=0.8,las=2,col=redgreen(75),lhei=c(1.4,6),sepcolor="black", sepwidth0.1,margin=c(10,12),scale="row",Rowv =TRUE,Colv=TRUE, key=T)
I never had this problem with old version of R studio. Please help!
Comment