微生物共现网络模块的遗传发育特征分析

  对微生物OTU表进行网络分析有利于我们进一步挖掘微生物群落格局背后的构建因素。影响微生物共现网络的两个主要因素为:环境筛选和微生物交互作用,而这两者背后都有一个共同的影响因素——遗传发育特征。我们之前介绍了如何探究环境因子对微生物共现网络的影响,这里我们将分析微生物共现网络模块的遗传发育特征,以期回答这样一个问题:属于同一模块的OTUs是否具有更相似的遗传发育特征?

1. Load R package

library(igraph)
library(vegan)
library(picante)
library(ape)

2. Load test data

igraph <- read_graph("~/Desktop/htl_data_analysis/R code/netwok and env/mygraph.graphml",format="graphml")
tree <- read.tree("~/Desktop/htl_data_analysis/R code/netwok and env/tree")
nifh_otu2 <- read.delim("~/Desktop/htl_data_analysis/R code/netwok and env/nifh_otu.txt", row.names=1)

3. Modular division and get the top 4 cluster ID

wtc <- cluster_louvain(igraph,NA)
modularity(wtc)
V(igraph)$module<-membership(wtc)
modtop4 <- order(tabulate(membership(wtc)),decreasing=TRUE)[1:4] 

4. Build new OTU table for NTI analysis

rlen <- length(modtop4)+1
#clen <- sum(tabulate(membership(wtc))[modtop4])
clen <- ncol(nifh_otu2)
#otu_new <- matrix(rep(0,rlen*clen),rlen,clen,dimnames=list(modtop4,V(igraph)$name[V(igraph)$module%in%modtop4]))
otu_new <- matrix(rep(0,rlen*clen),rlen,clen,dimnames=list(c(modtop4,"other"),colnames(nifh_otu2)))
for (i in 1:rlen){
  if (i < rlen){
    otu_new[i,] = as.integer(colnames(otu_new) %in% V(igraph)$name[V(igraph)$module==modtop4[i]])
  }
  else{
    otu_new[i,] = as.integer(!(colnames(otu_new) %in% V(igraph)$name[V(igraph)$module %in% modtop4]))
  }
}
otu_new[1:5,1:5]

5. Tidy the tree and OTU table data for NTI analysis

tree$tip.label <- stringr::str_replace_all(tree$tip.label,"'","")

prune_tree<-prune.sample(nifh_otu2,tree)
tip<-prune_tree$tip.label
coln<-colnames(otu_new)
m<-NULL
print("These OTUs don't exist in phylogenetic tree")
for(i in 1:length(coln)){
  if(!coln[i]%in%tip){
    print(coln[i])
    m<-cbind(m,coln[i])
  }
}
m<-as.vector(m)
otu_new2<-otu_new[,!colnames(otu_new)%in%m]

6. Get the NTI result of each cluster

otu_phydist <- cophenetic(prune_tree)
mntd_wei<-ses.mntd(otu_new2, otu_phydist, null.model="taxa.labels", abundance.weighted=FALSE, runs=999)

[1] 运行效果可查看如下链接:
运行效果:https://rpubs.com/longroad/884091
[2] 测试数据及源代码可查看如下链接:
面包多:探究共现网络遗传发育特征测试数据及源代码
[2] 更多R语言分析微生物生态学的资源可参考如下链接:
https://mbd.pub/o/bread/mbd-YpmTlZpr

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
微生物R语言相似性分析主要通过统计分析方法来研究微生物共现网络模块遗传发育特征。根据研究,我们可以使用R语言进行生物群落数据的统计分析。R语言是一个开源、自由且免费的编程语言,广泛应用于生物群落数据的统计分析。它提供了多样且复杂的统计分析方法,包括回归和混合效应模型、多元统计分析技术以及结构方程等数量分析方法。通过R语言,可以对微生物共现网络遗传发育特征进行相似性分析。 在微生物R语言相似性分析中,常用的方法包括非约束排序和约束排序。非约束排序方法如主成分分析(PCA)、对应分析(CA)、主坐标分析(PCoA)和非度量多维尺度分析(NMDS)等。这些方法可以帮助我们理解微生物共现模式中的变异情况,并帮助我们发现潜在的群落结构。 而约束排序方法如冗余分析(RDA)、双冗余分析(dbRDA)和典型对应分析(CCA)等。这些方法可以帮助我们确定与环境因子相关的微生物共现模式,进一步揭示微生物的功能和适应性。 总之,微生物R语言相似性分析提供了丰富的统计方法和工具,可以帮助我们探索微生物共现网络模块遗传发育特征。通过这些分析,我们可以深入了解微生物之间的相互作用和遗传关系。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

道阻且长1994

您的鼓励有助于我创作更多高质量

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值