All sequences lost after trim.seqs


I am new to Mothur and currently following a protocol from another lab for analyzing Illumina MiSeq data. I got the data de-multiplexed and the barcodes have been removed, but I still need to remove the primers. Before doing so, I used the make.contigs command, which works fine. Then I want to use the trim.seqs command for removing the primer sequences.

My primer.oligos file looks like this:


When I use “less myfiles.trim.contigs.fasta” I can see the primer sequences in the data (exactly in the beginning and at the end of the sequence), but when executing the command

trim.seqs(fasta=myfiles.trim.contigs.fasta, oligos=primer.oligos)

all my sequences are put to the scrap file because the reverse primer is not found (they all have the “r”-tag). I already tried to add “pdiffs=2” to the command, but nothing changes.
When I use only the forward primer in the oligo file, it works. When I use only the reverse sequence it doesn’t.

I am sorry, if I missed another thread where this is discussed already.

Thank you so much for any idea how to solve this.
Kind regards,


So here it says that paired primers in your oligos file should be formatted in a specific way:

primers ForwardSeq ReverseSeq

So changing that format may help?


Thanks for your reply. I also saw a post that used the one-line format for the paired primers and changed the oligo file accordingly, but then not even the forward primer is recognized and I still have all sequences sorted to the scrap-file.
Also I am curious, why the Mothur Wiki ( says to format the oligo file with the primers individually…?

May this be a problem with the degenerate primers?

So in that example the reverse primer is commented out because otherwise it would be causing the deletion of sequences that don’t contain that primer, and those particular sequences are not expected to contain the reverse primer as they are not long enough:

Here we are using a “#” for the reverse primer to indicate that we don’t want mothur to screen for the reverse primer because the GSFLX sequencing platform cannot generate sequences that are >250 bp long. If the “#” were removed, all of the sequences would wind up in the scrap file.

What version of mothur are you running by the way? The latest is 1.39.3, and it is possible that if you’re running an older version updating will fix your problem…


In the example from the trim.seqs-wiki page, they also say

Each line of the oligos file can start with the key words “forward”, “reverse”, and “barcode” or it can start with a “#” to tell mothur to ignore that line of the oligos file.

Anyways, I will try again with the modified oligo-file as you proposed.

I downloaded mothur today, so I’m pretty sure to have the latest version. I can check tomorrow (here it’s 6.15 p.m., so I’m not at my work computer anymore).

Thank you for the suggestions,

Good morning,

I do have mothur v.1.39.3.

I just tried to use the oligo file like this


The result is still all files in the scrap file. The beginning of the scrap file looks like this:

>M02319_112_000000000-AWRCW_1_1101_13019_2076|f fpdiffs=1000(noMatch), rpdiffs=1000(noMatch)            
>M02319_112_000000000-AWRCW_1_1101_15006_2121|f fpdiffs=1000(noMatch), rpdiffs=1000(noMatch)            

(I removed part of the sequence, as this takes too much space.)
You can see the the primer sequences in the beginning and end of the sequence.

If I use the oligo file with the forward and reverse primer each at a single line, the result is basically the same, but after the sequence name it says |r instead of |f like above.

What am I missing?

I found a work-aroung to this: First, I only remove the forward primer, then I reverse complement the sequences using reverse.seqs, then I remove the reverse primer, which also was reverse complemented and tagged as forward in the oligos-file. This works well, even though its a little cumbersome.

If someone has an idea, what was wrong with my initial attempt, I would be happy to read about it.

The trim.seqs command assumes the reverse primer needs to be reoriented and compares the reverse compliment of the primer to the sequence. To use trim.seqs your oligos file should look like:

Oligos File:

mothur > trim.seqs(fasta=yourFasta, oligos=yourOligosFile, …optional parameters, pdiffs=2)

I would recommend removing the primers in the make.contigs step. The make.contigs command does not reorient the primers, and removes the need to run trim.seqs.

Oligos File:

mothur > make.contigs(…other parameters, oligos=yourOligosFile, pdiffs=2)

Thanks for clarification.
I just tried to use the make.contigs command to also remove the primers. This works fine if I use the reverse complement sequence of my reverse primer in the oligos file.
Thank you so much!