美文网首页
生信笔记11-转录组下游分析之:样本间Spearman相关分析

生信笔记11-转录组下游分析之:样本间Spearman相关分析

作者: 江湾青年 | 来源:发表于2023-03-16 10:56 被阅读0次

pearson相关系数:适用于连续性变量,且变量服从正态分布的情况,为参数性的相关系数。

spearman相关系数:适用于连续性及分类型变量,为非参数性的相关系数。

library(corrplot)

meta_data_tmp <- read.csv('./data/meta.csv')
TPM <- read.csv('./data/transcriptome.csv')

#  R语言里自带的相关性分析的函数是cor(),默认的皮尔逊相关性分析,
sp.data<- cor(TPM, method = "spearman")
# 图展示
corrplot(sp.data,
         order = "AOE", # 指定相关系数排序的方法,可以是特征向量角序(AOE)、第一主成分顺序(FPC)、层次聚类顺序(hclust)
         type = "full", # 展示类型。默认为全显full,还有upper和lower
         addCoef.col = "grey")# 添加相关系数值

# hclust聚类展示 , 有框框
corrplot(sp.data, order = "hclust", addrect = 2, 
         rect.col = "black",hclust.method = "ward.D2",addCoef.col = "grey")


## 表格展示
library(PerformanceAnalytics)
chart.Correlation(sp.data,histogram = T,pch=19)

参考

https://www.jianshu.com/p/fc6fb815c170

相关文章

网友评论

      本文标题:生信笔记11-转录组下游分析之:样本间Spearman相关分析

      本文链接:https://www.haomeiwen.com/subject/kejlrdtx.html