Hi @salias,
Thank you for the quick reply. Although, does --p-formula receives as input numeric covariates (such as age, etc)? Because in ANCOM-BC 2 in R I used the formula "fix_formula = "Age_in_years + Hypertension + Physical_activity + Smoke + Years_of_illness + Treatment", but when trying to apply the same in qiime2 version 2023.5 the following error appears:
(Note 1: How can ANCOM-BC 2 accept numeric values and ANCOM-BC in qiime2 does not?)
(Note 2: Also, after running a test in ANCOM-BC 2 and ANCOM-BC using only the covariate 'Treatment' for example, in ANCOM-BC in qiime2 only 1 taxon returned and in ANCOM-BC 2, 19 taxa returned in output. How can so divergent taxa return?)
#Command used:
qiime composition ancombc
--i-table genus.qza
--m-metadata-file q2-metadata.tsv
--p-formula 'Age_in_years + Hypertension + Physical_activity + Smoke + Years_of_illness + Treatment'
--o-differentials ancombc.qza
Error:
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-0ocql18p.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 --inp_abundances_path /tmp/tmphqhumvfv/input.biom.tsv --inp_metadata_path /tmp/tmphqhumvfv/input.map.txt --md_column_types {"Register_number": "numeric", "Sample_name": "categorical", "Diagnosis": "numeric", "sub-diagnosis": "numeric", "Treatment": "categorical", "Gender": "numeric", "Age_in_years": "numeric", "Age": "categorical", "Age_group": "categorical", "Age_at_onset": "numeric", "Years_of_illness": "numeric", "N_of_depressive_episodes": "numeric", "N_of_manic_episodes": "numeric", "N_of_mixed_episodes": "numeric", "total_number_of_episodes": "numeric", "suicide_attempts": "numeric", "Alda_scale": "numeric", "Li_response": "numeric", "VP_response": "numeric", "years_of_lithium_treratment": "numeric", "years_of_valproic_treatment": "numeric", "VP_response_total_score": "numeric", "response_to_lamotrigine": "numeric", "BMI": "categorical", "BMI_group": "categorical", "Physical_activity": "categorical", "Smoke": "categorical", "mood_stabilizers_other_than_lithium": "numeric", "Antipsychotic_treatment": "numeric", "Antidepressants_treatment": "numeric", "Hypertension": "numeric", "Diabetes": "numeric", "Aderenza_scala_predimed": "numeric", "valori_scala_predimed": "numeric"} --formula Age_in_years + Hypertension + Physical_activity + Smoke + Years_of_illness + Treatment --p_adj_method holm --prv_cut 0.1 --lib_cut 0 --reference_levels ['Physical_activity::0', 'Smoke::0', 'Treatment::Li-treated', 'Age_in_years::25.0', 'Hypertension::0.0', 'Years_of_illness::2.0'] --neg_lb False --tol 1e-05 --max_iter 100 --conserve False --alpha 0.05 --output_loaf /tmp/q2-DataLoafPackageDirFmt-a3jkpftj
ββ 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
Attaching package: βjsonliteβ
The following object is masked from βpackage:purrrβ:
flatten
R version 4.2.3 (2023-03-15)
Error in relevel.factor(md[[column]], ref = intercept_vector) :
'ref' must be an existing level
Calls: relevel -> relevel.factor
3: stop("'ref' must be an existing level")
2: relevel.factor(md[[column]], ref = intercept_vector)
1: relevel(md[[column]], ref = intercept_vector)
Traceback (most recent call last):
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 255, in _ancombc
run_commands([cmd])
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 32, in run_commands
subprocess.run(cmd, check=True)
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_ancombc.R', '--inp_abundances_path', '/tmp/tmphqhumvfv/input.biom.tsv', '--inp_metadata_path', '/tmp/tmphqhumvfv/input.map.txt', '--md_column_types', '{"Register_number": "numeric", "Sample_name": "categorical", "Diagnosis": "numeric", "sub-diagnosis": "numeric", "Treatment": "categorical", "Gender": "numeric", "Age_in_years": "numeric", "Age": "categorical", "Age_group": "categorical", "Age_at_onset": "numeric", "Years_of_illness": "numeric", "N_of_depressive_episodes": "numeric", "N_of_manic_episodes": "numeric", "N_of_mixed_episodes": "numeric", "total_number_of_episodes": "numeric", "suicide_attempts": "numeric", "Alda_scale": "numeric", "Li_response": "numeric", "VP_response": "numeric", "years_of_lithium_treratment": "numeric", "years_of_valproic_treatment": "numeric", "VP_response_total_score": "numeric", "response_to_lamotrigine": "numeric", "BMI": "categorical", "BMI_group": "categorical", "Physical_activity": "categorical", "Smoke": "categorical", "mood_stabilizers_other_than_lithium": "numeric", "Antipsychotic_treatment": "numeric", "Antidepressants_treatment": "numeric", "Hypertension": "numeric", "Diabetes": "numeric", "Aderenza_scala_predimed": "numeric", "valori_scala_predimed": "numeric"}', '--formula', 'Age_in_years + Hypertension + Physical_activity + Smoke + Years_of_illness + Treatment', '--p_adj_method', 'holm', '--prv_cut', '0.1', '--lib_cut', '0', '--reference_levels', "['Physical_activity::0', 'Smoke::0', 'Treatment::Li-treated', 'Age_in_years::25.0', 'Hypertension::0.0', 'Years_of_illness::2.0']", '--neg_lb', 'False', '--tol', '1e-05', '--max_iter', '100', '--conserve', 'False', '--alpha', '0.05', '--output_loaf', '/tmp/q2-DataLoafPackageDirFmt-a3jkpftj']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2cli/commands.py", line 468, in call
results = action(**arguments)
File "", line 2, in ancombc
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 274, in bound_callable
outputs = self.callable_executor(
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 509, in callable_executor
output_views = self._callable(**view_args)
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 41, in ancombc
return _ancombc(
File "/root/miniconda3/envs/qiime2-2023.5/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.
So I tried to specify the --p-reference-levels just to see if something would change:
#Command used:
qiime composition ancombc
--i-table genus.qza
--m-metadata-file q2-metadata.tsv
--p-formula 'Age_in_years + Hypertension + Physical_activity + Smoke + Years_of_illness + Treatment'
--p-reference-levels Age_in_years::Elderly Hypertension::0 Physical_activity::0 Smoke::0 Years_of_illness::34 Treatment::Other.stabilizers \
--o-differentials ancombc.qza
Error:
Plugin error from composition:
One of the reference_levels
columns is not a categorical Metadata column. Please make sure that all chosen reference level columns are categorical, and not numeric. Non-categorical column selected: Age_in_years
Debug info has been saved to /tmp/qiime2-q2cli-err-73fwgc48.log
Traceback (most recent call last):
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2cli/commands.py", line 468, in call
results = action(**arguments)
File "", line 2, in ancombc
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 274, in bound_callable
outputs = self.callable_executor(
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 509, in callable_executor
output_views = self._callable(**view_args)
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 41, in ancombc
return _ancombc(
File "/root/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 175, in _ancombc
raise TypeError('One of the reference_levels
columns is not'
TypeError: One of the reference_levels
columns is not a categorical Metadata column. Please make sure that all chosen reference level columns are categorical, and not numeric. Non-categorical column selected: Age_in_years
Thank you again.