首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >工具:MultiCOP微生物组和代谢组关联分析工具

工具:MultiCOP微生物组和代谢组关联分析工具

原创
作者头像
生信学习者
发布2025-01-13 08:44:12
发布2025-01-13 08:44:12
2330
举报

介绍

人类健康与微生物群之间的联系,包括在代谢水平上的潜在疾病风险,已得到充分证实。然而,由于涉及的大量数据和它们之间错综复杂的相互作用所造成的分析挑战,理解这种关系背后的确切机制仍然不清楚。我们提出了多元相关追踪(MultiCOP)算法,该算法有效地整合微生物组和代谢组数据,通过相关性追踪和随机投影来揭示微生物与代谢物的相互作用,并找到相关的微生物/代谢物。MultiCOP算法中相关搜索和随机投影的使用使其超越了其他方法的限制。不同于它的同类产品,MultiCOP不依赖于对两个数据集之间的关系的假设,例如线性。此外,它有效地处理多变量数据。我们进行了大量的模拟来评估MultiCOP的性能。此外,我们采用所提出的方法分别探索炎症性肠病患者和慢性缺血性心脏病患者的微生物-代谢物相互作用。

The connection between human health and the microbiome, including the potential risk of diseases at a metabolic level, is well established. However, comprehending the precise mechanism that underlies this relationship remains unclear due to the analysis challenge caused by the vast amount of data involved and the intricate inter- actions among them. We propose the multivariate correlation pursuit (MultiCOP) algorithm, which effectively integrates microbiome and metabolome data to uncover microbe-metabolite interactions and find relevant microbes/metabolites by applying correlation pursuit and random projection. The use of correlation search and random projection in the MultiCOP algorithm enables it to surpass the constraints of other methods. Unlike its counterparts, MultiCOP does not rely on assumptions about the relationship, such as linearity, between the two datasets. Additionally, it efficiently handles multivariate data. We conducted extensive simulations to assess the perfor- mance of MultiCOP. Additionally, we employed the proposed method to explore microbe-metabolite interactions in patients with inflammatory bowel disease and those with chronic ischemic heart disease, separately.

案例

代码语言:r
复制
rm(list=ls())
setwd("~/Desktop/microbiome/code/github")

source("utils.R")
source("main.R")
library(parallel)
# library(ggplot2)


##--
# function to generate synthetic data
sce2 <- function(n, p, q, rho, sigma_epsilon){
  # Generate X
  Sigma_X <- matrix(0, nrow = p, ncol = p)
  for (i in 1:p) {
    for (j in 1:p) {
      Sigma_X[i, j] <- rho^(abs(i - j))
    }
  }
  X <- mvtnorm::rmvnorm(n = n, mean = rep(0, p), sigma = Sigma_X)
  
  epsilon = sigma_epsilon * rnorm(n*q, 0, 1)
  epsilon = matrix(epsilon, nrow=n, ncol=q)
  
  # Calculate Y based on the linear model
  bias = ( X[,1] + X[,2] ) / ( 0.5 + (1.5+X[,1])^2 )
  Y <- epsilon
  for (i in 1:2){
    Y[,i] = Y[,i] + bias
  }
  
  return(list(X = X, Y = Y))
}




##--- simulation scenario 2, linear setting, rho=0.5, sigma=3, n=100 ----
n = 100
p = 5
q = 6
rho = 0.5
sigma_epsilon = 3

my.range = 100;
m = 100
alpha.in.list = c(0.90, 0.95, 0.99)
alpha.out.list = c(0.85, 0.90, 0.95) 
rep = 30

##-- generate data:
# dat_list_s2 = list()
# for (rr in 1:rep){
#   sce2_dat = sce2(n, p, q, rho, sigma_epsilon)
#   dat_list_s2[[rr]] = sce2_dat
# }
# save(dat_list_s2, file=paste0("example_data.rdata"))
load(paste0("example_data.rdata"))



##--- MultiCOP:
rep = 30
results_list = list()
for (rr in 1:rep){
  print(paste("-------repetition",rr))
  # generate data:
  dat = dat_list_s2[[rr]]
  X = dat$X; Y = dat$Y
  # get results:
  result = get_result(X, Y, m, alpha.in.list, alpha.out.list, seed=rr, k0=5)
  results_list[[rr]] = result
}

save(results_list, file="example_results.rdata")
load(paste0("example_results.rdata"))



## get score:
true_X = rep(0,p); true_X[1:2] = 1
true_Y = rep(0,q); true_Y[1:2] = 1

FR_X = matrix(NA, nrow=rep, ncol=2); colnames(FR_X) = c("FPR_X", "FNR_X"); rownames(FR_X) = paste("rep", 1:rep)
FR_Y = matrix(NA, nrow=rep, ncol=2); colnames(FR_Y) = c("FPR_Y", "FNR_Y"); rownames(FR_Y) = paste("rep", 1:rep)
for (rr in 1:rep){
  X_sub = results_list[[rr]]$X_sub
  Y_sub = results_list[[rr]]$Y_sub
  pred_X = rep(0,p); pred_X[as.integer(X_sub)] = 1
  pred_Y = rep(0,q); pred_Y[as.integer(Y_sub)] = 1
  FR_X[rr,] = get_rate(true_X, pred_X)
  FR_Y[rr,] = get_rate(true_Y, pred_Y)
}

apply(FR_X, 2, mean) # 0     0 
apply(FR_X, 2, sd) # 0     0 
apply(FR_Y, 2, mean) # 0.05  0.10 
apply(FR_Y, 2, sd) # 0.1017095 0.2034191 

参考

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 介绍
  • 案例
  • 参考
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档