I have already asked this question how can I annotate my heat-map with respective genes or sample
mat<-matrix(ncol=2,nrow=4)
mat[,1]<-c(0.0387765,0.0306198,0,0)
mat[,2]<-c(0.0407321,0,0.00212375,0.0000484229)
colnames(mat)<-c("Value1","Value2")
rownames(mat)<-c("DDX11L1","AL627309.2","RP11-34P13.9","OR4F29")
pheatmap(mat)
this was the code i got and it works pretty good but since I gave that data was very small subset of my cuffdiff output .Now i want to do the same after filtering the cuffdiff output with some threshold value the dimension would be really huge.So I cannot use this code to construct the dataframe manually I suppose.I tried to convert the dataframe into matrix then add the gene name into the matrix when i try to plot I get this error
Error in hclust(d, method = method) :
I guess there is fundamentally wrong the way Im trying to do, any help or suggestion would be appreciated .
My filtered data filtered data set which I want to make heatmap
Your output is lacking the error message that normally follows the ':'
I tried with the normal heatmap function im getting the error "Error in heatmap(df) : 'x' must be a numeric matrix ". I guess as one of my column is character which contains the gene name ..
Likely, you should assign them using rownames and then remove that column, e.g.:
rownames(df) <- df[,1] so you are assigning rownames to the data frame while selecting only the column?
Assuming, the row names are in the first column, yes. If in doubt, look at the output of head(df). When converting to matrix, all remaining columns must be numeric, as a matrix can only consist of a single element type, otherwise you get a character matrix.
thank you every much it worked....