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$Taxa1:5)

> t1$plot_cor(pheatmap = FALSE)

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

相关推荐
2603_9651481115 小时前
AI+API选品:下一代智能商务助手雏形已现
java·大数据·数据库·人工智能·数据挖掘
成为深度学习高手15 小时前
CrossLinear:即插即用的跨相关嵌入,让线性模型也能用好外生变量
人工智能·python·深度学习·数据挖掘
是翎1 天前
深度长文|2026产品经理AI实践手册
人工智能·深度学习·学习·自然语言处理·数据挖掘
databook2 天前
泊松分布:从基础到实际应用
python·数据挖掘·数据分析
shujudang2 天前
业务数据分析项目中的分析方法与团队协作
大数据·数据挖掘·数据分析
成为深度学习高手2 天前
EMAformer:给Transformer披上嵌入铠甲增强时间序列预测
人工智能·深度学习·数据挖掘
sbjdhjd2 天前
从日志包含到临时文件竞争:文件包含进阶复盘中的 Docker、Windows 与 Session 限制
网络·安全·web安全·网络安全·数据挖掘·php·rce
时速GEO系统2 天前
初元 AI V1.1 版本升级,首个正式版发布一周・实现生成、部署、上线、优化全流程自动化闭环
人工智能·数据挖掘·node.js
babe小鑫3 天前
信息与计算科学专业应届生面试 怎么证明自己能解决业务问题
学习·r语言·excel
IT毕设梦工厂3 天前
计算机毕业设计选题推荐:基于大数据的城市空气污染物浓度数据分析与可视化|毕业设计选题|计算机毕设|选题推荐|毕设指导|项目定制|源码|高质量项目
大数据·python·信息可视化·数据挖掘·数据分析·课程设计·数据可视化