简体   繁体   English

使用heatmaply R的相关热图

[英]correlation heatmap using heatmaply R

I'm trying to create an heatmap on the base of spearman correlation and with dendrogramm corresponding to spearman correlation values.我正在尝试基于 spearman 相关性和与 spearman 相关值对应的树状图创建热图。 My input file is composed as follow:我的输入文件组成如下:

 > data[1:6,1:6]
         group EG   PN        C0      C10     C10.1
    1 Patients 24  729 352.66598 43.80707  75.16226
    2 Patients 24  729 195.48486 17.15763  33.60365
    3 Patients 24  729 106.85937 15.13400  34.47340
    4 Patients 27 1060  76.70645 14.98315  22.09885
    5 Patients 27 1060 354.07169 50.61995  98.36765
    6 Patients 27 1060 331.84956 92.00343 125.46658
> data[150:160,1:6]
       group EG   PN        C0       C10     C10.1
150 Controls 27 1011  99.94756  9.018773 20.207498
151 Controls 30  616 300.20203 25.667548 37.363280
152 Controls 30  616 190.38030 18.811198 46.417332
153 Controls 26  930  79.44666  7.801935  4.569444
154 Controls 24  724 381.74026 39.842241 42.144842
155 Controls 24  724 191.39962 19.008729 31.064398

I'm able to made up a simple correlation plot but i would like to create an unique heatmap with both protein and subjects dendrogram on the base on spearman correlation.我能够制作一个简单的相关图,但我想创建一个独特的热图,其中包含基于 spearman 相关性的蛋白质和主题树状图。 Does anyone know how to do?有谁知道怎么办? thanks in advance提前致谢

The following code displays an interactive heatmap using Spearman's rank correlation to cluster both rows and columns (in this case for the mtcars dataset).以下代码显示了一个交互式热图,使用 Spearman 的秩相关对行和列进行聚类(在本例中为mtcars数据集)。

heatmaply(mtcars, 
    distfun = function(x) as.dist(1 - cor(t(x), method="spearman")))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM