我在 R 中做一个热图。我在 Exam$Design 中有几个注释,我想更改注释“条件”的颜色,因为从图中可以看出,它们看起来非常相似,但实际上并非如此(如在图例中看到,“条件”列中有 2 个变量)。
这是我正在使用的代码:
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")
输出如下:
我正在使用:R 版本 3.3.2 (2016-10-31) 平台:x86_64-apple-darwin13.4.0 (64-bit) 运行于:macOS Sierra 10.12.6
这是酵母_EM 数据的一个示例:
sample1 sample2 sample3 sample4 sample5
基因1 6.36905642 6.73133314 6.31220164 5.96876520 6.41847351
基因2 7.88187347 7.80500924 9.04985474 5.26179387 6.46439153
基因3 -0.93509624 1.08347695 4.03031906 3.34657410 -2.67209858
这就是 Exam$Design 数据框的样子:
strain condition batch replicate technician time week
sample1 wt exp A 生物学 1 BSc 上午工作日
样品 2 重量压力 A 生物 2 技术下午周末
sample3 mut exp A 生物学 3 BSc 下午工作日
sample4 mut stress A 生物学 4 BSc 下午工作日
谁能帮忙?