ANCOM-BC plugin error

Dear community, I'm trying to run ANCOM-BC with the qiime2 plugin (thanks for it!!) but I'm having an error. I've tried both in qiime2-2022.11 and qiime2-2023.2 and the error is the same. I understand that there is a problem with the ANCOM-BC R-package, but I don't really know how to deal with it.

Thanks in advance,

(qiime2-2023.2) pgen@pgen:/media/pgen/Disco_2/GEN00452_RaquelCampos_nematodos/8_Study_Samples_filtered/Phylum_Nematodos/DA$ qiime composition ancombc --i-table table_Nematozoa.qza --m-metadata-file metadata_samples_final.csv --p-formula Treatment --p-p-adj-method fdr --p-prv-cut 0.1 --p-lib-cut 0 --p-alpha 0.05 --o-differentials ancombc_feature.qza --verbose
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/tmpeccwrndq/input.biom.tsv --inp_metadata_path /tmp/tmpeccwrndq/input.map.txt --formula Treatment --p_adj_method fdr --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-3bt89y1_

── Attaching packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.2 ──
βœ” ggplot2 3.4.1     βœ” purrr   1.0.1
βœ” tibble  3.1.8     βœ” dplyr   1.1.0
βœ” tidyr   1.3.0     βœ” stringr 1.5.0
βœ” readr   2.1.4     βœ” forcats 1.0.0
── Conflicts ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
βœ– dplyr::filter() masks stats::filter()
βœ– dplyr::lag()    masks stats::lag()
Error: package or namespace load failed for β€˜ANCOMBC’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/pgen/anaconda3/envs/qiime2-2023.2/lib/R/library/gsl/libs/gsl.so':
  libgsl.so.25: no se puede abrir el archivo del objeto compartido: No existe el archivo o el directorio
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 "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 176, in _ancombc
    run_commands([cmd])
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 31, in run_commands
    subprocess.run(cmd, check=True)
  File "/home/pgen/anaconda3/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/tmpeccwrndq/input.biom.tsv', '--inp_metadata_path', '/tmp/tmpeccwrndq/input.map.txt', '--formula', 'Treatment', '--p_adj_method', 'fdr', '--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-3bt89y1_']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pgen/anaconda3/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 "/home/pgen/anaconda3/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 "/home/pgen/anaconda3/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 "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 40, in ancombc
    return _ancombc(
  File "/home/pgen/anaconda3/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.

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.

See above for debug info.
1 Like

Hello @matoro and welcome back to the forum,

Are you on linux? It seems like you either do not have the GNU scientific libraries (gsl) installed, or your R runtime doesn't know where they live.

If you have root privileges on your machine (and you're on Debian) you can try:
apt-get install libgsl0ldbl (link)

If this indicates that the libraries are already installed, it might be an issue of telling R where to find them.

Thanks.

1 Like

Hi @matoro,

I had a similar issue and was able to resolve this via editing my .condarc file. My .condarc file was set up like this:

channels:
 - bioconda
 - conda-forge
 - defaults
channel_priority: false

This was causing problems with how :qiime2: was installing the various plugins. I forget why I set up my .condarc file in this way, but realized I no longer needed these settings. So, I removed everything in the .condarc file. It's just blank now...

I removed and then re-installed :qiime2: 2023.2, and everything, i.e. ANCOM-BC, now works fine. Give this a try and let us know if it works.

-Mike

3 Likes

Hi Colin, thank you very much for your quick response!! I'm working on a Ubuntu 20.04.3 LTS.
I've tried to instal it... but no result... It seems this package is not found. Therefore, I've tried to install another version (libgsl23), that seems to be the replacement, but it is already installed.

(qiime2-2023.2) pgen@pgen:/media/pgen/Disco_2/GEN00452_RaquelCampos_nematodos/8_Study_Samples_filtered/Phylum_Nematodos/DA$ sudo apt-get install libgsl0ldbl
[sudo] contraseΓ±a para pgen: 
Leyendo lista de paquetes... Hecho
Creando Γ‘rbol de dependencias       
Leyendo la informaciΓ³n de estado... Hecho
El paquete libgsl0ldbl no estΓ‘ disponible, pero algΓΊn otro paquete hace referencia
a Γ©l. Esto puede significar que el paquete falta, estΓ‘ obsoleto o sΓ³lo se
encuentra disponible desde alguna otra fuente
Sin embargo, los siguientes paquetes lo reemplazan:
  libgsl23 libgslcblas0:i386 libgsl23:i386 libgslcblas0

E: El paquete Β«libgsl0ldblΒ» no tiene un candidato para la instalaciΓ³n

(qiime2-2023.2) pgen@pgen:/media/pgen/Disco_2/GEN00452_RaquelCampos_nematodos/8_Study_Samples_filtered/Phylum_Nematodos/DA$ sudo apt-get install libgsl23
Leyendo lista de paquetes... Hecho
Creando Γ‘rbol de dependencias       
Leyendo la informaciΓ³n de estado... Hecho
libgsl23 ya estΓ‘ en su versiΓ³n mΓ‘s reciente (2.5+dfsg-6build1).
fijado libgsl23 como instalado manualmente.
0 actualizados, 0 nuevos se instalarΓ‘n, 0 para eliminar y 154 no actualizados.


Thanks Mike!!! It worked!!! I've desinstalled the complete environment, modify the .condarc file, and reinstall all the qiime2 (v2023.2) completely. It seems to work!

Thank you for your help! Both of you!

3 Likes

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