heatmap

1 可视化基因表达数据的常用方法是使用热图。 在这里,我们将使用R软件包Pheatmap对我们将要测试的一些基因表达数据进行此分析。
library(pheatmap)
set.seed(2)
test = matrix(rnorm(200), 20, 10)
test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3
test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2
test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4
colnames(test) = paste("Cell", 1:10, sep = "")
rownames(test) = paste("Gene", 1:20, sep = "")
pheatmap(test)
heatmap_第1张图片
屏幕快照 2020-07-09 下午1.06.28.png

Let’s try setting the number of gene clusters to 2:

pheatmap(test, kmeans_k = 2)
heatmap_第2张图片
屏幕快照 2020-07-09 下午1.08.47.png

Now we can see that the genes fall into two clusters - a cluster of 8 genes which are upregulated in cells 2, 10, 6, 4 and 8 relative to the other cells and a cluster of 12 genes which are downregulated in cells 2, 10, 6, 4 and 8 relative to the other cells.

你可能感兴趣的:(heatmap)