Closed luisebe closed 1 year ago
Hi Luise,
The results appear to be rather unusual. As the first step to look into the issue, I suggest trying to run the analysis without specifying the rand_formula
to see if that yields different outcomes. Additionally, if you don't have a specific interest in pattern analysis, you can set trend = FALSE
. This adjustment should improve computing time, as pattern analysis is the most time-intensive aspect of the process.
Best regards, Frederick
Hi Frederick,
now it works, I omitted the rand_formula in the model
Best, Luise
Hi Frederick,
I have another question regarding the choice for the random formula of the ANCOMBC2 model, I wanted to include both a random slope and a random intercept, as suggested in your vignette. However, when I do this, the model only returns the same values for all lfc, p, diff, etc values, leaving no differentially abundant taxa in res_pair, res_dunn and res_trend, yet all taxa are differentially abundant in res_global.
here is the code I used for your formula:
ancombc2(data = tse, assay_name = "counts", tax_level = "Genus", fix_formula = "Timepoint + group", rand_formula = "(Timepoint | subject_id)", p_adj_method = "fdr", prv_cut = 0.10, group = "group", 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 = "fdr", B = 100), trend_control = list(contrast = list(matrix(c(1, 0, 0, -1, 1, 0, 0, -1, 1 ), nrow = 3, byrow = TRUE), matrix(c(-1, 0, 0, 1, -1, 0, 0, 1, -1 ), nrow = 3, byrow = TRUE)), node = list(2, 2), solver = "ECOS", B = 10))
I have 4 groups (reference diet, diet 1, diet 2 and diet 3) to assess.
as a reference, here is the output of ancombc2 global model:
head(output4groups[["res_global"]])
taxon W p_val q_val diff_abn Tax1 0 0 0 TRUE Tax2 0 0 0 TRUE Tax3 0 0 0 TRUE Tax4 0 0 0 TRUE Tax5 0 0 0 TRUE Tax6 0 0 0 TRUEDid I define my groups incorrectly? I have seen from the diet swap study, that each participant gets sampled six times (and therefore have 6 timepoints as input), whereas my participants only get sampled twice. Is there way to circumvent this?
Thank you very much in advance!
Best, Luise