【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\]

相关推荐
奔波霸的伶俐虫1 小时前
jeecg框架@Dict不生效问题
开发语言·python
YY_TJJ2 小时前
8.4 Java Web(Maven P50-P57)
java·开发语言·maven
pusue_the_sun3 小时前
从零开始搞定类与对象(中)
开发语言·c++·学习
咕噜咕噜啦啦3 小时前
Qt按键响应
开发语言·qt
raoxiaoya3 小时前
Golang中的`io.Copy()`使用场景
开发语言·后端·golang
屁股割了还要学3 小时前
【数据结构入门】链表
c语言·开发语言·数据结构·c++·学习·算法·链表
wjs20244 小时前
Lua 数据类型
开发语言
源代码•宸4 小时前
C++高频知识点(十四)
开发语言·c++·经验分享·raii
2zcode5 小时前
基于Matlab的聚类彩色图像分割系统
开发语言·matlab·聚类
网小鱼的学习笔记5 小时前
python基础:数据解析BeatuifulSoup,不需要考虑前端形式的一种获取元素的方法
开发语言·前端·python