Hi,
SPIEC-EASI (from the SpiecEasi R package) does not natively support covariate adjustment during network inference. It focuses on sparse inverse covariance estimation from compositional data, typically via CLR transformation, but lacks built-in options for confounders like age or gender.
A common workaround is residualization: regress out covariates from the transformed abundances before feeding into SPIEC-EASI. First, apply CLR transformation to your OTU table (using SpiecEasi::make_graph or microbiome::transform). Then, for each taxon, fit a linear model (e.g., lm(clr_abundance ~ age + gender)) and extract residuals. Use these residuals as input for SPIEC-EASI's spiec.easi function with method='mb' or 'glasso'.
Be cautious—residualization on compositional data can introduce artifacts, so validate with simulations. For updated code, ensure you're using SpiecEasi v1.1.2 (CRAN/Bioconductor) or later.
Alternatively, for differential network analysis across groups while adjusting for covariates, consider the SOHPIE package (CRAN, v1.0.5 as of 2024). It uses SparCC for associations but models degree centrality with jackknife pseudo-values in a regression framework, explicitly including age/gender. Example: sohpie_dna(otu_table, group, covariates = list(age, gender)). Code and docs at https://github.com/sjahnn/SOHPIE-DNA.
This approach avoids direct SPIEC-EASI modification while controlling effects. If comparing networks, tools like NetCoMi can help post-inference.
Kevin