FrederickHuangLin / ANCOMBC

Differential abundance (DA) and correlation analyses for microbial absolute abundance data
https://www.nature.com/articles/s41467-020-17041-7
107 stars 29 forks source link

Setting fix_formula with variables #281

Open UniAlberta opened 2 months ago

UniAlberta commented 2 months ago

Hi, I`m using Ancombc2 to find differentially abundant taxa in microbial communities under different treatments. I see here: https://www.bioconductor.org/packages/release/bioc/vignettes/ANCOMBC/inst/doc/ANCOMBC2.html. You have multiple variables in fix_formula, and your variable of interest is bmi. Is it fine if fix_formula is set only to the variable of interest, not all variables in metadata? like this: output = ancombc2(data = tse, assay_name = "counts", tax_level = "Family", fix_formula = "bmi", rand_formula = NULL, p_adj_method = "holm", pseudo_sens = TRUE, prv_cut = 0.10, lib_cut = 1000, s0_perc = 0.05, group = "bmi", struc_zero = TRUE, neg_lb = TRUE, alpha = 0.05, n_cl = 2, verbose = TRUE, global = TRUE, pairwise = TRUE, dunnet = TRUE, trend = TRUE, iter_control = list(tol = 1e-2, max_iter = 20, verbose = TRUE), em_control = list(tol = 1e-5, max_iter = 100), lme_control = lme4::lmerControl(), mdfdr_control = list(fwer_ctrl_method = "holm", B = 100), trend_control = list(contrast = list(matrix(c(1, 0, -1, 1), nrow = 2, byrow = TRUE), matrix(c(-1, 0, 1, -1), nrow = 2, byrow = TRUE), matrix(c(1, 0, 1, -1), nrow = 2, byrow = TRUE)), node = list(2, 2, 1), solver = "ECOS", B = 10))

Maggie8888 commented 1 month ago

Yes. It is fine as long as you believe the model is correctly specified.