# Dada2 trimming question

**URL:** https://forum.qiime2.org/t/dada2-trimming-question/907
**Category:** User Support
**Tags:** dada2
**Created:** [July 28, 2017, 8:55pm UTC](https://forum.qiime2.org/t/dada2-trimming-question/907 "2017-07-28T20:55:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Bing](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@Bing](https://forum.qiime2.org/u/Bing)
#### Post date: [July 28, 2017, 8:55pm UTC](https://forum.qiime2.org/t/dada2-trimming-question/907/1 "2017-07-28T20:55:34Z")

</div>

Hello,  
I have a question about the `dada2` trimming. Basically we got our demultiplexed paired-end data from our genomics core who used the [16S Metagenomic Sequencing Library Preparation](https://support.illumina.com/content/dam/illumina-support/documents/documentation/chemistry_documentation/16s/16s-metagenomic-library-prep-guide-15044223-b.pdf).

We did a presentation in our data and somebody said that primers are still in the sequence data from our core. Do we have to remove primers before running dada2? I checked the raw fastq file for several files. The forward sequences are always starting with `CCTACGGG` and the reverse sequences are always starting with `NACTAC`. I do not see they match with the Primers, am I right?

My last question is that how to set the `trim and trunc parameters` is appropriate in dada2 to trim the primers like I found above?

Thanks,  
Bing

---

<div class="post-metadata">

### Author: ![benjjneb](https://forum.qiime2.org/user_avatar/forum.qiime2.org/benjjneb/32/1602_2.png) [@benjjneb](https://forum.qiime2.org/u/benjjneb)
#### Post date: [July 31, 2017, 8:06pm UTC](https://forum.qiime2.org/t/dada2-trimming-question/907/2 "2017-07-31T20:06:37Z")

</div>

If you compare the start of your sequences to the Illumina adapter/primer sequences, you will see they match in the second-half:

```
                                 CCTACGGG
TCGTCGGCAGCGTCAGATGTGTATAAGAGACAGCCTACGGGNGGCWGCAG

                                  NACTAC
GTCTCGTGGGCTCGGAGATGTGTATAAGAGACAGGACTACHVGGGTATCTAATCC

```

Those are the 341F and 805R primers, and they need to be removed. You can do so here with `trim-left-f 17` and `trim-left-r 21`, which you can read off the above.

This amplicon is longer than the reads, so they won't read into the other primer, hence `trunc-len` is not needed for primer removal.

---

<div class="post-metadata">

### Author: ![Bing](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@Bing](https://forum.qiime2.org/u/Bing)
#### Post date: [July 31, 2017, 8:45pm UTC](https://forum.qiime2.org/t/dada2-trimming-question/907/3 "2017-07-31T20:45:00Z")

</div>

@benjjneb

Thanks for answering the question. so can I run the removal of primers with quality control together or I have to run them seperately? When I run the denoise-paired in quality control, if I use the following commands, is it correct?

`qiime dada2 denoise-paired --i-demultiplexed-seqs demux-paired-end.qza --p-trim-left-f 17 --p-trunc-len-f 250 --p-trim-left-r 21 --p-trunc-len-r 250 --o-table bing-dada2-table.qza --o-representative-sequences bing-data2-rep-seqs.qza --verbose`

Bing

---

<div class="post-metadata">

### Author: ![benjjneb](https://forum.qiime2.org/user_avatar/forum.qiime2.org/benjjneb/32/1602_2.png) [@benjjneb](https://forum.qiime2.org/u/benjjneb)
#### Post date: [August 1, 2017, 1:45am UTC](https://forum.qiime2.org/t/dada2-trimming-question/907/4 "2017-08-01T01:45:58Z")

</div>

That looks good to me. You can revisit the quality filtering parameters depending on if enough reads are making it through.

---

<div class="post-metadata">

### Author: ![Bing](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@Bing](https://forum.qiime2.org/u/Bing)
#### Post date: [August 17, 2017, 8:13pm UTC](https://forum.qiime2.org/t/dada2-trimming-question/907/5 "2017-08-17T20:13:47Z")

</div>

Hi,  
I just read the post about `primer removal in dada2` [https://github.com/qiime2/q2-dada2/issues/32](https://github.com/qiime2/q2-dada2/issues/32) in GitHub. Our data have primers as below:

> [@benjjneb](#):
>
> ```
> CCTACGGG
> 
> ```
> 
> TCGTCGGCAGCGTCAGATGTGTATAAGAGACAGCCTACGGGNGGCWGCAG
> 
> ```
> NACTAC
> 
> ```
> 
> GTCTCGTGGGCTCGGAGATGTGTATAAGAGACAGGACTACHVGGGTATCTAATCC

The question is whether we need to remove the primers before running `data2 denoise` in QIIME 2, or we can ` trim` the primers in the `dada2 denoise` section? If we have to remove the primers before running data2 in QIIME 2, how can do it? Please guide us!

Thanks,  
Bing

---

<div class="post-metadata">

### Author: ![benjjneb](https://forum.qiime2.org/user_avatar/forum.qiime2.org/benjjneb/32/1602_2.png) [@benjjneb](https://forum.qiime2.org/u/benjjneb)
#### Post date: [August 17, 2017, 8:28pm UTC](https://forum.qiime2.org/t/dada2-trimming-question/907/6 "2017-08-17T20:28:51Z")

</div>

You can trim them with the `trim-left` parameters, but you need to know the length the primer sequence that appears on your reads. So you either need to understand your amplicon sequencing set up (some don't sequence primers, others do), or you can inspect your raw reads to determine if primers are on the reads, and how long they are.

Just look at the first few reads and compare them to the primer sequences you are using. Do they match some part? How much? Determine `trim-left-f` and `trim-left-r` from that.

---

<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: [September 18, 2017, 2:29am UTC](https://forum.qiime2.org/t/dada2-trimming-question/907/7 "2017-09-18T02:29:00Z")

</div>

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