Cannot open compressed file (dada2 denoise single)

I am running through the QIIME2 moving pictures tutorial and currently running the dada2 denoise-single step.

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

It looks like the program is having a hard time accessing a temporary file. See error message below. I have run the previous steps in the tutorial without error and even downloaded the demux.qza file to make sure I had the correct file too.

Software info
Version of QIIME2: 2022.2.0
Installed using conda
OS: MacOS Monterey 12.4
Memory: 16GB

(qiime2-2022.2) Stephanies-MacBook-Pro-2:qiime2 stephanierosen$ 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 --verbose
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 /var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/qiime2-archive-d1xn61ra/ba64bfaf-fe59-4dd5-92ec-ce220572eb07/data /var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/tmp6i3hmhc1/output.tsv.biom /var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/tmp6i3hmhc1/track.tsv /var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/tmp6i3hmhc1 120 0 2.0 2 Inf independent consensus 1.0 1 1000000 NULL 16

R version 4.1.3 (2022-03-10) 
Loading required package: Rcpp
DADA2: 1.22.0 / Rcpp: / RcppParallel: 5.1.5 
1) Filtering ..................................
2) Learning Error Rates
19539480 total bases in 162829 reads from 34 samples will be used for learning the error rates.
3) Denoise samples ..................................
4) Remove chimeras (method = consensus)
5) Report read numbers through the pipeline
6) Write output
Error in gzfile(file, mode) : cannot open the connection
Calls: saveRDS -> gzfile
In addition: Warning message:
In gzfile(file, mode) :
  cannot open compressed file '/var/folders/04/zs8w6wzd0_356lfq1p4krdsh0000gn/T/tmp6i3hmhc1/output.rds.biom', probable reason 'No such file or directory'
Execution halted
Traceback (most recent call last):
  File "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/", line 195, in _denoise_single
  File "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/", line 36, in run_commands, check=True)
  File "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada_single.R', '/var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/qiime2-archive-d1xn61ra/ba64bfaf-fe59-4dd5-92ec-ce220572eb07/data', '/var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/tmp6i3hmhc1/output.tsv.biom', '/var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/tmp6i3hmhc1/track.tsv', '/var/folders/04/zs8w6wzd0_356lfq1p4ktsvh0000gn/T/tmp6i3hmhc1', '120', '0', '2.0', '2', 'Inf', 'independent', '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 "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/", line 339, in __call__
    results = action(**arguments)
  File "<decorator-gen-449>", line 2, in denoise_single
  File "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/", line 245, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/", line 391, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/", line 218, in denoise_single
    return _denoise_single(
  File "/Users/stephanierosen/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/", line 204, in _denoise_single
    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.

Thank you!


There have been a lot of recent changes to q2-dada2, could you try installing the most recent development version and seeing if that works? Here is the link to the install instructions.