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

We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job inherit these settings.

The latest version may be loaded like so:

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
    #$ -S /bin/bash
    #$ -cwd
    
    #python3 required to build the indexes
    module load apps/binapps/anaconda3/2019.07
    
    module load apps/binapps/bowtie2/2.4.1
    
    bowtie2-build $BOWTIE2_HOME/example/reference/lambda_virus.fa lambda_virus

    and submit the job using qsub 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
    #$ -S /bin/bash
    #$ -cwd
    #$ -pe smp.pe 8             # Run in parallel with 8 threads (max is 32 in smp.pe)
    
    module load apps/binapps/bowtie2/2.4.1
    
    # Use -p $NSLOTS to tell bowtie2 to use the number of threads requested above
    bowtie2 -p $NSLOTS -x lambda_virus -U $BOWTIE2_HOME/example/reads/reads_1.fq -S eg1.sam
    
    

    and submit the job using qsub 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 June 4, 2020 at 6:04 pm by Ben Pietras