Bowtie: How do I map files to reference genome?
1
0
Entering edit mode
2.6 years ago

I want to map out1.fq and out2.fq to the reference genome NC_008253.fa.fai based on the following conditions:

  • seed length=24
  • hits written in sam file format
  • maximum insert size=600
  • mates are in the forward/reverse orientation
  • input files are fastq format
  • output the wall-clock time
  • seed sequence mismatches=3
  • output the mapped and unmapped reads in separate files
bowtie -q out1.fq out2.fq NC_008253.fa.fai -x 1.bt2 -l/--seedlen 24 -S/--sam -X/--maxins
600 -t/--time -v 3 > mapped

Traceback:

-l/--seedlen arg must be at least 5
bowtie • 2.7k views
ADD COMMENT
0
Entering edit mode

Hi, should you even be using bowtie anymore? Possibly try Hisat2 instead.

ADD REPLY
0
Entering edit mode
2.6 years ago

By convention, arguments are named either in short format (as -l) or long format (--seedlen). So this would be more likely to work:

bowtie -q out1.fq out2.fq NC_008253.fa.fai -x 1.bt2 -l 24 -S -X 600 -t -v 3 > mapped.sam

But I think there is another issue with your script. -x should refer to your bowtie index (created using bowtie-build on your reference genome) and usually excludes the 1.bt2 characters. So first properly index your reference fasta file:

bowtie-build -f NC_008253.fa NC_008253

Edit: A third issue is that the -1 and -2 mandatory arguments are missing. This fixes it:

bowtie -q out1.fq out2.fq -x NC_008253 -l 24 -S -X 600 -t -v 3 > mapped.sam
ADD COMMENT
0
Entering edit mode

What's the difference between the index built with samtools and that built with bowtie-build?

I tried:

bowtie-build -f NC_008253.fa NC_008253.rev.2.ebwt

bowtie -q out1.fq out2.fq NC_008253.fa -x 1.bt2 -l 24 -S -X 600 -t -v 3 > mapped.sam

Traceback:

Could not locate a Bowtie index corresponding to basename "out1.fq"
ADD REPLY
0
Entering edit mode

they are very different kind of indexes with different purposes. bowtie-build creates a FM-index, based on a burrow-wheeler transformation of the reference which allows efficient read alignment. For samtools faidx, I don't know the specifics of the algorithm, but the index simply allows efficient random access (you can read the sequence at a particular position of the genome without starting from the start of the file).

ADD REPLY
0
Entering edit mode
bowtie-build -f NC_008253.fa NC_008253
bowtie -q out1.fq out2.fq -x NC_008253 -l 24 -S -X 600 -t -v 3 > mapped.sam

Traceback:

Could not locate a Bowtie index corresponding to basename "out1.fq"
ADD REPLY
0
Entering edit mode

you forgot the -1 and -2 mandatory arguments: http://bowtie-bio.sourceforge.net/manual.shtml#the-bowtie-aligner

bowtie -q -1 out1.fq -2 out2.fq -x NC_008253 -l 24 -S -X 600 -t -v 3 > mapped.sam
ADD REPLY
0
Entering edit mode

It raises another error:

No index, query, or output file specified!
ADD REPLY
0
Entering edit mode

Weird. Perhaps try in this order:

bowtie -x NC_008253 -1 out1.fq -2 out2.fq  -l 24 -X 600 -t -v 3 -S mapped.sam
ADD REPLY
0
Entering edit mode

Traceback:

Could not locate a Bowtie index corresponding to basename "mapped.sam"
ADD REPLY
0
Entering edit mode

What is your bowtie version ? It looks like the command does not recognize -x NC_008253 as the index.

bowtie --version
ADD REPLY
0
Entering edit mode

/usr/bin/bowtie-align-s version 1.2.3

ADD REPLY
0
Entering edit mode

I tried to install Bowtie2.

bowtie2 --version
/usr/bin/bowtie2-align-s version 2.3.5.1
64-bit


bowtie2-build -f NC_008253.fa NC_008253
bowtie2 -x NC_008253 -1 out1.fq -2 out2.fq -l 24 -X 600 -t -v 3 -S mapped.sam

Traceback:

Error: Encountered internal Bowtie 2 exception (#1)
Command: /usr/bin/bowtie2-align-s --wrapper basic-0 -x NC_008253 -l 24 -X 600 -t -v 3 -S mapped.sam -1 out1.fq -2 out2.fq
(ERR): bowtie2-align exited with value 1
ADD REPLY
0
Entering edit mode

bowtie (end-to-end alignments) and bowtie2 (gapped alignments) are different programs and require different arguments, you can not just use them interchangeably. That being said, can you try to update to the latest bowtie version (1.3.1) and see whether the issue persists ?

ADD REPLY
0
Entering edit mode

I managed to download Bowtie v 1.3.1. However, it produces another error

bowtie -x NC_008253 -1 out1.fq -2 out2.fq -l 24 -X 600 -t -v 3 -S mapped.sam

Traceback:

Saw ASCII character 10 but expected 33-based Phred qual.
ADD REPLY
0
Entering edit mode

Looks like bowtie expected Phred-33 quality score (default), but your data is not. You will need to tell bowtie what kind of quality encoding is used. For instance try to add option --phred64-quals.

ADD REPLY

Login before adding your answer.

Traffic: 2003 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6