qiime2 cannot calculate diversity core-metrics-phylogenetic (wsl ubuntu)

I run ubuntu 18.04 under windows 10 (wsl), and installed qiime2 2020.06 successfully. according to "Moving Pictures” tutorial, after i run

>     qiime diversity core-metrics-phylogenetic \
>       --i-phylogeny rooted-tree.qza \
>       --i-table table.qza \
>       --p-sampling-depth 1103 \
>       --m-metadata-file sample-metadata.tsv \
>       --output-dir core-metrics-results

i got this error


and the error log below:
/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/sklearn/metrics/pairwise.py:1761: DataConversionWarning: Data was converted to boolean for metric jaccard
warnings.warn(msg, DataConversionWarning)
/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/skbio/stats/ordination/_principal_coordinate_analysis.py:152: RuntimeWarning: The result contains negative eigenvalues. Please compare their magnitude with the magnitude of some of the largest positive eigenvalues. If the negative ones are smaller, it's probably safe to ignore them, but if they are large in magnitude, the results won't be useful. See the Notes section for more details. The smallest eigenvalue is -0.010007913933374881 and the largest is 3.2706161221743475.
RuntimeWarning
/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/skbio/stats/ordination/_principal_coordinate_analysis.py:152: RuntimeWarning: The result contains negative eigenvalues. Please compare their magnitude with the magnitude of some of the largest positive eigenvalues. If the negative ones are smaller, it's probably safe to ignore them, but if they are large in magnitude, the results won't be useful. See the Notes section for more details. The smallest eigenvalue is -0.006226621281657183 and the largest is 2.4503863256040694.
RuntimeWarning
/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/skbio/stats/ordination/_principal_coordinate_analysis.py:152: RuntimeWarning: The result contains negative eigenvalues. Please compare their magnitude with the magnitude of some of the largest positive eigenvalues. If the negative ones are smaller, it's probably safe to ignore them, but if they are large in magnitude, the results won't be useful. See the Notes section for more details. The smallest eigenvalue is -0.016049091690797244 and the largest is 2.3773044829236856.
RuntimeWarning
Traceback (most recent call last):
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/commands.py", line 329, in call
results = action(**arguments)
File "", line 2, in core_metrics_phylogenetic
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
output_types, provenance)
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/action.py", line 512, in callable_executor
aliased_result = output._alias(prov)
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/result.py", line 163, in _alias
self.type, self.format, clone_original, provenance_capture)
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/core/archive/archiver.py", line 316, in from_data
Format.write(rec, type, format, data_initializer, provenance_capture)
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/core/archive/format/v5.py", line 21, in write
provenance_capture)
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/core/archive/format/v1.py", line 19, in write
provenance_capture)
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/core/archive/format/v0.py", line 62, in write
data_initializer(data_dir)
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/result.py", line 158, in clone_original
copy_function=os.link) # Use hardlinks
File "/home/mkkuser/miniconda2/envs/qiime2-2020.6/lib/python3.6/shutil.py", line 365, in copytree
raise Error(errors)
shutil.Error: [('/tmp/qiime2-archive-8sb63ska/fa289b1f-4160-490a-a82c-182d43c40f5f/data/feature-table.biom', '/tmp/qiime2-archive-9j1lo8ax/d1df3e07-0ea2-4d67-b2af-09ae611c5e8c/data/feature-table.biom', "[Errno 13] Permission denied: '/tmp/qiime2-archive-8sb63ska/fa289b1f-4160-490a-a82c-182d43c40f5f/data/feature-table.biom' -> '/tmp/qiime2-archive-9j1lo8ax/d1df3e07-0ea2-4d67-b2af-09ae611c5e8c/data/feature-table.biom'")]

so my question is how to solve it. if it needs more infomation and someone have solution , please let me know, thanks a lot!

Hello @mkk. It looks you got a permission error from shutil.copytree. One thing you might try is rerunning the command with a sudo at the beginning. That should run the command as an administrator which usually gets around permissions related issues.

It’s unusual to have to do that for QIIME 2 though. Were you able to run the tutorial up to that command with no issues?

Thanks @Oddant1!

Generally speaking, sudo should be considered a dangerous command to leverage, and usually isn’t going to solve the root of the problem (see what I did there?). In this case, please take a closer look at your file permissions - it is possible that things are set up in a way that your WSL user account doesn’t have the necessary permissions.

Since QIIME 2 just honors whatever the file permissions are, the “right” way to solve this at the filesystem level - there isn’t anything you can do in QIIME 2 to circumvent those permission.

Keep us posted, @mkk!

4 Likes

thanks a lot! how to change my WSL user account


it seems i have ALL right to command
looking forward to reply, thanks!

thank you for reply! “sudo” is not useful. i run before code and after code,which is no problem (result files were download for after analysis ).

sudo should actually be run as part of the command, not before or after it, like this:

sudo qiime diversity core-metr...

But, before you do that - please see my response above:

sudo is a dangerous tool, and the consequences of misusing it can be catastrophic (for example, accidentally removing all of the content on your hard drive).

thanks a lot !
i used sudo like sudo qiime diversity core-metrics-phylogenetic .... but it showed

sudo: qiime: command not found

Furthermore, i run qiime diversity core-metrics-phylogeneti c...code under root, it still had the same errror :joy:

mybe this code is not useful for wsl. I will go into next tutorial. :grinning:

very thank you!

“sudo chmod 777 /tmp” may be useful. :grinning:

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