# How does DADA2 handle the sequence with different truncation lengths?

**URL:** https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930
**Category:** User Support
**Tags:** dada2
**Created:** [October 7, 2020, 1:44am UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930 "2020-10-07T01:44:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Claire010](https://forum.qiime2.org/user_avatar/forum.qiime2.org/claire010/32/6217_2.png) [@Claire010](https://forum.qiime2.org/u/Claire010)
#### Post date: [October 7, 2020, 1:44am UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930/1 "2020-10-07T01:44:27Z")

</div>

Just for discussion, what if one read was truncated at 5'-end by one nucleotide due to the Qscore=2 criteria, but the rest of this read is exactly the same with another full-length read. DADA2 will still recognize them as different ASVs, right? If yes, wouldn't it be a bit weird?

---

<div class="post-metadata">

### Author: ![ChrisKeefe](https://forum.qiime2.org/user_avatar/forum.qiime2.org/chriskeefe/32/1907_2.png) [@ChrisKeefe](https://forum.qiime2.org/u/ChrisKeefe)
#### Post date: [October 7, 2020, 3:12pm UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930/2 "2020-10-07T15:12:55Z")

</div>



---

<div class="post-metadata">

### Author: ![ChrisKeefe](https://forum.qiime2.org/user_avatar/forum.qiime2.org/chriskeefe/32/1907_2.png) [@ChrisKeefe](https://forum.qiime2.org/u/ChrisKeefe)
#### Post date: [October 7, 2020, 3:21pm UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930/3 "2020-10-07T15:21:46Z")

</div>

Good question, @Claire010!  
DADA2 attempts to _correct_ sequencing errors, by developing an error model from your data, and then correcting likely bad nucleotides. Because of this, your truncated read is very likely to be corrected so that it is grouped with a more-prominent sequence (like the slightly longer sequence you described).

For more details, check out the [DADA2 preprint](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4927377/), or click through to Nature Methods for the final publication if you have access.

Chris 🦌

---

<div class="post-metadata">

### Author: ![ChrisKeefe](https://forum.qiime2.org/user_avatar/forum.qiime2.org/chriskeefe/32/1907_2.png) [@ChrisKeefe](https://forum.qiime2.org/u/ChrisKeefe)
#### Post date: [October 7, 2020, 3:21pm UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930/4 "2020-10-07T15:21:53Z")

</div>



---

<div class="post-metadata">

### Author: ![Claire010](https://forum.qiime2.org/user_avatar/forum.qiime2.org/claire010/32/6217_2.png) [@Claire010](https://forum.qiime2.org/u/Claire010)
#### Post date: [October 7, 2020, 3:38pm UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930/5 "2020-10-07T15:38:34Z")

</div>

Hi Chris @ChrisKeefe ,

Thanks a lot for your prompt reply. DADA2 indeed has an algorithm to establish a model to correct nucleotide with low quality. However, this error correction happens after the truncation. Do you mean DADA2 can save back the truncated nucleotide? Then isn't nonsense to truncate the read at the position with Qscore=2 in DADA2?  
Anyway, I will go through the paper again to see whether it covers this point.

---

<div class="post-metadata">

### Author: ![ChrisKeefe](https://forum.qiime2.org/user_avatar/forum.qiime2.org/chriskeefe/32/1907_2.png) [@ChrisKeefe](https://forum.qiime2.org/u/ChrisKeefe)
#### Post date: [October 7, 2020, 9:25pm UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930/6 "2020-10-07T21:25:43Z")

</div>

@Claire010, I think you're right to go to the paper and/or DADA2 docs to find more concrete answers, as I haven't spent much time with how exactly DADA2 performs error correction. The Sequence Comparison, Abundance P-value, and Divisive Partitioning Algorithm sections are likely the most useful to you for this.

When we truncate the read at position(Q=2), we do so because we don't trust that read. DADA2 doesn't "save back" the truncated nucleotide, and isn't deciding that we _do_ trust the read. DADA2 is happy to let the untrustworthy data go. It uses its error model to choose likely "true sequences", and replaces likely-erroneous sequences with the likely "true sequence" they most closely resemble.

Incidentally, I think DADA2 author @benjjneb generally recommends using the "base-wise" trim and trunc parameters, rather than trimming by q-score, as [this allows DADA2 to rely on `max-ee`](https://forum.qiime2.org/t/why-do-the-dada2-default-setting-have-such-a-low-phred-score/10156/8) instead of raw q-scores.

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [November 8, 2020, 3:25am UTC](https://forum.qiime2.org/t/how-does-dada2-handle-the-sequence-with-different-truncation-lengths/16930/7 "2020-11-08T03:25:45Z")

</div>

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