簡體   English   中英

基因表達和蛋白質表達之間具有Spearman相關系數的熱圖

[英]Heatmap with Spearman correlation coefficient between gene expression and protein expression

我有興趣使用 Spearman 相關系數分析來關聯 2 個變量,如基因表達(基因符號和倍數變化)和蛋白質表達(基因符號和倍數變化),如圖 A 所示(Int. J. Mol. Sci. 2018, 19 (12), 3836; https://doi.org/10.3390/ijms19123836 )。 我在網上搜索以查看相關代碼,但這些代碼給出了具有 Spearman 相關性的熱圖,具有相同的 X 和 Y 軸變量,如圖 B 所示。 Easy Guides - Wiki - STHDA。我需要一個熱圖,顯示 1 軸 (var 1) 上的基因表達數據和其他軸 (var 2) 上的蛋白質表達的變量。提前致謝:!圖片鏈接: https://community.rstudio .com/t/heatmap-with-correlation-coefficient/100543

這對你有用嗎? 該示例取自對 heartmaply package 的介紹。

library(dplyr)
library(heatmaply)
library(dendextend)

x  <- mtcars %>%
  head() %>%
  as.matrix()

row_dend  <- x %>% 
  dist %>% 
  hclust %>% 
  as.dendrogram %>%
  set("branches_k_color", k = 3) %>% 
  set("branches_lwd", c(1, 3)) %>%
  ladderize
# rotate_DendSer(ser_weight = dist(x))
col_dend  <- x %>% 
  t %>% 
  dist %>% 
  hclust %>% 
  as.dendrogram %>%
  set("branches_k_color", k = 2) %>% 
  set("branches_lwd", c(1, 2)) %>%
  ladderize
#    rotate_DendSer(ser_weight = dist(t(x)))

heatmaply(
  percentize(x),
  Rowv = row_dend,
  Colv = col_dend
)

在此處輸入圖像描述

暫無
暫無

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

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