dada2 issue - An error was encountered while running DADA2 in R (return code 1)

I read some previous posts about this error, but the log was slightly different and the suggestions weren’t helpful.

I used these instructions on QIIME1, to import some Roche454 data into QIIME2.
I successfully created a .qza file, then I tried to run denoise-pyro, as follows:

qiime dada2 denoise-pyro --i-demultiplexed-seqs /home/genomica/DATA/metagenomica/Bactrocera/sequenze/single_end.qza --p-trunc-len 0 --output-dir /home/genomica/DATA/metagenomica/Bactrocera/denoise --verbose

But that’s what I got:

(qiime2-2019.7) [genomica@localhost Bactrocera]$ qiime dada2 denoise-pyro --i-demultiplexed-seqs /home/genomica/DATA/metagenomica/Bactrocera/sequenze/single_end.qza --p-trunc-len 0 --output-dir /home/genomica/DATA/metagenomica/Bactrocera/denoise --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 /tmp/qiime2-archive-ng5mwdov/92863a33-b30f-47fa-8e93-2fe5e8a4d173/data /tmp/tmp0d53rpm6/output.tsv.biom /tmp/tmp0d53rpm6/track.tsv /tmp/tmp0d53rpm6 0 0 2.0 2 Inf consensus 1.0 1 250000 -1 32

R version 3.5.1 (2018-07-02)
Carico il pacchetto richiesto: Rcpp
DADA2: 1.10.0 / Rcpp: 1.0.2 / RcppParallel: 4.4.3
1) Filtering Error in add(bin) : internal: buf != <newline>
Esecuzione interrotta
Traceback (most recent call last):
  File "/home/genomica/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 154, in _denoise_single
    run_commands([cmd])
  File "/home/genomica/miniconda2/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/genomica/miniconda2/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-ng5mwdov/92863a33-b30f-47fa-8e93-2fe5e8a4d173/data', '/tmp/tmp0d53rpm6/output.tsv.biom', '/tmp/tmp0d53rpm6/track.tsv', '/tmp/tmp0d53rpm6', '0', '0', '2.0', '2', 'Inf', 'consensus', '1.0', '1', '250000', '-1', '32']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/genomica/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/commands.py", line 327, in __call__
    results = action(**arguments)
  File "</home/genomica/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/decorator.py:decorator-gen-461>", line 2, in denoise_pyro
  File "/home/genomica/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py", line 240, in bound_callable
    output_types, provenance)
  File "/home/genomica/miniconda2/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/genomica/miniconda2/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 274, in denoise_pyro
    band_size='32')
  File "/home/genomica/miniconda2/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.

Plugin error from dada2:

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

See above for debug info.

What may be wrong there? Thanks in advance!
I’m using qiime2-2019.7

Hello @Sparkle

Let me see how I can help!

Can you run this for me and post the results?
qiime tools validate single_end.qza

Colin

2 Likes

Sure, here is the result!

(qiime2-2019.7) [genomica@localhost sequenze]$ qiime tools validate single_end.qza
Result single_end.qza does not appear to be valid at level=max:

  /tmp/qiime2-archive-tnutrtym/92863a33-b30f-47fa-8e93-2fe5e8a4d173/data/sample-1_0_L001_R1_001.fastq.gz is not a(n) FastqGzFormat file:

  Quality score length doesn't match sequence length for record beginning on line 485

Well, there's your issue. :scream_cat:

Quality score length doesn't match sequence length for record beginning on line 485


... Let's go back one step.

So after you run convert_fastaqual_fastq.py and you have fastq files, try importing them directly into Qiime 2 using the cutadapt demux-single command.
https://docs.qiime2.org/2019.7/plugins/available/cutadapt/demux-single/

Colin

Hello, thanks for your answer!
I tried that, and went back to where a reads.fastq file was generated, by running convert_fastaqual_fastq.py

Then I ran:

qiime cutadapt demux-single --i-seqs /home/genomica/DATA/metagenomica/Bactrocera/seqs.fastq --m-barcodes-file /home/genomica/DATA/metagenomica/Bactrocera/mapping_tot.txt --m-barcodes-column BarcodeSequence --output-dir output_demuxsingle

But apparently the input file has to be a .qza artifact, and a .fastq file won't be recognized by the script.

(1/1) Invalid value for "--i-seqs":
'/home/genomica/DATA/metagenomica/Bactrocera/seqs.fastq' is not a QIIME 2
Artifact (.qza)

I tried to use the previously generated .qza (by qiime tools import) but this didn't work either.

 (1/1) Invalid value for "--i-seqs": Expected an artifact of at least type
  MultiplexedSingleEndBarcodeInSequence. An artifact of type
  SampleData[SequencesWithQuality] was provided.

Any suggestions? Thanks in advance!

1 Like

That's correct.

I didn't explain all the details here, but here's the idea: The big issues with 454 data is that is comes in a .fasta file and a .qual file. But once you have .fastq files, you can use the normal methods shown in the Qiime 2 tutorials because the data is in the same format as single end Illumina or Ion Torrent data.

So with your converted fastq files, you should be able to jump right into the importing step of the new Parkinson’s Mouse Tutorial.
https://docs.qiime2.org/2019.7/tutorials/pd-mice/#importing-data-into-qiime-2

That step will import your fastq files into the .qza file and avoid that error!

Once you get to dada2, you will use denoise-pyro, but you know that already! :+1:

Colin

1 Like

Thank you! However, I solved the problem by changing the parameters of the qiime import script with this

qiime tools import --type 'SampleData[SequencesWithQuality]' --input-path manifest.txt --output-path /home/genomica/DATA/metagenomica/Bactrocera/sequenze/single_end2.qza --input-format SingleEndFastqManifestPhred33V2

It looks as if the tools import script has changed since this (December 2018) has been posted, and particularly, the old topic mentioned a wrong input-format and wanted a directory with --input-path, not a manifest.txt file. So, it possibly generated a conceptually wrong file... as the validate script detected!

Then, I ran:

qiime tools validate single_end.qza

Result single_end2.qza appears to be valid at level=max.

And everything worked fine! I was also able to continue my analysis with dada2 denoise-pyro with no errors and coherent output!

However, thank you for your support!

2 Likes

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