This is a similar issue to this and this, but I have not been able to solve my case with the available information there.
I am running qiime2 version 2023.2 in a conda environment. The problem was detected when I tried to run an analysis, but I could replicate the behavior using the example data and code. Therefore, the code I run is:
# ### example: ancombc single formula
qiime composition ancombc \
--i-table table.qza \
--m-metadata-file metadata.tsv \
--p-formula bodysite \
--o-differentials dataloaf.qza
And the output I get is:
Plugin error from composition:
An error was encountered while running ANCOM-BC in R (return code 1), please inspect stdout and stderr to learn more.
Debug info has been saved to /tmp/qiime2-q2cli-err-om5tnxt_.log
The contents of the log file are:
Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.
Command: run_ancombc.R --inp_abundances_path /tmp/tmp4w_jjwkf/input.biom.tsv --inp_metadata_path /tmp/tmp4w_jjwkf/input.map.txt --formula bodysite --p_adj_method holm --prv_cut 0.1 --lib_cut 0 --reference_levels --neg_lb False --tol 1e-05 --max_iter 100 --conserve False --alpha 0.05 --output_loaf /tmp/q2-DataLoafPackageDirFmt-fa7l30z5
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.2 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ ggplot2 3.4.2 ✔ tibble 3.2.1
✔ lubridate 1.9.2 ✔ tidyr 1.3.0
✔ purrr 1.0.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Error: package or namespace load failed for ‘ANCOMBC’:
object ‘colSums’ is not exported by 'namespace:DelayedArray'
8: stop(msg, call. = FALSE, domain = NA)
7: value[[3L]](cond)
6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
4: tryCatch({
attr(package, "LibPath") <- which.lib.loc
ns <- loadNamespace(package, lib.loc)
env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
}, error = function(e) {
P <- if (!is.null(cc <- conditionCall(e)))
paste(" in", deparse(cc)[1L])
else ""
msg <- gettextf("package or namespace load failed for %s%s:\n %s",
sQuote(package), P, conditionMessage(e))
if (logical.return && !quietly)
message(paste("Error:", msg), domain = NA)
else stop(msg, call. = FALSE, domain = NA)
})
3: library(ANCOMBC)
2: withCallingHandlers(expr, warning = function(w) if (inherits(w,
classes)) tryInvokeRestart("muffleWarning"))
1: suppressWarnings(library(ANCOMBC))
Traceback (most recent call last):
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 176, in _ancombc
run_commands([cmd])
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 31, in run_commands
subprocess.run(cmd, check=True)
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_ancombc.R', '--inp_abundances_path', '/tmp/tmp4w_jjwkf/input.biom.tsv', '--inp_metadata_path', '/tmp/tmp4w_jjwkf/input.map.txt', '--formula', 'bodysite', '--p_adj_method', 'holm', '--prv_cut', '0.1', '--lib_cut', '0', '--reference_levels', '', '--neg_lb', 'False', '--tol', '1e-05', '--max_iter', '100', '--conserve', 'False', '--alpha', '0.05', '--output_loaf', '/tmp/q2-DataLoafPackageDirFmt-fa7l30z5']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2cli/commands.py", line 352, in __call__
results = action(**arguments)
File "<decorator-gen-36>", line 2, in ancombc
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
outputs = self._callable_executor_(scope, callable_args,
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 381, in _callable_executor_
output_views = self._callable(**view_args)
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 40, in ancombc
return _ancombc(
File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 178, in _ancombc
raise Exception('An error was encountered while running ANCOM-BC'
Exception: An error was encountered while running ANCOM-BC in R (return code 1), please inspect stdout and stderr to learn more.
I do not know why the DelayedArray package is not working properly. I have tried to update this specific package in the conda environment and I have also tried qiime2 version 2023.5, where I encounter the same error.
Any ideas or help is much appreciated, thanks!