【R语言】使用ALDEx2对微生物组进行差异分析

代码展示:

c 复制代码
library(ALDEx2)
rm(list = ls())
data(selex)
selex.sub <- selex[1:400,]
selex.sub[1:4,1:4]


input <- "Rhizosphere_Time4"

#input_list <- c("Rhizosphere_Time0","Rhizosphere_Time1","Rhizosphere_Time2","Rhizosphere_Time3","Rhizosphere_Time4")
input_list <- c("Root_Time1","Root_Time2","Root_Time3","Root_Time4")

for (input in input_list) {
otu_table <- read.delim(paste0(input,'_0.5wen.10050.asv_table.txt'), row.names = 1, sep = '\t', stringsAsFactors = FALSE, check.names = FALSE)
group <- read.delim(paste0('group2_',input,'.txt'),row.names = 1,sep = '\t') 


# 进行 Monte Carlo 采样和 CLR 转换
aldex_data <- aldex.clr(otu_table, conds = group$group1, mc.samples = 128, denom = "all")
# 进行 t 检验 和 Wilcoxon 检验
aldex_results <- aldex.ttest(aldex_data, paired = FALSE)
###--同--

# 显示显著 OTU
significant_OTUs <- aldex_results[aldex_results$wi.ep < 0.05, ]
head(significant_OTUs)

write.csv(significant_OTUs, paste0(input,'_sig.csv'))
}

参考:

1\]推荐使用ALDEx2的文献: [NC:基于38组数据评估14种微生物组差异分析方法---结果差异很大](https://blog.csdn.net/woodcorpse/article/details/125157755?spm=1001.2014.3001.5506) 原文: \[2\][使用 ALDEx2 进行差异分析](https://cloud.tencent.com/developer/article/1621879) \[3\]b站:[微生物差异分析2:Aldex2分析](https://www.bilibili.com/video/BV11HH6eiEtj/) \[4\]

相关推荐
开开心心_Every33 分钟前
便捷的电脑自动关机辅助工具
开发语言·人工智能·pdf·c#·电脑·音视频·sublime text
霖002 小时前
C++学习笔记三
运维·开发语言·c++·笔记·学习·fpga开发
上单带刀不带妹2 小时前
JavaScript中的Request详解:掌握Fetch API与XMLHttpRequest
开发语言·前端·javascript·ecmascript
小白学大数据2 小时前
Python爬取闲鱼价格趋势并可视化分析
开发语言·python
ningmengjing_2 小时前
在 PyCharm 中安装并配置 Node.js 的指南
开发语言·javascript·ecmascript
晓13133 小时前
JavaScript基础篇——第五章 对象(最终篇)
开发语言·前端·javascript
LjQ20403 小时前
Java的一课一得
java·开发语言·后端·web
阿蒙Amon3 小时前
C#正则表达式全面详解:从基础到高级应用
开发语言·正则表达式·c#
CHANG_THE_WORLD4 小时前
「macOS 系统字体收集器 (C++17 实现)」
开发语言·c++·macos
妄想出头的工业炼药师4 小时前
python和C++相互调用使用
开发语言·c++