# trim.seqs, trouble locating primers and barcodes

**URL:** <https://forum.mothur.org/t/trim-seqs-trouble-locating-primers-and-barcodes/1374>\
**Category:** Commands in mothur\
**Created:** [June 4, 2013, 1:39pm UTC](https://forum.mothur.org/t/trim-seqs-trouble-locating-primers-and-barcodes/1374 "2013-06-04T13:39:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrintaka](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jrintaka](https://forum.mothur.org/u/jrintaka)\
**Post date:** [June 4, 2013, 1:39pm UTC](https://forum.mothur.org/t/trim-seqs-trouble-locating-primers-and-barcodes/1374/1 "2013-06-04T13:39:41Z")

</div>

I’m having trouble in getting Mothur to locate my primer(s) and barcodes when using trim.seqs. Thus only 8 of my \>20000 sequences went into trim.fasta and the rest went into scrap. The reason for scrapping most sequences seems to be unlocated primer and barcode.

I was using command: trim.seqs(fasta=H88XYFD01.fasta, oligos=arch.oligos, qfile=H88XYFD01.qual, maxambig=0, maxhomop=10, minlength=50)

My .oligos file looks like this:

forward GYGCASCAGKCGMGAAW  
#reverse GCBGGTDTTACCGCGGCGGCTGRCA  
barcode AGCGCGCGC Tit-B-Arch349F\_101\_SB4  
barcode AGCTCTATC Tit-B-Arch349F\_102\_CC2  
barcode ATAGACATC Tit-B-Arch349F\_103\_MM3

And here is an example of a sequence that went into the .trim.fasta file:

> H88XYFD01D45JJ xy=1581\_3261  
> AGCGCGCGCGCGCACCAGTCGAGAAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATATAGGGCTCTTTCGGGTCTTATAATTGGAATGAGTACAATTCAAATCTCTTAACGAGGAACGATTGGAGGGCAAGTCTGGTGCCAGCCGCCGCGGTAACACCCGATGGCGCGAGGGAGGCGATA

And here are 2 examples of sequences that went into the scrap file because barcode and primer were not located (although I was able to locate them manually).

> H88XYFD01CLSNL|br  
> TAGCTCTATCGTGCAGCAGTCGCGAATCTGCCGTTACTGCCTCTGATGCCAGCCGCCGCGGTAACACCTGATGGCGCGAGGGAGGCGATA

> H88XYFD01BA06O|br  
> TAGCTCTATCGTGCACCAGGCGCGAATCACCAGCCTGTCAGCCGCCGCGGTAACACCAGATGGCGCGAGGGAGGCGATA

How should I modify my command so that the primer and bar code can be located. Allow mismatches?

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [June 4, 2013, 6:19pm UTC](https://forum.mothur.org/t/trim-seqs-trouble-locating-primers-and-barcodes/1374/2 "2013-06-04T18:19:45Z")

</div>

trim.seqs expects the sequence to start with your barcode and then your primer. So, the initial T is throwing things off. Double check that you have the correct barcode sequences - I suspect that you really want those barcodes to start with a T. In general we allow 1 mismatch to the barcode and 2 to the primer.

Pat

---

<div class="post-metadata">

**Author:** ![jrintaka](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jrintaka](https://forum.mothur.org/u/jrintaka)\
**Post date:** [June 5, 2013, 5:25am UTC](https://forum.mothur.org/t/trim-seqs-trouble-locating-primers-and-barcodes/1374/3 "2013-06-05T05:25:24Z")

</div>

Thanks, Pat!

Johanna
