I am using Qiime2 2019.7 natively installed on an iMac (MacOS 10.12.6).
I have a dataset of samples from participants of varying ages from early childhood to late adolescence. I suspect that age may be a confounding factor in this dataset and so I am trying to run
qiime diversity adonis with formulas that include age and the other metadata factors that came up significant in my initial beta diversity analyses.
The first commands I tried to do this look like (have edited a little bit for privacy):
for i in Factor1 Factor2 Factor3 do qiime diversity adonis --i-distance-matrix "$i"_diversity_30000/unweighted_unifrac_distance_matrix.qza --m-metadata-file ../ProjectName_2015_map_MHD_20190903.txt --p-formula "Age*"$i"" --o-visualization "$i"_diversity_30000/uwuf_Age_"$i"_results.qzv done
In each case, the specific distance matrix being called had been constructed from a feature table previously filtered using
qiime feature-table filter-samples to remove samples that had ‘unknown’ values for the metadata column being tested (there were no unknown values in Age). I did this individually for each metadata variable/column that had missing or unknown values to try to retain as many samples as possible for each individual analysis. That is, I removed samples that had ‘unknown’ values in Factor1 from the table, then generated a distance matrix from that table and used the distance matrix to test the significance of Factor1, then repeated the whole process for Factor2 and Factor3 and so on. I didn’t remove all samples with unknown values in any column.
I got output that I think makes sense when the additional Factor being tested was categorical (e.g. a disease state), but didn’t get output for either of two continuous variables I was trying to test an interaction with Age for.
I re-ran the command for one of the continuous variables individually (i.e. not as part of a loop) and got this error message:
Plugin error from diversity:
Command '[‘run_adonis.R’, ‘/var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/tmpyequa9yw/dm.tsv’, ‘/var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/tmpyequa9yw/md.tsv’, ‘Age*Factor3, ‘999’, ‘1’, ‘/var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/qiime2-temp-bjuwz0ri/adonis.tsv’]’ returned non-zero exit status 1.
Re-running with the
--verbose flag (sorry for the wall of text):
Running external command line application. This may print messages to stdout and/or stderr.
The command being run is below. This command cannot be manually re-run as it will depend on temporary files that no longer exist.
Command: run_adonis.R /var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/tmp4det8n0c/dm.tsv /var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/tmp4det8n0c/md.tsv Age*Factor3 999 1 /var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/qiime2-temp-fxbasdd3/adonis.tsv
R version 3.5.1 (2018-07-02)
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-5
Error in G * t(hat) : non-conformable arrays
Calls: adonis -> sapply -> lapply -> FUN
Traceback (most recent call last):
File “/Users/matildahd/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/commands.py”, line 327, in call
results = action(**arguments)
File “</Users/matildahd/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/decorator.py:decorator-gen-432>”, line 2, in adonis
File “/Users/matildahd/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 240, in bound_callable
File “/Users/matildahd/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 445, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/Users/matildahd/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_diversity/_beta/_visualizer.py”, line 367, in adonis
File “/Users/matildahd/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_diversity/_beta/_visualizer.py”, line 393, in _run_command
File “/Users/matildahd/miniconda3/envs/qiime2-2019.7/lib/python3.6/subprocess.py”, line 418, in run
subprocess.CalledProcessError: Command ‘[‘run_adonis.R’, ‘/var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/tmp4det8n0c/dm.tsv’, ‘/var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/tmp4det8n0c/md.tsv’, ‘Age*Factor3’, ‘999’, ‘1’, ‘/var/folders/mb/vtxl0zps5435mr78csnrjpjr0000gr/T/qiime2-temp-fxbasdd3/adonis.tsv’]’ returned non-zero exit status 1.
Based on other(1) threads(2) here, I’m guessing the line about non-conformable arrays points to the source of the problem, but I don’t know where to go from here. I don’t think there should be NA or missing values (for the specific variables being tested) because I filtered them out of the feature table before generating the distance matrices.
Any ideas on how to make this work, and also why it might have worked for categorical variables but not continuous?
Thank you very much!