Bowtie and bowtie2 are ultra-fast and memory-efficient tools for aligning sequencing reads to long reference sequences. Bowtie indexes the genome with a Burrows-Wheeler index and Bowtie 2 indexes the genome with a related FM Index. Both bowtie and bowtie2 can output alignments in SAM format, enabling their incorporation with a large number of tools.
For more detailed information refer to manuals:
Both bowtie and bowtie2 are currently available on the coeus cluster:
> module avail 2>&1 | grep bowtie
Biosciences/bowtie/1.2.2/gcc
Biosciences/bowtie/2.3.4/gcc
Detailed information on the differences between bowtie and bowtie2 can be found in the bowtie2 manual.
Bowtie2 is optimized for longer reads than bowtie, if your reads are over 50bp in length you will likely want to use bowtie2. In addition bowtie does not support gapped alignment whereas bowtie2 does. It is important to note that bowtie and bowtie2 scripts will not be cross compatible as the flags are different
This job is based on e-coli examples from the bowtie manual First create script sub_bowtie_ex1.sh:
#!/bin/bash
#SBATCH --job-name bowtie_example
#SBATCH --partition medium
#SBATCH --output=bowtie_align_ex_%j
module purge
module load Biosciences/bowtie/1.2.2/gcc
srun bowtie -a -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
Bowtie flags used:
The -a flag specifies all valid alignments per read or pair will be reported
The -v flag specifies maximum number of mismatches per alignment
The --suppress flag specifies which columns of output (from the default output mode) will be omitted here that is the read name, read sequence, read quality, and name of reference sequence where mate's alignment occurs fields
The -c flag specifies the reference sequences are given on the command line rather than by file
Then submit this job to the SLURM scheduler using command sbatch:
> sbatch sub_bowtie_ex1.sh
This job is based on Lamda phage examples from the bowtie2 manual
#!/bin/bash
#SBATCH --job-name bowtie2_ex1
#SBATCH --partition medium
#SBATCH --output=bowtie2_index_ex_t%j
module purge
module load Biosciences/bowtie/2.3.4/gcc
srun bowtie2-build ~/example/reference/lambda_virus.fa lambda_virus
This job is based on Lamda phage examples from the bowtie2 manual
#!/bin/bash
#SBATCH --job-name bowtie2_ex2
#SBATCH --partition medium
#SBATCH --output=bowtie2_align_ex_%j
module purge
module load Biosciences/bowtie/2.3.4/gcc
srun bowtie2 -x lambda_virus -U ~/example/reads/reads_1.fq -S eg1.sam
Bowtie2 flags used:
The -x flag specifies the basename of the index for the reference genome
The -U flag specifies files containing unpaired reads to be aligned
The -S flag specifies a file to write SAM alignments to
This job is based on Lamda phage examples from the bowtie2 manual
#!/bin/bash
#SBATCH --job-name bowtie2_ex3
#SBATCH --partition medium
#SBATCH --output=bowtie2_per_ex_%j
module purge
module load Biosciences/bowtie/2.3.4/gcc
srun bowtie2 -x lambda_virus -1 ~/example/reads/reads_1.fq -2 ~/example/reads/reads_2.fq -S eg2.sam
Bowtie2 flags used:
The -1 flag specifies files containing mate 1s
The -2 flag specifies files containing mate 2s