# Difference in sequence length: is it a problem?

**URL:** <https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001>\
**Category:** User Support\
**Created:** [May 6, 2022, 9:34pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001 "2022-05-06T21:34:06Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 6, 2022, 9:34pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/1 "2022-05-06T21:34:06Z")

</div>

Hello guys, hope I am at the right category.  
I am new to metagenomic analysis (and qiime) and I am trying to understand the whole quality scores/trimming/truncating/filtering procedures.

This is a print of my interactive quality plots:

 ![fr interactive plots](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/e/e33924dacc0387569cac775edd3d3552be59e55b.png)

There is a 100 nts difference between forward and reverse reads. Is it a problem? Should I trim those extra 100 nts from the forward reads?  
I believe I have good quality scores, except for the last position of the forward reads, so should I only trim that last one?

Also, I know I should trim out my primers, but how can I check if there are primers to trim and their length?

I am sorry for the rudimentary questions. I have searched for the answers in the forum and a lot of my questions were answered, but now I got to this point where I am very confused and tangled in all those concepts and procedures.

I would highly appreciate your patience and help.

---

<div class="post-metadata">

**Author:** ![yanxianl](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yanxianl/32/2039_2.png) [@yanxianl](https://forum.qiime2.org/u/yanxianl)\
**Post date:** [May 7, 2022, 7:32pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/2 "2022-05-07T19:32:57Z")

</div>

Hi,

> [@microbiotaphyto](#):
>
> There is a 100 nts difference between forward and reverse reads.

The read quality looks good. It's not common that the reverse reads are much shorter than the forward reads. Do you know what happened during the sequencing? Did the sequencing stop earlier than it should have been?

> [@microbiotaphyto](#):
>
> Is it a problem?

Based on your quality plot, if you trim your primers and truncate the last 10 nt of both reads you should end up with 430-440 nt after merging forward and reverse reads. If the expected amplicon size of your study + 20 nt (the recommended minimum overlapping length) is less than 430-440, you should be fine. If not, you can discard the reverse reads and use the forward reads only at the cost of lower taxonomic resolution.

> [@microbiotaphyto](#):
>
> Should I trim those extra 100 nts from the forward reads?

No. You just need to trim the last few nucleotides, say 10 nt.

> [@microbiotaphyto](#):
>
> Also, I know I should trim out my primers, but how can I check if there are primers to trim and their length?

You can ask your sequencing service provider for the primer sequences. To check if the primer sequence is present in your reads, which I suspect is, you can check this forum post:

> [@Finding Primers In Raw Files and Quality Control](https://forum.qiime2.org/t/finding-primers-in-raw-files-and-quality-control/1621/2):
>
> Hi @Pauline_Trinh, You will need to just check the files to be sure, though asking the sequencing center may be more straightforward (especially if your primers contain degenerate bases). If you have the raw .fastq files (before importing into QIIME2) and your primer does not contain degenerate bases, you could type the following command into your terminal (replacing ACGTACGT with your actual primer sequence): grep 'ACGTACGT' path-to-your-fastq-file.fastq | wc -l That will list the number of…

---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 10, 2022, 1:52pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/3 "2022-05-10T13:52:54Z")

</div>

Hi @yanxianl Thank you for the response!

> [@yanxianl](#):
>
> Do you know what happened during the sequencing? Did the sequencing stop earlier than it should have been?

The sequencing was done by a sequencing company that used to do our analyses, but we no longer work with them. I only have the fastq files they provided us and no information about the sequencing procedure itself.

> [@yanxianl](#):
>
> If the expected amplicon size of your study + 20 nt (the recommended minimum overlapping length) is less than 430-440, you should be fine.

How is the expected amplicon size defined? Sorry, I am just learning about all this now, since I was left with raw data to analyse and there are lots of details coming up that I do not know about.

> [@yanxianl](#):
>
> You can ask your sequencing service provider for the primer sequences.

Is there a way to do this without knowing the primer sequences? Which kinds of problems could my analyses have if the primers were not trimmed?

---

<div class="post-metadata">

**Author:** ![yanxianl](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yanxianl/32/2039_2.png) [@yanxianl](https://forum.qiime2.org/u/yanxianl)\
**Post date:** [May 10, 2022, 3:20pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/4 "2022-05-10T15:20:29Z")

</div>

> [@microbiotaphyto](#):
>
> How is the expected amplicon size defined?

The amplicon size depends on the primer set used in the studies. The expected amplicon size can be calculated by running a digital PCR ([see this forum post](https://forum.qiime2.org/t/can-we-use-extracted-reference-reads-to-calculate-expected-amplicon-sizes/11038)). For example, if you're using V4 primers the expected amplicon size should be ~252 nt; if using V3-4, the amplicon size could be ~450 nt.

> [@microbiotaphyto](#):
>
> Is there a way to do this without knowing the primer sequences?

The easiest way would be asking the sequencing company for it. They shall have good answers. Alternatively, you can grab all the commonly used universal primers for the 16S rRNA gene and blast them against your raw fastq files following the method I linked in the previous post.

> [@microbiotaphyto](#):
>
> Which kinds of problems could my analyses have if the primers were not trimmed?

The DADA2 won't work properly if primers are not removed from your reads, e.g., losing the majority of reads during the chimera removal. See [the DADA2 tutorial](https://benjjneb.github.io/dada2/tutorial.html) for more details.

---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 11, 2022, 7:21pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/5 "2022-05-11T19:21:46Z")

</div>

> [@yanxianl](#):
>
> You can ask your sequencing service provider for the primer sequences. To check if the primer sequence is present in your reads, which I suspect is, you can check this forum post:

I found the primer sequences and ran the command from the post you suggested. This is what I got:

(qiime2-2022.2) isissilveira@DESKTOP-T8NNAQK:~/bovine-reads$ grep 'CCTACGGGRSGCAGCAG' 210511155290-1-2-1\_S366\_L001\_R1\_001.fastq.gz | wc -l  
0

Does this "0" mean the primer is no longer in the sequence? Could it be a problem due to the file being zip?

---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 11, 2022, 8:03pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/6 "2022-05-11T20:03:01Z")

</div>

> [@yanxianl](#):
>
> You just need to trim the last few nucleotides, say 10 nt.

So I should use --p-trim-left-f and --p-trim-left-r for this, right? The tutorial [“Atacama soil microbiome” tutorial — QIIME 2 2022.2.0 documentation](https://docs.qiime2.org/2022.2/tutorials/atacama-soils/) says they are not going to trim the ends of the sequences and uses --p-trunc-len- 150 (which is the full length of the reads). But I have seen on the forum researchers who were not truncating either using --p-trunc-len- 0. Should the integer refer to the number of nts being trimmed, like this:

--p-trim-left-f 10  
--p-trim-left-r 10

or should it refer to the position where the cut is supposed to be made:

--p-trim-left-f 295  
--p-trim-left-r 195

---

<div class="post-metadata">

**Author:** ![yanxianl](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yanxianl/32/2039_2.png) [@yanxianl](https://forum.qiime2.org/u/yanxianl)\
**Post date:** [May 11, 2022, 9:33pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/7 "2022-05-11T21:33:50Z")

</div>

> [@microbiotaphyto](#):
>
> Does this "0" mean the primer is no longer in the sequence? Could it be a problem due to the file being zip?

You need to unzip the fastq file. If the primer sequence, 'CCTACGGGRSGCAGCAG', is for the forward reads, you can try running:

> gunzip 210511155290-1-2-1\_S366\_L001\_R1\_001.fastq.gz  
> head -n 20 210511155290-1-2-1\_S366\_L001\_R1\_001.fastq | grep -x '[CCTACGGGRSGCAGCAG]+'

If the primer has not been trimmed from your raw data, you shall see sequence printed on the terminal.

> [@microbiotaphyto](#):
>
> So I should use --p-trim-left-f and --p-trim-left-r for this, right?

No. You should use --p-trunc-len-f/--p-trunc-len-r to trim sequences at the tail, or the 3' end. For example, the following code trims your forward reads at position 295 and reverse reads at position 195:

> --p-trunc-len-f 295  
> --p-trunc-len-r 195

You can use the read length here if you don't want to trim the 3' end sequence.

Use --p-trim-left-f/--p-trim-left-r when you want to trim your primer sequence at the head, or the 5' end. For example, the following code trims the first 17 and 21 nt of your forward and reverse reads respectively:

> --p-trim-len-f 17  
> --p-trim-len-r 21

---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 12, 2022, 12:54pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/8 "2022-05-12T12:54:42Z")

</div>

> [@yanxianl](#):
>
> You need to unzip the fastq file

Do I need to unzip the fastq files to create the qiime artifacts as well and to do all the analyses? Or just to look for the primers?

---

<div class="post-metadata">

**Author:** ![yanxianl](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yanxianl/32/2039_2.png) [@yanxianl](https://forum.qiime2.org/u/yanxianl)\
**Post date:** [May 12, 2022, 1:19pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/9 "2022-05-12T13:19:57Z")

</div>

No. You can run your analysis using zipped fastq files. This is just for checking the primers.

---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 12, 2022, 6:16pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/10 "2022-05-12T18:16:02Z")

</div>

> [@yanxianl](#):
>
> gunzip 210511155290-1-2-1\_S366\_L001\_R1\_001.fastq.gz  
> head -n 20 210511155290-1-2-1\_S366\_L001\_R1\_001.fastq | grep -x '[CCTACGGGRSGCAGCAG]+'

```auto
(qiime2-2022.2) isissilveira@DESKTOP-T8NNAQK:~/bovine-reads$ gunzip 210511155292-1-2-1_S160_L001_R1_001.fastq.gz head -n
 20 210511155292-1-2-1_S160_L001_R1_001.fastq | grep -x '[CCTACGGGRSGCAGCAG]+'
gzip: head.gz: No such file or directory
gzip: 20.gz: No such file or directory
gzip: 210511155292-1-2-1_S160_L001_R1_001.fastq: unknown suffix -- ignored

```

I tried typing the code with \ and in different lines, but it didn't work either. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 12, 2022, 6:24pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/11 "2022-05-12T18:24:24Z")

</div>

> [@yanxianl](#):
>
> You need to unzip the fastq file

I also tried to unzip the file manually and then run the code:

```auto
(qiime2-2022.2) isissilveira@DESKTOP-T8NNAQK:~/bovine-reads$ grep 'CCTACGGGRSGCAGCAG' 210511155290-1-2-1_S366_L001_R1_001.fastq | wc -l
0

```

And I got the same "0"

---

<div class="post-metadata">

**Author:** ![Keegan-Evans](https://forum.qiime2.org/user_avatar/forum.qiime2.org/keegan-evans/32/10422_2.png) [@Keegan-Evans](https://forum.qiime2.org/u/Keegan-Evans)\
**Post date:** [May 12, 2022, 8:57pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/12 "2022-05-12T20:57:23Z")

</div>

> [@yanxianl](#):
>
> You can ask your sequencing service provider for the primer sequences. To check if the primer sequence is present in your reads, which I suspect is, you can check this forum post:

If at all possible I think this is the thing to do. They may have already been removed and you just don't know it yet, which saves you some work if it is the case 🙂. They may also have documentation available on their website. Even if you do not use them currently it is worth trying to contact them because without you having additional documentation, they are the only ones who will know exactly what was done to your data.

Have you asked around your lab? It is possible someone has this information recorded in their lab notebook, this is a bit of long shot but worth trying.

While this may seem like a giant pain, it is worth doing, _especially_ if you are going to use q2-dada2 to denoise your data as _it will not work_ if you do not remove all of the non-biological material from your sequences 😥 Manually looking for standard primers is a good backup plan, but is a pain and definitely not as reliable as just finding out from the sequencing center the exact details of what is and is not included in your data.

---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 13, 2022, 2:18pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/13 "2022-05-13T14:18:53Z")

</div>

Hello @Keegan-Evans , thank you for your help!

I have just found documents the company sent along with the fastqs in which they detail Sentinel Methods they used. It says they used Sentinel pipeline to assess Phred quality scores of the fastq files and then they trimmed the primers and low quality sequences (Phred \< 20). Clusters with abundance \< 2 were removed from the analyses due to this parameter being related to chimera sequences.

I am not familiar with the procedure, should I consider they sent me the fastq files after trimming or is it possible they sent me the original fastqs with the primers in it, even if they sent this method documentation? Is it costumary to just explain the method used for the analyses but sent the fastqs without trimming?

Considering the good quality of the reads, I am inclined to believe they sent me the fastqs after trimming.

---

<div class="post-metadata">

**Author:** ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)\
**Post date:** [May 13, 2022, 5:20pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/14 "2022-05-13T17:20:48Z")

</div>



---

<div class="post-metadata">

**Author:** ![Keegan-Evans](https://forum.qiime2.org/user_avatar/forum.qiime2.org/keegan-evans/32/10422_2.png) [@Keegan-Evans](https://forum.qiime2.org/u/Keegan-Evans)\
**Post date:** [May 13, 2022, 7:49pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/15 "2022-05-13T19:49:40Z")

</div>

@microbiotaphyto, it sounds like they are already removed! If 95% of your sequences get removed during denoising due to chimera detection, we may want to revisit the subject but I think you are good to move forward at this point 😀

Here are a few videos from a recent workshop that discuss denoising and appropriate trimming and truncation: [Lecture](https://www.youtube.com/watch?v=PmtqSa4Z1TQ&t=797s) and [Tutorial](https://www.youtube.com/watch?v=181bMy9YB9I&t=229s).

---

<div class="post-metadata">

**Author:** ![Keegan-Evans](https://forum.qiime2.org/user_avatar/forum.qiime2.org/keegan-evans/32/10422_2.png) [@Keegan-Evans](https://forum.qiime2.org/u/Keegan-Evans)\
**Post date:** [May 13, 2022, 7:49pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/16 "2022-05-13T19:49:43Z")

</div>



---

<div class="post-metadata">

**Author:** ![microbiotaphyto](https://forum.qiime2.org/user_avatar/forum.qiime2.org/microbiotaphyto/32/13197_2.png) [@microbiotaphyto](https://forum.qiime2.org/u/microbiotaphyto)\
**Post date:** [May 16, 2022, 12:52pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/17 "2022-05-16T12:52:40Z")

</div>

Hello

I got in touch with the sequencing company and they told me they sent me the raw files, no trimming or truncation done.

I will check out the links you have suggested. Thank you very much!

---

<div class="post-metadata">

**Author:** ![Keegan-Evans](https://forum.qiime2.org/user_avatar/forum.qiime2.org/keegan-evans/32/10422_2.png) [@Keegan-Evans](https://forum.qiime2.org/u/Keegan-Evans)\
**Post date:** [May 16, 2022, 4:22pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/18 "2022-05-16T16:22:37Z")

</div>

@microbiotaphyto,

I am glad they responded to you! It is really hard to know what exactly has been done to your data without the sequencing center telling you. Why more centers do not include this information _with_ the data is very confusing to me but it seems to be the case 😥

---

<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:** [June 16, 2022, 10:22pm UTC](https://forum.qiime2.org/t/difference-in-sequence-length-is-it-a-problem/23001/19 "2022-06-16T22:22:47Z")

</div>

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