# qiime feature-classifier p-trunc-len option

**URL:** <https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861>\
**Category:** User Support\
**Created:** [July 28, 2019, 10:22am UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861 "2019-07-28T10:22:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogesh\_Gupta](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yogesh_gupta/32/9097_2.png) [@Yogesh\_Gupta](https://forum.qiime2.org/u/Yogesh_Gupta)\
**Post date:** [July 28, 2019, 10:22am UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861/1 "2019-07-28T10:22:24Z")

</div>

We have 250bp pair end reads that were amplified with the 515F/806R primer pair for 16S rRNA gene sequences, but while running dada2 I truncated forward read to 204bp and reverse to 174bp, now what truncated length should I use for qiime2 feature classifier?

qiime feature-classifier extract-reads   
--i-sequences 99\_otus.qza   
--p-f-primer GTGCCAGCMGCCGCGGTAA   
--p-r-primer GGACTACHVGGGTWTCTAAT   
--p-trunc-len ---???   
--p-min-length 100   
--p-max-length 400   
--o-reads ref-seqs.qza

thanks

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 28, 2019, 12:08pm UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861/2 "2019-07-28T12:08:03Z")

</div>

Hi @Yogesh_Gupta,  
Please read the documentation (including the "notes") for more details:  
[https://docs.qiime2.org/2019.4/tutorials/feature-classifier/#extract-reference-reads](https://docs.qiime2.org/2019.4/tutorials/feature-classifier/#extract-reference-reads)

---

<div class="post-metadata">

**Author:** ![Yogesh\_Gupta](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yogesh_gupta/32/9097_2.png) [@Yogesh\_Gupta](https://forum.qiime2.org/u/Yogesh_Gupta)\
**Post date:** [July 28, 2019, 2:05pm UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861/3 "2019-07-28T14:05:54Z")

</div>

It says The `min-length` parameter is applied _after_ the `trim-left` and `trunc-len` parameters, and `max-length` _before_, so be sure to set appropriate settings to prevent valid sequences from being filtered out.  
min-length and max-length, I can take from rep.seq.qzv but how to decide about trunc-len?

.  
Thanks  
Yogesh

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 28, 2019, 3:50pm UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861/4 "2019-07-28T15:50:43Z")

</div>

you missed the first note:

> The `--p-trunc-len` parameter should only be used to trim reference sequences if query sequences are trimmed to this same length or shorter. **Paired-end sequences that successfully join will typically be variable in length.** Single-end reads that are not truncated at a specific length may also be variable in length. **For classification of paired-end reads and untrimmed single-end reads, we recommend training a classifier on sequences that have been extracted at the appropriate primer sites, but are not trimmed.**

---

<div class="post-metadata">

**Author:** ![Yogesh\_Gupta](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yogesh_gupta/32/9097_2.png) [@Yogesh\_Gupta](https://forum.qiime2.org/u/Yogesh_Gupta)\
**Post date:** [July 29, 2019, 8:07am UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861/5 "2019-07-29T08:07:18Z")

</div>

Hi @Nicholas_Bokulich,

As I can understand it seems like I don't need to use --p-trunc-len, as pair end read sequences length may vary after dada2 step.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 29, 2019, 10:46am UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861/6 "2019-07-29T10:46:15Z")

</div>

> [@Yogesh\_Gupta](#):
>
> As I can understand it seems like I don’t need to use --p-trunc-len, as pair end read sequences length may vary after dada2 step.

Yes, exactly. So even if you used `trunc-len` when using dada2 for trimming the unmerged reads, with `extract-reads` you should not use `trunc-len` since the reads are now merged and variable length.

---

<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:** [August 29, 2019, 4:46pm UTC](https://forum.qiime2.org/t/qiime-feature-classifier-p-trunc-len-option/10861/7 "2019-08-29T16:46:16Z")

</div>

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