Questions on DADA2 implementation


I would like to ask a couple of questions about how best to utilise DADA2 as implemented within Qiime2. I have found there to be a couple of inconsistencies between the guidance given on using DADA2 within Qiime2 and as described through the DADA2 github. Please could anyone clarify the following points?

Firstly, to use DADA2 within Qiime2, it is very clear that it is necessary to remove the primers prior to denoising the data. I found this post suggesting that in alternative DADA2 implementations, primer removal could be conducting within the DADA2 pipeline itself. Hypothetically, could the trim_left_f/trim_left_r parameters of DADA2 in Qiime2 be used to similar effect? Ie importing data which includes primers, but trimming them as the first stage of the denoise process? I have an alternative (better I think) workflow, but am interested if this would be an option in any scenario?

Secondly, when working with ITS amplicons, it is suggested here, that it is beneficial not to truncate reads at a fixed length due to the substantially variable locus length. However within the Qiime2 implementation of DADA2 trunc_len_f and trunc_len_r are required parameters. In this use case, what (if any) advice can you provide on how to define DADA2 parameters? Would it be possible for an alternative implementation, whereby there is a minimum read length (or else discarded), and truncation beyond this read length based upon read quality, as to maintain the variable length of reads, provided read quality is sufficient? I am currently uncertain of the best methods for handling the interactions between trunc_len_r/trunc_len_f and trunc_q, and maximising the value of my data.

Many thanks for your work, and making Qiime2 so enjoyable to use.

1 Like

q2-dada2 is simply a wrapper around DADA2 — the trim-left-f and trim-left-r params in the plugin are passed straight through to DADA2, so to answer your question: yep!

The same as above applies here - these parameters are passed through. The parameter is required, but can be disabled by setting the value(s) to 0. Please see the docs for more details!

Just to clarify as well, q2-dada2 isn’t an alternative implementation of DADA2 — it is just a wrapper plugin around DADA2, so you don’t have to worry about differing results between “vanilla” DADA2 and q2-dada2! :tada:

Thanks! :smile:

As far as the other points in your post, I will defer to @benjjneb. Thanks!


Yes this is valid approach. Our recommendation is to use the dedicated primer-removal tools because they are more general-purpose and can handle certain other rare situations, but if you know your primer length and its always at the start of the read, then using trim-left will work just fine.

As @thermokarst mentioned, truncation is now optional in the new Q2 update (by setting trunc_len to 0). For ITS amplicons in which the length variation causes reads to sometimes extend into the opposite primer, we recommend that you turn off length truncation (but here you really have to remove F/R primers before running the pipeline, as trim-left won’t remove primer sequence at the ends of reads!). There is a default requirement of a min-length of 20 (that isn’t changeable in the Q2 plugin at this point in time). This thread/post from the dada2 github might help explain a little bit too.


Thank you for your answers @thermokarst and @benjjneb.

Could you give me some advice on the following error I have had while setting trunc length to 0.

Traceback (most recent call last):
File “/home/qiime2/miniconda/envs/qiime2-2017.6/lib/python3.5/site-packages/q2cli/”, line 222, in call
results = action(**arguments)
File “”, line 2, in denoise_paired
File “/home/qiime2/miniconda/envs/qiime2-2017.6/lib/python3.5/site-packages/qiime2/sdk/”, line 203, in callable_wrapper
output_types, provenance)
File “/home/qiime2/miniconda/envs/qiime2-2017.6/lib/python3.5/site-packages/qiime2/sdk/”, line 305, in callable_executor
output_views = callable(**view_args)
File “/home/qiime2/miniconda/envs/qiime2-2017.6/lib/python3.5/site-packages/q2_dada2/”, line 150, in denoise_paired
" (%r)" % (trim_left_f, trunc_len_f))
ValueError: trim_left_f (0) must be smaller than trunc_len_f (0)

Plugin error from dada2:

trim_left_f (0) must be smaller than trunc_len_f (0)

See above for debug info.

Where I have seen this error, I have been passing trunc_len_f and trunc_len_r as 0, but leaving the trim_left_f as default (0).


We have a bug in the condition checking that is preventing trunc_len from being set to 0 and giving this error:

Should be fixed in the next release, for now the workaround is to just set your truncation lengths to the length of your reads.

1 Like

QIIME 2 2017.7 is now live and includes the bug fix @benjjneb mentioned above :tada:


Thanks for the updates @jairideout and @benjjneb.

Will min-length control be coming to the qiime2 plugin?

There is a default minimum-length of 20 enforced, but no way to change that via the plugin right now.

Do we need to expose that option?

Created a corresponding issue about minimum length filtering on the q2-dada2 issue tracker.

1 Like

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