0
我正在嘗試使用complexheatmap包創建一個heatmap。除了我在整個劇情中只能看到黑色外,一切都在起作用。我認爲正確的色彩分離應該做的伎倆,但我不知道如何解決這個問題:(如何使Complexheatmap包中的顏色中斷
#load required libraries
library(extrafont)
#font_import() # only one time required when first time use the library extrafont
#y
fonts()
loadfonts()
library(ComplexHeatmap)
library(circlize)
#upload expression data
#heatdata<- read.table("probe.expression",header=TRUE,row.names=1)
dim(heatdata)
head(heatdata)
#scale row
rm <- rowMeans(heatdata)
sx <- apply(heatdata, 1, sd)
zz <- sweep(heatdata,1,rm)
zz <- sweep(zz, 1, sx, "/")
zzz <- t(scale(t(heatdata)))
Heatmap(zzz,
name = "Color key", # legend title
rect_gp = gpar(col = "black"), # cell border
column_title = "Tissue",
column_title_side = "top",
row_title = "Genes",
row_title_side = "left",
clustering_distance_rows = "pearson", #"euclidean", "maximum", "man-
#hattan", "canberra", "binary", "minkowski", #"pearson", #"spearman", "kendall"
row_dend_side = "left", #should the row cluster be put on the left or right of the heatmap?
#row_name_side = "right", #should the row cluster be put on the left or right of the heatmap?
show_row_names = FALSE,
column_dend_height = unit(3,"cm"),
show_column_dend = FALSE,
show_column_names= FALSE,
#bottom_annotation = ha,
#bottom_annotation_height = unit(1, "cm"),
col = colorRamp2(c(-2, 0,10),c("green","black", "red"))
)
和
min(zzz)
給-1.96339而
max(zzz)
了9.238137我的最終情節看起來像這樣
測試數據可以發現HERE
嗨顧,謝謝你解決我的問題。我想使用複雜的熱圖生成一個像https://openi.nlm.nih.gov/imgs/512/210/3118787/PMC3118787_1471-2164-12-252-4.png這樣的圖像。你能提出一些我應該使用的參數嗎? – pali