I am doing a heatmap in R. I have several annotations in the Exam$Design and I would like to change the colors of the annotation 'condition' because as you can see from the plot they look very similar but in fact are not (as seen in the legent there are 2 variables in the 'condition' column).
This is the code i am using:
pheatmap::pheatmap(
mat=yeast_EM,
kmeans_k=100,
annotation_col=Exam$Design,
scale = "row",
cellwidth = 15,
cellheight = 12,
fontsize = 8,
color = brewer.pal(name = "Spectral", n = 10),
filename = "heat_map.png")
And the output is the following:
I am using: R version 3.3.2 (2016-10-31) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS Sierra 10.12.6
This is an example of the yeast_EM data:
sample1 sample2 sample3 sample4 sample5
gene1 6.36905642 6.73133314 6.31220164 5.96876520 6.41847351
gene2 7.88187347 7.80500924 9.04985474 5.26179387 6.46439153
gene3 -0.93509624 1.08347695 4.03031906 3.34657410 -2.67209858
And this is how the Exam$Design dataframe looks like:
strain condition batch replicate technician time week
sample1 wt exp A biological1 BSc morning workday
sample2 wt stress A biological2 Tech afternoon weekend
sample3 mut exp A biological3 BSc afternoon workday
sample4 mut stress A biological4 BSc afternoon workday
can anyone help?