Sparse estimation of linear and nonlinear correlations between taxa in microbiome data.
Microbiome correlationreleasedR
SECOM (sparse estimation of correlations among microbiomes) estimates correlations between pairs of taxa, within one ecosystem or across ecosystems. secom_linear estimates sparse Pearson or Spearman correlations after bias correction. secom_dist estimates distance correlation, which also detects nonlinear relationships.
The R tutorial applies SECOM to the HITChip Atlas data set of intestinal microbiota profiles from Western adults, distributed with the microbiome package as atlas1006. The analysis estimates the correlation between each pair of taxa, aggregated at the Family rank of the data set.
where \(c_i\) is the taxon-specific sequencing efficiency and \(s_j\) is the sample-specific sampling fraction. The term \(\log s_j\) is shared by all taxa in sample \(j\) and therefore induces correlation between observed abundances that is absent from the absolute abundances. SECOM estimates this sample-specific bias, subtracts it, and computes correlations from the bias-corrected log abundances.
Two estimators are available.
Function
Measure
Detects
secom_linear
Pearson or Spearman correlation
Linear or monotone relationships
secom_dist
Distance correlation
Linear and nonlinear relationships
Data
library(ANCOMBC)library(tidyverse)data(atlas1006, package ="microbiome")# Baseline samples only, so that each subject contributes one sample.pseq <- phyloseq::subset_samples(atlas1006, time ==0)meta <-data.frame(phyloseq::sample_data(pseq))# BMI in three ordered groups, with lean as the reference level.meta$bmi <-fct_collapse(meta$bmi_group,obese =c("obese", "severeobese", "morbidobese"))meta$bmi <-factor(meta$bmi, levels =c("lean", "overweight", "obese"))# Geographic region, with Central Europe as the reference level.meta$region <-fct_collapse(meta$nationality,CE ="CentralEurope", NE =c("Scandinavia", "UKIE"),SE ="SouthEurope", EE ="EasternEurope", US ="US")phyloseq::sample_data(pseq) <- metatse <- mia::convertFromPhyloseq(pseq)tse
pairs |>filter(distance !=0, pearson ==0) |>arrange(desc(distance)) |> knitr::kable(digits =3,caption ="Pairs with a nonzero distance correlation and a zero Pearson correlation after filtering.")
Pairs with a nonzero distance correlation and a zero Pearson correlation after filtering.
taxon1
taxon2
pearson
distance
Clostridium cluster XIII
Clostridium cluster XV
0
0.375
Clostridium cluster XVII
Clostridium cluster XVIII
0
0.330
Bacilli
Clostridium cluster XI
0
0.319
Correlation between two ecosystems
To estimate correlations between taxa from two ecosystems measured on the same subjects, pass both data objects in data, for example data = list(gut = tse_gut, oral = tse_oral), with matching sample names. The result is one correlation matrix over the taxa of both ecosystems.
Lin H, Eggesbø M, Peddada SD. Linear and nonlinear correlation estimators unveil undescribed taxa interactions in microbiome data. Nature Communications 13:4946 (2022). doi:10.1038/s41467-022-32243-x
Related methods
MetVAE: correlation analysis for untargeted metabolomics data.
ANCOM-BC2: differential abundance analysis, distributed in the same R package.