Aldex2 error "only two condition levels are currently supported"

Can anyone tell me what the following error means?

My metadata only has two levels (MOR and VEH) so I don't understand what it is asking me?

(qiime2-2019.7) hharder@ni-murn8c9-p915:~$ qiime aldex2 aldex2 --i-table table.qza --m-metadata-file metadata_corrected_2.tsv --m-metadata-column Txt --output-dir Txt-test --verbose
/home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_aldex2/_method.py:39: FutureWarning:
Passing list-likes to .loc or [] with any missing label will raise
KeyError in the future, you can use .reindex() as an alternative.

See the documentation here:
https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike
meta = meta.loc[list(table.index)]
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/tmprwe2bv59/input.tsv.biom /tmp/tmprwe2bv59/input.map.txt Txt 128 t all /tmp/tmprwe2bv59/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
Execution halted
Traceback (most recent call last):
File "/home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_aldex2/_method.py", line 59, in aldex2
run_commands([cmd])
File "/home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_aldex2/_method.py", line 21, in run_commands
subprocess.run(cmd, check=True)
File "/home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['run_aldex2.R', '/tmp/tmprwe2bv59/input.tsv.biom', '/tmp/tmprwe2bv59/input.map.txt', 'Txt', '128', 't', 'all', '/tmp/tmprwe2bv59/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/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/commands.py", line 327, in call
results = action(**arguments)
File "</home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/decorator.py:decorator-gen-481>", line 2, in aldex2
File "/home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py", line 240, in bound_callable
output_types, provenance)
File "/home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py", line 383, in callable_executor
output_views = self._callable(**view_args)
File "/home/hharder/ENTER/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_aldex2/_method.py", 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.

Plugin error from aldex2:

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

See above for debug info.

I've attached my metadata file as well to show that Txt only has two values.

metadata_corrected_2.tsv (14.0 KB)

Hello @hharder,

If you also share your table.qza I can try to reproduce the problem.

Thanks.

table.qza (233.7 KB)

Here it is.

Hello @hharder,

The issue is that you have a sample, namely 31B_287, that is present in your table and not in your metadata. The best solution is probably to add a row into your metadata for that sample. The error messages were not very helpful, you're right.

Thanks.

2 Likes

Thank you! When I used metadata that included that sample, it worked. But I want to remove that sample from my analysis. How can I filter that sample out of my table? I tried to filter using the following code:

qiime feature-table filter-samples --i-table table.qza --m-metadata-file samples-to-keep.tsv --o-filtered-table filtered-table.qza

samples-to-keep.tsv (1.4 KB)

filtered-table.qza (46.0 KB)

But when I try to use it in Aldex2, it returns the following error:

"Error in read.table(file = file, header = header, sep = sep, quote = quote, :
first five rows are empty: giving up"

How can I better filter my table to remove that row?

1 Like

@hharder,

You need to add these options to the filter-samples command: --p-where "[sample-id]='31B_287'" and --p-exclude-ids.

EDIT: sorry, I glossed over your response before. What you're trying to do isn't supported by this command. Instead you have to pass your original metadata file and then use the --p-where flag (see above) to specify what to filter out/retain. Hope this makes sense.

Thanks.

Thank you so much! Adding in the original metadata file worked! How can I view the filtered table just to double check? (But it looks to have worked because it runs in Aldex2 now!)

@hharder,

You can run $qiime feature-table summarize and then look at it at view.qiime2.org.

2 Likes

Yes, it worked! The filtered table now has only 180 samples (the original had 181). Thanks for your help!

1 Like