Error during denoise using data2 with the demo data in “Moving Pictures” tutorial

Dear all,

I’m moving from qiime1 to qiime2. So, I try to run the analysis with the demo data “Moving Pictures” tutorial first. But unfortunately, I stuck in the denoise step. There are several similar question on the Forum. Only one is the same as mine. But the question was not solved.

Here is the command:
qiime dada2 denoise-single
–i-demultiplexed-seqs demux.qza
–p-trim-left 0
–p-trunc-len 120
–o-representative-sequences rep-seqs-dada2.qza
–o-table table-dada2.qza
–o-denoising-stats stats-dada2.qza

Error:
Plugin error from dada2:

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

Debug info has been saved to /tmp/qiime2-q2cli-err-twf75dc2.log

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_dada_single.R /tmp/qiime2-archive-qpt8h0jt/23109903-0ad5-408f-b6c5-e049dcbe41c8/data /tmp/tmpp9h4i9h7/output.tsv.biom /tmp/tmpp9h4i9h7/track.tsv /tmp/tmpp9h4i9h7 120 0 2.0 2 Inf consensus 1.0 1 1000000 NULL 16

R version 3.5.1 (2018-07-02)
Loading required package: Rcpp
Error: package or namespace load failed for ‘Rcpp’:
package ‘Rcpp’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Error: package ‘Rcpp’ could not be loaded
Execution halted
Traceback (most recent call last):
File “/home/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 154, in _denoise_single
run_commands([cmd])
File “/home/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 36, in run_commands
subprocess.run(cmd, check=True)
File “/home/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/subprocess.py”, line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘run_dada_single.R’, ‘/tmp/qiime2-archive-qpt8h0jt/23109903-0ad5-408f-b6c5-e049dcbe41c8/data’, ‘/tmp/tmpp9h4i9h7/output.tsv.biom’, ‘/tmp/tmpp9h4i9h7/track.tsv’, ‘/tmp/tmpp9h4i9h7’, ‘120’, ‘0’, ‘2.0’, ‘2’, ‘Inf’, ‘consensus’, ‘1.0’, ‘1’, ‘1000000’, ‘NULL’, ‘16’]’ returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/commands.py”, line 327, in call
results = action(**arguments)
File “</home/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/decorator.py:decorator-gen-457>”, line 2, in denoise_single
File “/home/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 240, in bound_callable
output_types, provenance)
File “/home/jiaxu/anaconda2/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/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 189, in denoise_single
band_size=‘16’)
File “/home/jiaxu/anaconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 165, in _denoise_single
" and stderr to learn more." % e.returncode)
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

I would appreciate it if anyone could help me with this.

Best regards,
Claire

Hi @Claire010!

Looks like the conda environment with QIIME 2 in it has a bit of pollution from elsewhere on your system:

After activating your QIIME 2 environment, please run the following command and return the results here:

R -e ".libPaths()"

Thanks!

Hi Matthew,

Thanks for your prompt reply. Following is the result.

R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-conda_cos6-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

.libPaths()
[1] "/home/claire/software/R-3.3.1/library"
[2] "/home/claire/software/R"
[3] "/usr/local/lib/R/site-library"
[4] "/usr/lib/R/site-library"
[5] "/usr/lib/R/library"
[6] "/home/claire/anaconda2/envs/qiime2-2019.7/lib/R/library"

Hi @thermokarst:

I’ve run the command following your guidance. Any suggestions based on the output?

Thanks,
Claire

Ah ha, here is the issue! You have many r paths defined (I think those are most-often found in .Rprofile). Anyway, your QIIME 2 env is the very last one, which means, when you try and load things in R (like dada2), if that package exists at any of the lower-numbered entries, that version will be loaded (instead of the one in the QIIME 2 env). Anyway, it looks like you have bit of housekeeping to do w.r.t. .Rprofile. Did you construct that file yourself? By comparison, here is what it looks like on my machine (I don't have an .Rprofile:

> .libPaths()
[1] "/home/matthew/.conda/envs/qiime2-2019.7/lib/R/library"

Hi @thermokarst

Actually I didn’t make any .Rprofile myself. It seems to be a default setting when I installed R on the server.

Would you suggest me find .Rprofile, then delete all the other r paths to solve this problem?

Claire

Yep. Maybe make a backup of the file before editing it, just in case.

Sure. Thanks for the reminder. I will have a try, then let you know whether it works or not.

1 Like