Cannot run DADA2 in the tutorials

I installed qiime2 2022.8 on macOS conda native installation. I have an M1 mac with 16 GB RAM.

when i run the Moving Pictures and Atacama tutorials, I get an error at the DADA2 step (but the Deblur option works in the Moving Pictures tutorial).

This is the error in the log file, which suggests that the R installation lacks Rcpp

cat /var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/
T/qiime2-q2cli-err-ghjj4s92.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 fil
es that no longer exist.

Command: run_dada.R --input_directory /var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/forward --inpu
t_directory_reverse /var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/reverse --output_path /var/folde
rs/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/output.tsv.biom --output_track /var/folders/s1/wpx8hzv51s9441b
4gxsrd_7w0000gn/T/tmpik5ces91/track.tsv --filtered_directory /var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmp
ik5ces91/filt_f --filtered_directory_reverse /var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/filt_r
--truncation_length 150 --truncation_length_reverse 150 --trim_left 13 --trim_left_reverse 13 --max_expected_erro

rs 2.0 --max_expected_errors_reverse 2.0 --truncation_quality_score 2 --min_overlap 12 --pooling_method independe
nt --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 1 --learn_min_reads 100
0000

R version 4.2.0 (2022-04-22)
Loading required package: Rcpp
Error: package or namespace load failed for ‘Rcpp’ in library.dynam(lib, package, package.lib):
 shared object ‘Rcpp.so’ not found
Error: package ‘Rcpp’ could not be loaded
Execution halted
Traceback (most recent call last):
  File "/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_dada2/_denoise.py", line
 308, in denoise_paired
    run_commands([cmd])
  File "/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_dada2/_denoise.py", line
 36, in run_commands
    subprocess.run(cmd, check=True)

  File "/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/var/folders/s1/wpx8hzv51s9441b4gxsr
d_7w0000gn/T/tmpik5ces91/forward', '--input_directory_reverse', '/var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T
/tmpik5ces91/reverse', '--output_path', '/var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/output.tsv.
biom', '--output_track', '/var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/track.tsv', '--filtered_di
rectory', '/var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/filt_f', '--filtered_directory_reverse',
'/var/folders/s1/wpx8hzv51s9441b4gxsrd_7w0000gn/T/tmpik5ces91/filt_r', '--truncation_length', '150', '--truncatio
n_length_reverse', '150', '--trim_left', '13', '--trim_left_reverse', '13', '--max_expected_errors', '2.0', '--ma
x_expected_errors_reverse', '2.0', '--truncation_quality_score', '2', '--min_overlap', '12', '--pooling_method',
'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allow_one_off', 'False', '--num_
threads', '1', '--learn_min_reads', '1000000']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2cli/commands.py", line 33
9, in __call__
    results = action(**arguments)
  File "<decorator-gen-291>", line 2, in denoise_paired
  File "/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line
 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line
 381, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_dada2/_denoise.py", line
 321, in denoise_paired
    raise Exception("An error was encountered while running DADA2"
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to
 learn more.
1 Like

Hello @dougwyu. It says there that you're using R version 4.2.0, but QIIME 2 2022.8 uses R version 4.1.3. Do you have R installed on your system from something other than QIIME 2?

1 Like

yes i am. i normally run R/RStudio outside of QIIME2. in fact, i have only just installed Q2. I have Rcpp installed under my normal R installation.

i did activate the qiime2 environment (2022.8).

It looks like your conda environment is using the version of R from outside the environment for some reason. Can you please go into a new terminal, activate your conda environment, then run the command type R and post the output here? I am unable to reproduce this issue, but it is something we have seen before.

it looks like R is my copy of R (it is indeed 4.2.0)

type R

R is /usr/local/bin/R

just to be clear, this is with the qiime2 env activated

(qiime2-2022.8) douglasyu@Dougs-MBP QIIME2 % type R
R is /usr/local/bin/R

That is strange. Try running the command rehash with the env active and seeing if type R changes to the one inside the conda env.

(base) douglasyu@Dougs-MBP QIIME2 % conda activate qiime2-2022.8
(qiime2-2022.8) douglasyu@Dougs-MBP QIIME2 % rehash
(qiime2-2022.8) douglasyu@Dougs-MBP QIIME2 % type R
R is /usr/local/bin/R

Can you provide the contents of your .zshrc? It's likely that R is set explicitly on your path ahead of miniconda.

1 Like

yes, /usr/local/bin is before qiime2/bin

(qiime2-2022.8) douglasyu@Dougs-MBP ~ % echo $PATH
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/douglasyu/opt/anaconda3/envs/qiime2-2022.8/bin:/Use
rs/douglasyu/opt/anaconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin

my .zshrc is not where this is set. i think it's just the order in which i installed things.

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/douglasyu/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/douglasyu/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/douglasyu/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/douglasyu/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

anaconda3/bin is being added to the head of your path in your .zshrc as it should be, but then a bunch of other stuff is being added to your path ahead of anaconda3/bin. Can you put the portion of your .zshrc you posted here at the very bottom of the .zshrc to ensure anaconda3/bin is the last thing your .zshrc is adding to the head of your path? If it is already at the very bottom of your .zshrc then I'm not sure where the rest of that stuff on your path is coming from. The order in which you installed things could affect where in your .zshrc these things end up, but your .zshrc runs every time you open a new zsh terminal meaning that should be added to the head of your path every time you open a new zsh terminal unless something else is somehow modifying your path after your .zshrc does.

1 Like

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