soil traits with k-means cluster

cluster with k-means

To select one traits in one cluster, simplify the gwas result

1. calculate the Pearson correlation coefficient by using R and plot

library(pheatmap)
data<-read.table("pro_alti_rm.cor",header=T,row.names = 1)
pdf(file="pro_soil.cor.pdf",height = 7,width = 7)
pheatmap(data,show_rownames = F,show_colnames = F)
dev.off()

heatmap for the correlation of soil properites

2. choose a suitable K

library("ClusterR")
corm<-as.matrix(read.table("pro_alti_rm.cor")) ## with the altitude trait and soil properites without enough data removed, so get a k in 11 not in 14
Optimal_Clusters_KMeans(corm,max_clusters=25,criterion="variance_explained") # do not minimize with AIC (with k=4)
k=11
bob<-KMeans_rcpp(corm,clusters=k)
clusters<-data.frame(colnames(corm),bob$clusters)
for (i in 1:11)  # randomly select one trait in a cluster
{
print (sample(clusters[which(clusters$bob.clusters==i),1],1))
}

vaiance explained k=11 ~10%

3. Manhattan plot for the 11 traits

manhattan plot

Question: lost the information like below, and lost the QTLs listed in supplementary table 16.

Such as: organic carbon in 0-0.045m
organic carbon in 0-0.045m

May consider PCA or:

If the soil properites under different depths are clusted together, pick 1 soil property.

For example, total carbon (16.6mm), total carbon (28.9mm), total N (16.6mm), total N (28.9) all for trait in 1 cluster, randomly select a trait in total carbon and total N, not just remain 1 trait in 1 cluster.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值