Error occuring with Aldex


I’m trying to run aldex2, and even though I have already installed it using R and condo, I still get the following error running the command below:

qiime aldex2 aldex2 --i-table table.qza --m-metadata-file sample-metadata.tsv --m-metadata-column subject --o-differentials differentials.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_aldex2.R /var/folders/8f/d1b8lmn12d955nfl54sk1xqn1sm5d2/T/tmpn7tucd9d/input.tsv.biom /var/folders/8f/d1b8lmn12d955nfl54sk1xqn1sm5d2/T/tmpn7tucd9d/ subject 128 t all /var/folders/8f/d1b8lmn12d955nfl54sk1xqn1sm5d2/T/tmpn7tucd9d/output.summary.txt

R version 3.5.1 (2018-07-02)
Error in library(ALDEx2) : there is no package called ‘ALDEx2’
Execution halted
Traceback (most recent call last):
File “/Users/parbab/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_aldex2/”, line 59, in aldex2
File “/Users/parbab/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_aldex2/”, line 21, in run_commands, check=True)
File “/Users/parbab/miniconda2/envs/qiime2-2019.7/lib/python3.6/”, line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘run_aldex2.R’, ‘/var/folders/8f/d1b8lmn12d955nfl54sk1xqn1sm5d2/T/tmpn7tucd9d/input.tsv.biom’, ‘/var/folders/8f/d1b8lmn12d955nfl54sk1xqn1sm5d2/T/tmpn7tucd9d/’, ‘subject’, ‘128’, ‘t’, ‘all’, ‘/var/folders/8f/d1b8lmn12d955nfl54sk1xqn1sm5d2/T/tmpn7tucd9d/output.summary.txt’]’ returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/parbab/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/”, line 327, in call
results = action(**arguments)
File “</Users/parbab/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/>”, line 2, in aldex2
File “/Users/parbab/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/”, line 240, in bound_callable
output_types, provenance)
File “/Users/parbab/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/”, line 383, in callable_executor
output_views = self._callable(**view_args)
File “/Users/parbab/miniconda2/envs/qiime2-2019.7/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.

I’d appreciate your help on this :slight_smile:

I suspect this is the main ussue:

Error in library(ALDEx2) : there is no package called ‘ALDEx2’

What happened at this step of the installation instructions?


Yes, the installation part in R is like this:

trying URL ‘
Content type ‘application/x-gzip’ length 94951 bytes (92 KB)
downloaded 92 KB

The downloaded binary packages are in

Bioconductor version 3.9 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
Installing package(s) ‘ALDEx2’
trying URL ‘
Content type ‘application/x-gzip’ length 1037145 bytes (1012 KB)
downloaded 1012 KB

The downloaded binary packages are in

Those are different versions of R: the error messages that qiime aldex2 aldex2 gave you say they’re from R 3.5.1, while the installation message you got says it’s from R 3.6.1.

I think this discrepancy means you need to activate your QIIME 2 conda environment before running these installation commands. Could you try re-running these installation commands after activating your QIIME 2 environment?

1 Like

I did, but the error occurred again.

1 Like

Hm, that’s interesting. Just to make sure we’re on the same page, you got the exact same error as before (with the text “Error in library(ALDEx2) : there is no package called ‘ALDEx2’”)?

Not sure what the cause of getting that error again could be, but I looked it up and it seems like in the past this sort of error has been avoidable by installing ALDEx2’s R dependencies through conda, rather than through R directly. Could you try running

conda install bioconductor-aldex2 -c defaults -c bioconda -c conda-forge

and see if this fixes things?

Sorry for all the trouble and thanks!

(I’m copying @dgiguer here in case he has any ALDEx2 wisdom :slight_smile: )

1 Like

It worked!
Thanks a lot :slight_smile:

1 Like