如何在R

时间:2017-12-04 04:28:58

标签: r pheatmap

我使用pheatmap并且我不知道如何设置数据框的断点,该数据框指定热图左侧显示的注释。我知道使用中断函数可以确定正在绘制的数据的中断,但是如何对添加到绘图中的注释执行相同操作?在这里我把代码示例:

library(pheatmap)
library(RColorBrewer)
library(ALL)
library(gplots)

data("ALL")
expressionData = exprs(ALL)

#setting breaks to 0 to 5 then 5.01 to 10
breaks = c(seq(0, 5, length.out = 101),seq(5.01, 10, length.out = 101))
breaks2 <- breaks

#setting colors
my_palette <- colorRampPalette(c("blue", "white", "red"))(n = 201)

#generation of the data from the gene that we want to put on the left side of our pheatmap
data_gene <- as.data.frame(expressionData[1:10,1])
colnames(data_gene) <- "gene"

#setting the annotation row and setting the color of data_gene
annotation_row = data.frame(data_gene)
ann_colors = list(gene= bluered(75))

#pheatmap
pheatmap(expressionData[1:10, ], color = my_palette, breaks = breaks2, annotation_row = annotation_row, annotation_colors = ann_colors)

pheatmap result image

这里,&#34;基因&#34;自动设置并从4到9.我们说我希望它们从0到5再到5.01到10.有谁知道怎么做?

0 个答案:

没有答案