ancom-bc (return code 1)

Hi, i'm trying to use ancom-bc in qiime2.

I used code below:

qiime composition ancombc
--i-table table.qza
--m-metadata-file metadata.tsv
--p-formula bodysite
--o-differentials dataloaf.qza

and i got error like this

anyone knows about this error? and I'm also wondering if I should install additional things like R when I run ancom-bc on qiime2 by code above.

Thanks.

1 Like

Hello Bandy,

Can you post that .log file so we can look for more clues?

Qiime2 comes with R, so you should be good to go!

the file could not uploaded so i just copy that context. i really appreciate for your help.


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/tmp66hoyipp/input.biom.tsv --inp_metadata_path /tmp/tmp66hoyipp/input.map.txt --md_column_types {"Barcode_location": "categorical", "BarcodeSequence": "categorical", "Group": "categorical", "Treatment": "categorical", "Incubation": "categorical", "Gender": "categorical", "Subject": "numeric", "DNA_Plate": "numeric", "SampleType": "categorical", "Platform": "categorical", "TargetGene": "categorical", "TargetSubfragment": "categorical"} --formula Group --p_adj_method holm --prv_cut 0.1 --lib_cut 0 --reference_levels ['Group::24h_control'] --neg_lb False --tol 1e-05 --max_iter 100 --conserve False --alpha 0.05 --output_loaf /tmp/q2-DataLoafPackageDirFmt-300c9oqv

── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
:heavy_check_mark: dplyr 1.1.2 :heavy_check_mark: readr 2.1.4
:heavy_check_mark: forcats 1.0.0 :heavy_check_mark: stringr 1.5.0
:heavy_check_mark: ggplot2 3.4.3 :heavy_check_mark: tibble 3.2.1
:heavy_check_mark: lubridate 1.9.2 :heavy_check_mark: tidyr 1.3.0
:heavy_check_mark: purrr 1.0.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
:heavy_multiplication_x: dplyr::filter() masks stats::filter()
:heavy_multiplication_x: dplyr::lag() masks stats::lag()
:information_source: Use the conflicted package (http://conflicted.r-lib.org/) to force all conflicts to become errors
Registered S3 methods overwritten by 'treeio':
method from
MRCA.phylo tidytree
MRCA.treedata tidytree
Nnode.treedata tidytree
Ntip.treedata tidytree
ancestor.phylo tidytree
ancestor.treedata tidytree
child.phylo tidytree
child.treedata tidytree
full_join.phylo tidytree
full_join.treedata tidytree
groupClade.phylo tidytree
groupClade.treedata tidytree
groupOTU.phylo tidytree
groupOTU.treedata tidytree
is.rooted.treedata tidytree
nodeid.phylo tidytree
nodeid.treedata tidytree
nodelab.phylo tidytree
nodelab.treedata tidytree
offspring.phylo tidytree
offspring.treedata tidytree
parent.phylo tidytree
parent.treedata tidytree
root.treedata tidytree
rootnode.phylo tidytree
sibling.phylo tidytree
κ²½κ³ λ©”μ‹œμ§€(λ“€):
νŒ¨ν‚€μ§€ β€˜optparseβ€™λŠ” R 버전 4.2.3μ—μ„œ μž‘μ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€
κ²½κ³ λ©”μ‹œμ§€(λ“€):
νŒ¨ν‚€μ§€ β€˜frictionlessβ€™λŠ” R 버전 4.2.3μ—μ„œ μž‘μ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€

λ‹€μŒμ˜ νŒ¨ν‚€μ§€λ₯Ό λΆ€μ°©ν•©λ‹ˆλ‹€: β€˜jsonlite’

The following object is masked from β€˜package:purrr’:

flatten

κ²½κ³ λ©”μ‹œμ§€(λ“€):
νŒ¨ν‚€μ§€ β€˜jsonliteβ€™λŠ” R 버전 4.2.3μ—μ„œ μž‘μ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€
R version 4.2.2 (2022-10-31)
'ancombc' is deprecated
Use 'ancombc2' instead
tax_level is not speficified
No agglomeration will be performed
Otherwise, please speficy tax_level by one of the following:
Species
μ—λŸ¬: No residual degrees of freedom! The model is over-parameterized
A more parsimonious model is needed
3: stop(stop_txt, call. = FALSE)
2: iter_mle(x = x, y = y, meta_data = meta_data, formula = formula,
theta = NULL, tol = tol, max_iter = max_iter, verbose = FALSE,
type = "ancombc")
1: ancombc(data = data, formula = formula, p_adj_method = p_adj_method,
prv_cut = prv_cut, lib_cut = lib_cut, neg_lb = neg_lb, tol = tol,
max_iter = max_iter, conserve = conserve, alpha = alpha)
Traceback (most recent call last):
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 255, in _ancombc
run_commands([cmd])
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 32, in run_commands
subprocess.run(cmd, check=True)
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_ancombc.R', '--inp_abundances_path', '/tmp/tmp66hoyipp/input.biom.tsv', '--inp_metadata_path', '/tmp/tmp66hoyipp/input.map.txt', '--md_column_types', '{"Barcode_location": "categorical", "BarcodeSequence": "categorical", "Group": "categorical", "Treatment": "categorical", "Incubation": "categorical", "Gender": "categorical", "Subject": "numeric", "DNA_Plate": "numeric", "SampleType": "categorical", "Platform": "categorical", "TargetGene": "categorical", "TargetSubfragment": "categorical"}', '--formula', 'Group', '--p_adj_method', 'holm', '--prv_cut', '0.1', '--lib_cut', '0', '--reference_levels', "['Group::24h_control']", '--neg_lb', 'False', '--tol', '1e-05', '--max_iter', '100', '--conserve', 'False', '--alpha', '0.05', '--output_loaf', '/tmp/q2-DataLoafPackageDirFmt-300c9oqv']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/site-packages/q2cli/commands.py", line 478, in call
results = self._execute_action(
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/site-packages/q2cli/commands.py", line 539, in _execute_action
results = action(**arguments)
File "", line 2, in ancombc
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/site-packages/qiime2/sdk/action.py", line 566, in callable_executor
output_views = self._callable(**view_args)
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 41, in ancombc
return _ancombc(
File "/home/me/miniconda3/envs/qiime2-2023.7/lib/python3.8/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.

1 Like

Thanks!

Here's the core of the error:

I've not seen that error before with ANCOM... :thinking:

How many samples do you have?
How many different bodysites do you have in your metadata?

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

I just ran into this error myself!

After I ran --p-formula PredictorVariable,
I found that my metadata column PredictorVariable was continuous and had many unique values.

(If PredictorVariable was a factor with a few levels, the error vanishes.)

1 Like