[英]Heatmap with Spearman correlation coefficient between gene expression and protein expression
I am interested to correlate 2 variables like gene expression (gene symbols and fold change) and protein expression (gene symbols and fold change) using Spearman correlation coefficient analysis as depicted in Fig. A ( Int. J. Mol. Sci. 2018, 19 (12), 3836; https://doi.org/10.3390/ijms19123836 ).我有兴趣使用 Spearman 相关系数分析来关联 2 个变量,如基因表达(基因符号和倍数变化)和蛋白质表达(基因符号和倍数变化),如图 A 所示(Int. J. Mol. Sci. 2018, 19 (12), 3836; https://doi.org/10.3390/ijms19123836 )。 I searched on the net to see the code for correlation but these codes give the heatmaps with Spearman correlation with same X and Y axis variables as can be seen in Fig. B. ( ggplot2: Quick correlation matrix heatmap - R software and data visualization - Easy Guides - Wiki - STHDA. I need a heatmap showing variables from gene expression data on 1 axis (var 1) and protein expression on other axis (var 2). Thanks in advance:! Image link: https://community.rstudio.com/t/heatmap-with-correlation-coefficient/100543
我在网上搜索以查看相关代码,但这些代码给出了具有 Spearman 相关性的热图,具有相同的 X 和 Y 轴变量,如图 B 所示。 Easy Guides - Wiki - STHDA。我需要一个热图,显示 1 轴 (var 1) 上的基因表达数据和其他轴 (var 2) 上的蛋白质表达的变量。提前致谢:!图片链接: https://community.rstudio .com/t/heatmap-with-correlation-coefficient/100543
Would this work for you?这对你有用吗? The example is taken from Introduction to the hearmaply package.
该示例取自对 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.