You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running ancombc2 on multiple subsets of my data containing different samples. I generate these subsets by filtering a phyloseq object containing all my samples. ancombc2 works fine with 3 of the 4 subsets, but for the 4th subset, I get an error message. This is my call;
Obtaining initial estimates ...
Error: Encountering the error for `lmerTest` package.
Please try to select one of your taxa and use its raw counts to fix the same linear mixed-effects model using `lmerTest` without the `ANCOMBC` package.
Load all necessary packages EXCEPT `ANCOMBC`, and see if the error arises due to package incompatibility or other issues.
The error message from `lmerTest` is as follows:
contrasts can be applied only to factors with 2 or more levels
Traceback:
1. ancombc2(data = dat_phy_plant_2021_landrace, tax_level = NULL,
. fix_formula = "treatment", rand_formula = "(1 | run_nr_exp_013) + (1 | block)",
. n_cl = 28, verbose = TRUE)
2. .iter_remle(x = x, y = y1, meta_data = meta_data, fix_formula = fix_formula,
. rand_formula = rand_formula, lme_control = lme_control, theta = NULL,
. tol = iter_control$tol, max_iter = iter_control$max_iter,
. verbose = iter_control$verbose)
3. tryCatch({
. result <- lmerTest::lmer(formula = tformula, data = data.frame(y_crt = y[1,
. ], meta_data), control = lme_control)
. }, error = function(e) {
. message <- sprintf(paste("Encountering the error for `lmerTest` package.",
. "Please try to select one of your taxa and use its raw counts to fix the same linear mixed-effects model using `lmerTest` without the `ANCOMBC` package.",
. "Load all necessary packages EXCEPT `ANCOMBC`, and see if the error arises due to package incompatibility or other issues.",
. "The error message from `lmerTest` is as follows:", e$message,
. sep = "\n"))
. stop(message, call. = FALSE)
. })
4. tryCatchList(expr, classes, parentenv, handlers)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
6. value[[3L]](cond)
7. stop(message, call. = FALSE)
I tried fitting the model for one if my taxa with lmerTest:lmer() as recommended and that worked fine. Also, my phyloseq object has more than two levels for each random factor:
The factor variables have the data type "factor" and there are no NAs. I am a bit clueless on how to continue troubleshooting. Perhaps you have encountered this error before and have a hint on how to fix it?
The text was updated successfully, but these errors were encountered:
I have been encountering the same issue. What transformation did you use?
I was using centered log ratio, but then I switched to microbiome::transform(pseq_genus, "rclr") and didn't show the error. Thus, I assumed it had something to do with it.
Hi Frederick,
I am running
ancombc2
on multiple subsets of my data containing different samples. I generate these subsets by filtering a phyloseq object containing all my samples.ancombc2
works fine with 3 of the 4 subsets, but for the 4th subset, I get an error message. This is my call;And this is the error I get:
I tried fitting the model for one if my taxa with
lmerTest:lmer()
as recommended and that worked fine. Also, my phyloseq object has more than two levels for each random factor:The factor variables have the data type "factor" and there are no NAs. I am a bit clueless on how to continue troubleshooting. Perhaps you have encountered this error before and have a hint on how to fix it?
The text was updated successfully, but these errors were encountered: