This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Use Bowtie to trim reads in fastq files

I usually use Bowtie as an aligner, but I wonder whether I can use Bowtie as a trimmer as well?

I tried the below command line: bowtie <bowtie_index> -1 read1.fastq -2 read2.fastq --trim5 2 --un unaligned --al aligned > aligned.bam

I wanted bowtie to trim the first 2bps at the 5prime end, and output the unaligned the reads to unliagned_1.fastq and unaligned_2.fastq, and I would use unaligned_1.fastq and unaligned_2.fastq for downstream analysis, but seems the reads in unaligned_1.fastq and unaligned_2.fastq are the same with the original ones (first 2bp at 5prime are still there).

Can someone tell whether and how bowtie can be used as a trimmer and output the trimmed reads to a fastq file?

Thanks,

bowite trim

Right tool for the right job. You can't use it as a general purpose trimmer as you have discovered.

1 answer

As Genomax indicated, no, you can't use an aligner as a trimmer. I'd recommend BBDuk for this purpose:

bbduk.sh in1=read1.fastq in2=read2.fastq out1=trimmed1.fastq out2=trimmed2.fastq ftl=2

Log in to answer this question.