ANCOMBC in R (return code 1)

Dear community,

I'm trying to run ANCOM-BC with q2-composition, but I'm encountering issues. I am using Qiime2 version 2024.5. Even after following the moving picture tutorial, I get the repetitive error message: "An error was encountered while running ANCOMBC in R (return code 1), please inspect stdout and stderr to learn more." I have also referred to this GitHub repository and updated everything, but the error persists.

Could you please help me resolve this issue? Below is the debug info:

Plugin error from ancombc:

  An error was encountered while running ANCOMBC in R (return code 1), please inspect stdout and stderr to learn more.

Debug info has been saved to /var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/qiime2-q2cli-err-luoe3_gj.log
(qiime2-amplicon-2024.5) byunghunso@BYUNGHUNui-iMac ancom-bc-tutorial % head /var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/qiime2-q2cli-err-luoe3_gj.log

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 ./input.biom.tsv ./input.map.txt labels holm 0.9 1000 labels TRUE TRUE 1e-05 100 TRUE 0.05 FALSE ./output.summary.txt

R version 4.3.3 (2024-02-29) 
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
βœ” dplyr     1.1.4     βœ” readr     2.1.5
βœ” forcats   1.0.0     βœ” stringr   1.5.1
βœ” ggplot2   3.5.1     βœ” tibble    3.2.1

Thank you for your assistance.

1 Like

Hi there @Stevehun ,

Welcome to the :qiime2: forum!

Can you re-run your qiime composition ancombc command with --verbose and post the full command and error message here? Thanks!

Sergio

1 Like

Hello @salias ,
Thank you for your reply.
is it right you said? I attached full command.
I don't know how to solve this problem.
Thanks!

Stevehun

(qiime2-amplicon-2024.5) byunghunso@BYUNGHUNui-iMac ancom-bc-tutorial % qiime ancombc ancombc \
    --i-table table.qza \
    --m-metadata-file metadata.txt \
    --p-formula "labels" \
    --o-differentials differentials.qza
Plugin error from ancombc:

  An error was encountered while running ANCOMBC in R (return code 1), please inspect stdout and stderr to learn more.

Debug info has been saved to /var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/qiime2-q2cli-err-ldky911l.log
(qiime2-amplicon-2024.5) byunghunso@BYUNGHUNui-iMac ancom-bc-tutorial % head /var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/qiime2-q2cli-err-ldky911l.log
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 ./input.biom.tsv ./input.map.txt labels holm 0.9 1000 labels TRUE TRUE 1e-05 100 TRUE 0.05 FALSE ./output.summary.txt

R version 4.3.3 (2024-02-29) 
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
βœ” dplyr     1.1.4     βœ” readr     2.1.5
βœ” forcats   1.0.0     βœ” stringr   1.5.1
βœ” ggplot2   3.5.1     βœ” tibble    3.2.1
(qiime2-amplicon-2024.5) byunghunso@BYUNGHUNui-iMac ancom-bc-tutorial % 

Hi again!

I forgot to mention: that plugin is now included in composition plugin. As the README says:

This plugin has been replaced with functionality in the q2-composition plugin. You should now access ANCOM-BC in QIIME 2 through the q2-composition plugin that is included in the QIIME 2 amplicon distribution. You do not need to install this plugin to use ANCOM-BC through QIIME 2.

So you should use qiime composition ancombc instead of qiime ancombc ancombc.

We cannot know what is going on without the --verbose option of the QIIME 2 commands. Could you run your command as follows:

qiime composition ancombc \
    --i-table table.qza \
    --m-metadata-file metadata.txt \
    --p-formula "labels" \
    --o-differentials differentials.qza \
    --verbose

and share the output?

1 Like

Thank you for your reply.

As you mentioned, I am aware that ANCOM-BC is accessible as a Qiime 2 plugin. However, I keep encountering 'return code 1 errors', and I would like to resolve this issue.

Instead of using my data, I want to verify the functionality of ANCOM-BC using the tutorial available on GitHub.

Below is the output when I executed the commands you provided. (The sections in Korean indicate parts that could not be loaded or warning messages.) I am determined to resolve this issue.

Thank you very much for your assistance.

Stevehun

Last login: Fri Jul 12 08:57:35 on ttys000
(base) byunghunso@BYUNGHUNui-iMac ~ % conda activate qiime2-amplicon-2024.5
cd ./pilot_microbiome/2024_07_08_1/ancom-bc-tutorial
(qiime2-amplicon-2024.5) byunghunso@BYUNGHUNui-iMac ancom-bc-tutorial % qiime composition ancombc \
    --i-table table.qza \
    --m-metadata-file metadata.txt \
    --p-formula "labels" \
    --o-differentials differentials.qza \
    --verbose
/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_composition/_ancombc.py:77: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  term_alpha_value = (metadata.get_column(term)
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 /var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/tmphmseqm_c/input.biom.tsv --inp_metadata_path /var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/tmphmseqm_c/input.map.txt --md_column_types {"labels": "numeric", "effect_size": "numeric", "microbe_total": "numeric", "class_logits": "numeric", "intercept": "numeric", "groups": "categorical"} --formula labels --p_adj_method holm --prv_cut 0.1 --lib_cut 0 --reference_levels ['labels::-1.0'] --tol 1e-05 --max_iter 100 --conserve False --alpha 0.05 --output_loaf /var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/q2-DataLoafPackageDirFmt-ml05k8h6

R version 4.3.3 (2024-02-29) 
κ²½κ³ λ©”μ‹œμ§€(λ“€): 
κ°•μ œν˜•λ³€ν™˜μ— μ˜ν•΄ μƒμ„±λœ NA μž…λ‹ˆλ‹€ 
κ²½κ³ λ©”μ‹œμ§€(λ“€): 
κ°•μ œν˜•λ³€ν™˜μ— μ˜ν•΄ μƒμ„±λœ NA μž…λ‹ˆλ‹€ 
κ²½κ³ λ©”μ‹œμ§€(λ“€): 
κ°•μ œν˜•λ³€ν™˜μ— μ˜ν•΄ μƒμ„±λœ NA μž…λ‹ˆλ‹€ 
κ²½κ³ λ©”μ‹œμ§€(λ“€): 
κ°•μ œν˜•λ³€ν™˜μ— μ˜ν•΄ μƒμ„±λœ NA μž…λ‹ˆλ‹€ 
κ²½κ³ λ©”μ‹œμ§€(λ“€): 
κ°•μ œν˜•λ³€ν™˜μ— μ˜ν•΄ μƒμ„±λœ NA μž…λ‹ˆλ‹€ 
── Attaching core tidyverse packages ────────────────────────────────────────────────────────────────── tidyverse 2.0.0 ──
βœ” dplyr     1.1.4     βœ” readr     2.1.5
βœ” forcats   1.0.0     βœ” stringr   1.5.1
βœ” ggplot2   3.5.1     βœ” tibble    3.2.1
βœ” lubridate 1.9.3     βœ” tidyr     1.3.1
βœ” purrr     1.0.2     
── 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
μ—λŸ¬: package or namespace load failed for β€˜ANCOMBC’ in dyn.load(file, DLLpath = DLLpath, ...):
 곡유된 객체 '/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/R/library/gsl/libs/gsl.dylib'λ₯Ό λ‘œλ“œ ν•  수 μ—†μŠ΅λ‹ˆλ‹€:
  dlopen(/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/R/library/gsl/libs/gsl.dylib, 0x0006): Library not loaded: @rpath/libgsl.25.dylib
  Referenced from: <C3351F44-B1DF-318E-888E-BD7440442A0D> /Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/R/library/gsl/libs/gsl.dylib
  Reason: tried: '/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/R/library/gsl/libs/../../../lib/libgsl.25.dylib' (no such file), '/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/R/library/gsl/libs/../../../../libgsl.25.dylib' (no such file), '/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/R/library/gsl/libs/../../../lib/libgsl.25.dylib' (no such file), '/Users/byunghunso/opt/miniconda3/e
싀행이 μ •μ§€λ˜μ—ˆμŠ΅λ‹ˆλ‹€
Traceback (most recent call last):
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_composition/_ancombc.py", line 255, in _ancombc
    run_commands([cmd])
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_composition/_ancombc.py", line 32, in run_commands
    subprocess.run(cmd, check=True)
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_ancombc.R', '--inp_abundances_path', '/var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/tmphmseqm_c/input.biom.tsv', '--inp_metadata_path', '/var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/tmphmseqm_c/input.map.txt', '--md_column_types', '{"labels": "numeric", "effect_size": "numeric", "microbe_total": "numeric", "class_logits": "numeric", "intercept": "numeric", "groups": "categorical"}', '--formula', 'labels', '--p_adj_method', 'holm', '--prv_cut', '0.1', '--lib_cut', '0', '--reference_levels', "['labels::-1.0']", '--tol', '1e-05', '--max_iter', '100', '--conserve', 'False', '--alpha', '0.05', '--output_loaf', '/var/folders/q4/zlsnmdd940n1f8xjb67_glyr0000gn/T/q2-DataLoafPackageDirFmt-ml05k8h6']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 520, in __call__
    results = self._execute_action(
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 581, in _execute_action
    results = action(**arguments)
  File "<decorator-gen-22>", line 2, in ancombc
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
    outputs = self._callable_executor_(
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 576, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_composition/_ancombc.py", line 41, in ancombc
    return _ancombc(
  File "/Users/byunghunso/opt/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_composition/_ancombc.py", line 257, 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.

Thanks for sharing! Now that we can read the full error message, we can try to pull the thread.

It looks that your error is similar to the one discussed here:

In that post, the error is solved by removing the contents of the .condarc fileΒΉ and reinstalling the environment. Sometimes the setup included in .condarc conflicts with the way QIIME 2 installs plugins.

I would try to remove the content of .condarc (i.e. leave it blank) and then delete and reinstall the QIIME 2 environment.

Good luck!

--

ΒΉ The .condarc file should be located in your home directory.

1 Like