# Trim seqs command issues

**URL:** https://forum.mothur.org/t/trim-seqs-command-issues/497
**Category:** Commands in mothur
**Created:** [March 31, 2011, 4:08am UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497 "2011-03-31T04:08:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Binnuch](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@Binnuch](https://forum.mothur.org/u/Binnuch)
#### Post date: [March 31, 2011, 4:08am UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497/1 "2011-03-31T04:08:37Z")

</div>

Hi,

Following the Costello stool analysis example with my own data, I have had trouble with the trim sequences command.

When I type:  
“trim.seqs(fasta=3A.fasta, oligos=trimming.oligos, qfile=3A.qual, maxambig=0, maxhomop=8, pdiffs=2, qwindowaverage=35, qwindowsize=50)”

The output returned is:  
"3A\_ GONO6GH0416XB7 is in your fasta file and not in your quality file, not using your quality file.  
1000  
2000  
3000  
4000  
4052

Output file names:  
trim.fasta  
scrap.fasta  
trim.fasta  
scrap.fasta"

3A\_ GONO6GH0416XB7 is definitely in the sequence quality file…

Any thoughts on how to resolve this issue?

---

<div class="post-metadata">

### Author: ![westcott](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/westcott/32/18_2.png) [@westcott](https://forum.mothur.org/u/westcott)
#### Post date: [April 25, 2011, 12:16pm UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497/2 "2011-04-25T12:16:24Z")

</div>

What version of mothur are you using?

---

<div class="post-metadata">

### Author: ![Binnuch](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@Binnuch](https://forum.mothur.org/u/Binnuch)
#### Post date: [May 1, 2011, 10:11am UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497/3 "2011-05-01T10:11:56Z")

</div>

Version 1.16.0.

---

<div class="post-metadata">

### Author: ![westcott](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/westcott/32/18_2.png) [@westcott](https://forum.mothur.org/u/westcott)
#### Post date: [May 3, 2011, 1:44pm UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497/4 "2011-05-03T13:44:35Z")

</div>

This bug has been fixed in the current version. Here’s the link to download version 1.18.1 [http://www.mothur.org/wiki/Download\_mothur](http://www.mothur.org/wiki/Download_mothur)

---

<div class="post-metadata">

### Author: ![lwoo6888](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@lwoo6888](https://forum.mothur.org/u/lwoo6888)
#### Post date: [September 30, 2011, 7:30am UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497/5 "2011-09-30T07:30:30Z")

</div>

Hello All, and thanks for Mothur!

My issue is similar to this one, I am using version 1.21.1 on our uni server.

I want to use a qual file in my trimming, but there are some problems 1)The fasta files we got from our sequencing service are already barcode-trimmed and binned into groups (group name appended before sequence ID), whereas the qual files do not have the group appended, so we get a sequence not found notice. I can get around this somewhat by manually stripping out the pre-fixed group names and some other mucking about. 2) the qual file has other people’s sequences in it, not just my ones. When I use a small potion of the dataset (6000 seq) with the massive qual file, it works fine, but when I use all (50000) I get something like this:

100  
200  
.etc  
.etc  
.etc  
18000 \<—Works fine to a point  
sequence name mismatch btwn fasta: GO2I7MQ02ISDP1 and qual file: GO2I7MQ02IOSSK \<----Starts doing this  
sequence name mismatch btwn fasta: GO2I7MQ02JQS7W and qual file: GO2I7MQ02GKLFO  
sequence name mismatch btwn fasta: GO2I7MQ02HE6J1 and qual file: GO2I7MQ02HQZWM  
.etc  
.etc  
.etc  
sequence name mismatch btwn fasta: GO2I7MQ02GVTJD and qual file: GO2I7MQ02GN6AI  
sequence name mismatch btwn fasta: GO2I7MQ02JMRNX and qual file: GO2I7MQ02FYK15  
50436 \<----eventually finishes ok.

Does anyone have any insight?

Kind regards,

Laura.

---

<div class="post-metadata">

### Author: ![westcott](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/westcott/32/18_2.png) [@westcott](https://forum.mothur.org/u/westcott)
#### Post date: [October 3, 2011, 7:48pm UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497/6 "2011-10-03T19:48:57Z")

</div>

The trim.seqs command expects the fasta file and the qual file to have the same sequences in the same order. You could use the list.seqs command on the fasta file to get a list of sequences. Then use get.seqs to extract those sequences from the quality file. The commands would look like:

list.seqs(fasta=yourFastaFIle)  
get.seqs(qfile=yourQualFile, accnos=current)

But your quality file may still be in a different order as the fasta file.

---

<div class="post-metadata">

### Author: ![lwoo6888](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@lwoo6888](https://forum.mothur.org/u/lwoo6888)
#### Post date: [October 4, 2011, 8:15am UTC](https://forum.mothur.org/t/trim-seqs-command-issues/497/7 "2011-10-04T08:15:41Z")

</div>

Thank you! I overlooked this easy way to make a suitable qual file. Trim.seqs works perfectly now.
