R语言:microeco:一个用于微生物群落生态学数据挖掘的R包,第六:trans_env class

#环境变量在分析微生物群落结构和组装机制方面是非常有用的。我们首先展示RDA分析(db-RDA和RDA)。

复制代码
> t1 <- trans_env$new(dataset = dataset, add_data = env_data_16S)
Env data is stored in object$data_env ...
> t1$cal_ordination(method = "RDA", use_measure = "bray")
No taxa_level provided; use Genus level automatically !
The original ordination result is stored in object$res_ordination ...
The R2 is stored in object$res_ordination_R2 ...
> t1$cal_ordination_envsquare()
Error: attempt to apply non-function
> t1$cal_ordination_envfit()
Result is stored in object$res_ordination_envfit ...
> t1$trans_ordination(adjust_arrow_length = TRUE, max_perc_env = 10)
The result list is stored in object$res_ordination_trans ...
> t1$plot_ordination(plot_color = "Group")

#Mantel检验可以检验环境变量与距离矩阵之间是否存在显著的相关关系。

复制代码
> t1$cal_mantel(use_measure = "bray")
The result is stored in object$res_mantel ...
> t1$res_mantel
   by_group     Variables mantel type Correlation method Correlation coefficient p.value  p.adjusted Significance
1       All      Latitude mantel test            pearson              0.52010091   0.001 0.001375000           **
2       All     Longitude mantel test            pearson              0.37732601   0.001 0.001375000           **
3       All      Altitude mantel test            pearson              0.22102713   0.001 0.001375000           **
4       All   Temperature mantel test            pearson              0.45198101   0.001 0.001375000           **
5       All Precipitation mantel test            pearson              0.27905384   0.001 0.001375000           **
6       All           TOC mantel test            pearson              0.13000213   0.001 0.001375000           **
7       All           NH4 mantel test            pearson             -0.05538846   0.918 0.918000000             
8       All           NO3 mantel test            pearson              0.06758353   0.044 0.048400000            *
9       All            pH mantel test            pearson              0.40853579   0.001 0.001375000           **
10      All  Conductivity mantel test            pearson              0.26425041   0.001 0.001375000           **
11      All            TN mantel test            pearson              0.13205237   
0.002 0.002444444           **

环境变量与分类群之间的相关性对分析和推断群落结构的影响因素具有重要意义。

在本例中,我们首先进行了差异丰度检验和随机森林分析,以获得重要属。然后利用这些分类群进行相关性分析。

> t2 <- trans_diff$new(dataset = dataset, method = "rf", group = "Group", rf_taxa_level = "Genus")

> t1 <- trans_env$new(dataset = dataset, add_data = env_data_16S[, 4:11])

> t1cal_cor(use_data = "Genus", p_adjust_method = "fdr", other_taxa = t2res_rf$Taxa[1:5])

> t1$plot_cor(pheatmap = FALSE)

图画的有些难看,这是临时跑的,大家有需求的话可以用自己的数据跑一下。没需求就跑着玩,熟悉一下就好。

相关推荐
华科云商xiao徐5 小时前
如何在C语言环境中借助Linux库构建高效网络爬虫
爬虫·数据挖掘·数据分析
赵谨言5 小时前
基于数据挖掘的单纯冠心病与冠心病合并糖尿病的证治规律对比研究
经验分享·数据挖掘·毕业设计
赵谨言5 小时前
基于大数据挖掘的药品不良反应知识整合与利用研究
经验分享·数据挖掘·毕业设计
胡耀超5 小时前
7、Matplotlib、Seaborn、Plotly数据可视化与探索性分析(探索性数据分析(EDA)方法论)
python·信息可视化·plotly·数据挖掘·数据分析·matplotlib·seaborn
Twilight-pending7 小时前
计算机系统性能、架构设计、调度策略论文分类体系参考
人工智能·云原生·分类·数据挖掘
华科云商xiao徐1 天前
Linux环境下爬虫程序的部署难题与系统性解决方案
爬虫·数据挖掘·数据分析
木木子99991 天前
不同行业视角下的数据分析
数据挖掘·数据分析
没有梦想的咸鱼185-1037-16631 天前
基于R语言机器学习方法在生态经济学领域中的实践技术应用
开发语言·机器学习·数据分析·r语言
SHUIPING_YANG1 天前
如何让dify分类器更加精准的分类?
人工智能·分类·数据挖掘
zhangfeng11331 天前
R 语法高亮为什么没有,是需要安装专用的编辑软件,R语言自带的R-gui 功能还是比较简单
开发语言·r语言