Error in run DADA2

Hi
I use QIIME2-2019.4 in a Linux machine.
When I do quality control using data2, error encountered.

The command lines I use are:

qiime dada2 denoise-paired
--i-demultiplexed-seqs test_paired-end-demux.qza
--p-trim-left-f 0
--p-trim-left-r 6
--p-trunc-len-f 120
--p-trunc-len-r 66
--o-representative-sequences test_rep-seqs-dada2.qza
--o-table test_pet-table.qza
--p-n-threads FALSE
--o-denoising-stats test_stats-dada2.qza

Then the following lines were print:

Traceback (most recent call last):
File "/home/xychu/anaconda2/envs/qiime2-2019.4/bin/qiime", line 11, in
sys.exit(qiime())
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1135, in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 641, in make_context
self.parse_args(ctx, args)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/click/command.py", line 59, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1469, in handle_parse_result
value = self.full_process_value(ctx, value)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/click/option.py", line 149, in full_process_value
return super().full_process_value(ctx, value)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1790, in full_process_value
return Parameter.full_process_value(self, ctx, value)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1438, in full_process_value
value = self.process_value(ctx, value)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1428, in process_value
return self.type_cast_value(ctx, value)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/click/option.py", line 203, in type_cast_value
return super().type_cast_value(ctx, value)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1417, in type_cast_value
return _convert(value, (self.nargs != 1) + bool(self.multiple))
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/core.py", line 1415, in _convert
return self.type(value, self, ctx)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/click/types.py", line 39, in call
return self.convert(value, param, ctx)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/click/type.py", line 79, in convert
return self._convert_primitive(value, param, ctx)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/click/type.py", line 172, in _convert_primitive
return qiime2.sdk.util.parse_primitive(self.type_expr, value)
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/core/type/util.py", line 213, in parse_primitive
result.append(_interrogate_types(allowed, v))
File "/home/xychu/anaconda2/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/core/type/util.py", line 170, in _interrogate_types
raise _COERCE_ERROR
ValueError: Could not coerce value based on expression provided.

I searched for the problem on the forum but find nothing the same.
The QA plots of the sequence data are:

Hi @Xinyi_Chu!
This error message is new to me, too. I suspect the line above is the cause.

If you take a look at the denoise-paired docs, that line takes an integer value. Correct that, and let us know if you have any further issues. :smile:

Generally, QIIME 2 provides better error reporting when an argument of invalid type is passed - I’ll look into this situation and see what we can do to make it better.

Thanks!
:coffee: :snail: Chris Keefe

2 Likes

Hi ChrisKeefe,

Thanks a lot for your reply!

In fact, I set the parameter --p-n-threads in this way to avoid another error. If an integer value follows (even 0 ), I got error code 1:

qiime dada2 denoise-paired \
--i-demultiplexed-seqs test_paired-end-demux.qza \
--p-trim-left-f 0 \
--p-trim-left-r 6 \
--p-trunc-len-f 120 \
--p-trunc-len-r 66 \
--o-representative-sequences test_rep-seqs-dada2.qza \
--o-table test_pet-table.qza \
--p-n-threads 0 \
--o-denoising-stats test_stats-dada2.qza

> 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-gi4lpx8m.log

The qiime2-q2cli-err-gi4lpx8m.log is showed in picture.


It seems something wrong with my R(version 3.5.1).

On the other hand, I just find a similar problem, Dada2 plugin error return code error 1. Whether the data quality (as shown in figure I initially provided) cause the problem?

@Xinyi_Chu, I suspect you may be on the right track re: quality. Searching the forum for keywords from your error messages e.g. isBimeraDenovoTable will often return helpful results:

With your current parameters, (which seem pretty reasonable given the quality of the reverse reads), you would be limited to joining amplicons of ~160bp or shorter, which could be causing a complete loss of sequences.

If that’s very close to your target amplicon length, it might be worth playing with the trim/trunc settings. Otherwise, you might try running dada2 denoise-single to see what the forward reads give you to work with.

Thanks for your help @ChrisKeefe.
Single-end analysis works. While change trim/trunc settings seem can not handle the error, maybe due to the poor quality of reverse reads.

Well, just tried another trim/trunc setting I saw elsewhere and no error occur:

qiime dada2 denoise-paired
–i-demultiplexed-seqs test_paired-end-demux.qza
–p-trim-left-f 0
–p-trim-left-r 0
–p-trunc-len-f 0
–p-trunc-len-r 0
–o-representative-sequences test_rep-seqs-dada2.qza
–o-table test_pet-table.qza
–p-n-threads 0
–o-denoising-stats test_stats-dada2.qza

However, I’m confused about the meaning of “–p-trunc-len = 0”. Does it mean no truncation happened? If “clean” fastq data was used, is this setting a suitable choice?

Re: --p-trunc-len, check out the q2-dada2 docs mentioned above. They’re a great resource, and are also available in the command line by passing --help to a given QIIME 2 command. For example, qiime dada2 denoise-paired --help.

Whether parameter choices are “suitable” is highly subjective. Your parameter selection should help you optimize the number of good-quality reads available for downstream analysis, by removing positions with low quality scores, while allowing enough length for read joining. :dna: There is extensive discussion of trim and truncation length selection for DADA2 in these forums. A quick search will bring up many results.

I strongly encourage you to do some reading :face_with_monocle: about what those parameters do, and how to make appropriate selections for your unique data. The denoising-stats report generated by DADA2 can also be a valuable diagnostic tool. The Atacama tutorial has an example of how to visualize that report. It sounds like you’re moving in the right direction here.

Good luck, and let us know if you run into any trouble in your search.
Chris

Thanks Chris. The docs are really useful.

A useful disscussion about truncation lengths and features number: DADA2, truncation lengths and features number, which solved another question I met.

Thank you, @Xinyi_Chu!
That post isn’t one I’ve seen before, and Ben’s explanation is fantastic. :brain: I’ll come back to that in the future for sure.

I hope the rest of your analysis goes smoothly!
Let us know if you have any more questions,
Chris