Problem with ALDEx2

I am trying to run ALDEx2 in qiime2-2020.2 version. But I get this error:

Plugin error from aldex2:

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

Debug info has been saved to /tmp/qiime2-q2cli-err-31aztdjt.log
log file:

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_aldex2.R /tmp/tmpiwex_o1o/input.tsv.biom /tmp/tmpiwex_o1o/ sample 128 t all /tmp/tmpiwex_o1o/output.summary.txt

R version 3.5.1 (2018-07-02)
[1] “aldex.clr: generating Monte-Carlo instances and clr values”
[1] “operating in serial mode”
[1] “computing center with all features”
[1] “aldex.ttest: doing t-test”
Error in aldex.ttest(x, conditions, paired.test = FALSE) :
only two condition levels are currently supported
Calls: aldex -> aldex.ttest
Ejecución interrumpida
Traceback (most recent call last):
File “/home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_aldex2/”, line 59, in aldex2
File “/home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_aldex2/”, line 21, in run_commands, check=True)
File “/home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/”, line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘run_aldex2.R’, ‘/tmp/tmpiwex_o1o/input.tsv.biom’, ‘/tmp/tmpiwex_o1o/’, ‘sample’, ‘128’, ‘t’, ‘all’, ‘/tmp/tmpiwex_o1o/output.summary.txt’]’ returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/”, line 328, in call
results = action(**arguments)
File “</home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/>”, line 2, in aldex2
File “/home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/”, line 245, in bound_callable
output_types, provenance)
File “/home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/”, line 390, in callable_executor
output_views = self._callable(**view_args)
File “/home/cristian/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_aldex2/”, line 63, in aldex2
" and stderr to learn more." % e.returncode)
Exception: An error was encountered while running ALDEx2 in R (return code 1), please inspect stdout and stderr to learn more.

Could you give some advice to solve it??
Thank you to all!!

Hello Cristian,

Here is the core of the error:

The ALDEx2 test only works with metadata that has exactly two groups so

Age Treatment
25 Antibiotics
75 Antibiotics
32 None
29 None

You could test Treatment (Antibiotics vs None) but you can’t test Age (as it has 4 different values).

Let me know if this answers your question!


Thanks @colinbrislawn for your response!!!
I am analyzing only 3 sample metagenomic 16S sequencing, so I have only one column with the sample number in my metadata file. How can I perform a differential abundance analysis with these data?
Thanks in advance!

Are the three samples in group? Like in my example, I has the factor: Treatment
and inside that factor there are two levels (Antibiotics and None)

What are your factors? What are your levels?

Sorry @colinbrislawn, maybe I was no clear enough, this is my first metagenomic analysis…
I have 3 sample, with no levels:
sample id sample
M-0 sample-1
M-50 sample-2
M-100 sample-3

I am interested in perform an abundance analysis comparing all samples each others. Perhaps I have a conceptual error, and this plugin is not suitable for this purpose. Could you give some advice?

Good morning Cristian,

Ah OK! So you want to perform three differential abundance tests
(Sample 1 vs 2)
(Sample 1 vs 3)
(Sample 2 vs 3)

This makes sense to me. I think the biggest issue is that differential abundance tests expect to compare groups of samples to each other, and they want more than one sample per group. You might be able to do this with ALDEx2… but I’m not sure how well that will work.

Let’s see what the developer of the ALDEx2 Qiime 2 plugin recommends!


Hi Colin,
That is exactly what I want to do! I dont know if ALDEx2 needs more than one sample per group, and if so, are there any other plugin or program that I could use?

1 Like

Hi @Cristian_Suarez and @colinbrislawn,
This isn’t an issue of ALDEx2 (or any other plugin for that matter) being able to handle n=1 per group or not, from a statistical perspective this just doesn’t make sense. There is no variance with n=1 to run any tests like you want. Even if for some weird reason (read: bug) a plugin can handle n=1, you shouldn’t rely on its output.


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