Plugin error from ancombc (composition): colSums not exported by DelayedArray

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/ --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 (<>) 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/", line 176, in _ancombc
  File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/", line 31, in run_commands, check=True)
  File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/", 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/', '--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/", 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/", 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/", 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/", line 40, in ancombc
    return _ancombc(
  File "/opt/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/", 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!

Hi @cladigar,

Thanks for reaching out!

Let me try and reproduce this - there may have been some R package updates that are causing this issue. I'll confirm on my end and get back to you!

Hi @cladigar,

Thanks so much for your patience here, apologies for the delay while I was out of the office!

I tested this using QIIME 2 2023.2 and 2023.5, and both environments succeeded. I checked the tidyverse package versions from your output against my environments, and they match the 2023.5 environment versions; I suspect there may be other conflicting R packages that exist on your machine that are causing this issue. Do you have R installed separately from your QIIME 2 environments? If so, could you provide me with the output of the following command so that I can compare all of your existing package versions (while in your 2023.5 environment):

conda list

Thanks! :lizard:

Hi, @lizgehret!

Don't worry about the delay, I hope you enjoyed your holidays :grin:

I have tried to reproduce my error again, but now both example commands in the composition ancombc plugin run perfectly. Therefore, my guess is that during these days I must have updated my separate installation of R (outside of conda), solving the dependency problems.

Just out of curiosity, how does having another installation of R influence the conda environment? I thought they were managed separately and there shouldn't be any conflicts, right? Any insight in that regard will be highly appreciated to prevent future problems like this one. Thank you so much!

Good question! The short answer is that it depends. The separate package installations should be pretty isolated, but mixups can happen. .libPaths() is one of the major ways this is controlled, and there are environment variables as well which set things on your individual machine. We try to do our best with these hooks, which conda will evaluate upon activation.

All that being said, it's difficult to say exactly why this happened on your specific machine - but hopefully this gives you more context if this does come up in the future. Cheers :lizard:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.