Bowtie2

Overview

Bowtie2 is an ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences. It is particularly good at aligning reads of about 50 up to 100s or 1,000s of characters to relatively long (e.g. mammalian) genomes.

Bowtie 2 is not a “drop-in” replacement for Bowtie 1. Bowtie 2’s command-line arguments and genome index format are both different from Bowtie 1’s. See the section in the bowtie2 manual on how they differ.

Restrictions on use

All users may access and use Bowtie. The software is open source using the GPL3 license. Users should consult the following file for further information:

$BOWTIE2_HOME/LICENSE

For citation information see the Bowtie2 website.

Set up procedure

Please load one of the following modulefiles – we recommend doing this in your jobscript:

module load apps/binapps/bowtie2/2.5.4
module load apps/binapps/bowtie2/2.4.1

The previous version required two commands:

module load apps/bioinf libs/gcc/system
module load apps/bowtie2/2.2.6/gcc-4.8.5

Indexes – for both versions no pre-built indexes have been installed. Users should download and build their own indexes and set the variable BOWTIE2_INDEXES on the command line or in .bashrc . For example, in your scratch area:

export BOWTIE2_INDEXES=$HOME/scratch/my_indexes

Running the application

Please do not run bowtie2 commands on the login node. qrsh is recommended for some commands. Computationally intense work should be done via the batch system.

Examples

The following example first runs bowtie2-build as a serial job. We then run bowtie2 using multi-core processing.

To create an index for the Lambda phage reference genome included with Bowtie 2, create a jobscript containing:

#!/bin/bash --login
#SBATCH -p serial     # (or --partition=) 1-core job
#SBATCH -t 4-0        # 4-day wallclock (max permitted is 7 days)

# Start with a clean environment in Slurm
module purge
module load apps/binapps/bowtie2/2.4.1

bowtie2-build $BOWTIE2_HOME/example/reference/lambda_virus.fa lambda_virus

and submit the job using sbatch jobscript where jobscript is the name of your job script file.

Now create a jobscript to run the Bowtie 2 aligner (bowtie2), which aligns a set of unpaired reads to the Lambda phage reference genome using the index generated in the previous step. We run this with multiple threads.

#!/bin/bash --login
#SBATCH -p multicore     # (or --partition=) Use the AMD 168-core nodes
#SBATCH -n 8             # (or --ntasks=) Run in parallel with 8 threads (max is 168 in multicore)
#SBATCH -t 2-0           # 2-day wallclock (7-0 is max permitted)

# Start with a clean environment in Slurm
module purge
module load apps/binapps/bowtie2/2.4.1

# Use -p $SLURM_NTASKS to tell bowtie2 to use the number of threads requested above
bowtie2 -p $SLURM_NTASKS -x lambda_virus -U $BOWTIE2_HOME/example/reads/reads_1.fq -S eg1.sam

and submit the job using sbatch jobscript where jobscript is the name of your job script file.

To view the first few lines of the output file use

head eg1.sam

Further info

Last modified on September 10, 2025 at 9:41 am by George Leaver