Hello
I'm using the following code to generate a heatmap for my data, like this
library(gplots)
getwd()
row.names(fold_change_cuttoff_at_2_cuttoff_at_2) <- fold_change_cuttoff_at_2$Gene
y <-data.matrix(fold_change_cuttoff_at_2)
y <- y[1:2162, 2:13]
y
?heatmap.2
??heatmap.2
heatmap.2(y, main = "Secretome Profile", trace ="none", margins = c(10,12))
yb <- colorRampPalette(c("white","yellow","orange","darkorange","red","darkred","black"))(n = 299)
heatmap.2(y, col=yb, main = "Secretome Profile", trace ="none", margins = c(5,15), cexRow = 0.7)
However, because I have many null values (some genes appear as differentially expressed in some tumors, but not others) I get a pretty weird looking heatmap, as I replaced NAs with 0s. So, is there anyway to generate a heatmap anyway, but with the NAs as, say, gray?
I do this by replacing
NA
with"NA"
and assigning a color to"NA"
. Maybe there's a better way?