簡體   English   中英

將集群關聯到熱圖

[英]Association Clusters to Heatmap

我有兩個單獨的數據框,其中一個我已經從第一個 dataframe 創建了一個熱圖,但是我想添加一個側邊欄,指示基因實際上與之相關的家族類型。

Dataframe 1

BGC1     BGC2    Distance
-----------------------------------------------
BGC31     BGC34     0.6
BGC34     BGC45     0.7
BGC34     BGC53     0.2
BGC53     BGC31     0.8

數據框2

BGC1     Association  
----------------------------------
BGC31     Skin Cancer
BGC34     Skin Cancer     
BGC34     Lung Cancer     
BGC53     Liver Cancer

熱圖創建:

p3 <- heatmap.3(comat, scale = "none", trace = "none", col = color,  main="GCF Co-Occurrence Map"
                ,lhei=c(0.5,1),  keysize=0.5, cexRow = 0.60, cexCol = 0.65)

我正在尋找這樣的東西,其中每種顏色代表一種與特定基因 class 相關的基因簇:

在此處輸入圖像描述

查看 heatmaply 手冊中的“使用 RowSideColors 添加基於其他因素的注釋”部分:

https://talgalili.github.io/heatmaply/articles/heatmaply.html#adding-annotation-based-on-additional-factors-using-rowsidecolors

x  <- as.matrix(datasets::mtcars)
rc <- colorspace::rainbow_hcl(nrow(x))

heatmaply(
  x[, -c(8, 9)],
  seriate = "mean",
  col_side_colors = c(rep(0, 5), rep(1, 4)),
  row_side_colors = x[, 8:9]
)

結果:

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM