Entering edit mode
2.4 years ago
Why am I not getting annotated colours in the row annotation box for respective genes?
I am extreme new to R. Can anyone suugest better way to do this?
I have used this code for my dataset to give row annotation and color.
I have converted the .csv file to matrix and then I used folllowing codes to give row annotation and colors
#convert from df to matrix
nitro_mat <- data.matrix(nitro)
annotation_row = data.frame(GeneClass = factor(rep(c("Path1", "Path2", "Path3"), c(20, 14, 15))))
ann_colors = list(GeneClass = c(Path1 = "#7570B3", Path2 = "#E7298A", Path3 = "#66A61E"))
pheatmap(nitro_mat, scale = "row", cellwidth = 10, cellheight = 8, cluster_cols = T, annotation_row = annotation_row, annotation_colors = ann_colors)
Finally I am getting this output, why?
I've cleaned up your post and title - in the future, please ensure your post doesn't have typos and your title is clear
If you're just starting on heatmap software, I'd recommend using ComplexHeatmap instead of pheatmap - CH has better (and more well-defined) features, and the guide is comprehensive.
Thanks sir for your valuable response, I will take care in the future