pheatmapを使用して、式キーのインデックスと凡例キーをヒートマップの下部に表示する方法を教えてくれる人はいますか?次のコードを使用して、ヒートマップを生成できます。どうもありがとうございます!
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("Test", 1:10, sep = "")
rownames(test) = paste("Gene", 1:20, sep = "")
annotation_col = data.frame(
CellType = factor(rep(c("CT1", "CT2"), 5)), Time = c("A", "B", "C","D","E"))
rownames(annotation_col) = paste("Test",1:10, sep = "")
ann_colors = list(
Time = c(A = "white", B= "firebrick", C= "#fdbb84",D = "#e34a33", E = "red"),
CellType = c(CT1 = "#1B9E77", CT2 = "#D95F02"))
library("pheatmap")
pheatmap(test, annotation_col = annotation_col, annotation_colors = ann_colors)
pheatmapは、凡例の位置を制御する機能を提供していないようです。
ヒートマップを描画するコードは、https://github.com/raivokolde/pheatmapにあります。
R/pheatmap-package.r
ファイルをチェックしてください。
その伝説はかなりハードコーディングされているように見える、見る# Legend position
とdraw_legend = function(color, breaks, legend, ...
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加