Skip to content

Burrows-Wheeler Aligner

Burrows-Wheeler Aligner (BWA) is a software package for mapping low-divergent sequences against a large reference genome, such as the human genome. It consists of three algorithms: BWA-backtrack, BWA-SW and BWA-MEM.

BWA ia available as a module on Apocrita.

Usage

To run the default installed version of BWA, simply load the bwa module:

$ module load bwa
$ bwa

Usage:   bwa <command> [options]

For full usage documentation, run bwa without a command.

Example job

Serial job

Here is an example job running on 1 core and 2GB of memory:

#!/bin/bash
#$ -cwd
#$ -j y
#$ -pe smp 1
#$ -l h_rt=1:0:0
#$ -l h_vmem=2G

module load bwa

# Index fasta file
bwa index ref.fa

# Align Illumina/454/IonTorrent single-end reads
# longer than ~70bp
bwa mem -t ${NSLOTS} \
        ref.fa reads.fq > aln.sam

Extensions to BWA

BWA-Meth

BWA-Meth performs a fast and accurate alignment of Bisulfite sequences.

Module dependency

Loading the bwameth module also loads the bwa module.

To run the default installed version of BWA-Meth, simply load the bwameth module:

$ module load bwameth
$ bwameth.py -h

       [-h] --reference REFERENCE [-t THREADS] [--read-group READ_GROUP]
       [--set-as-failed {f,r}] [-p] [--version]
       fastqs [fastqs ...]

For full usage documentation, run bwameth.py -h.

BWA-Meth serial job

Here is an example job running on 1 core and 2GB of memory:

#!/bin/bash
#$ -cwd
#$ -j y
#$ -pe smp 1
#$ -l h_rt=1:0:0
#$ -l h_vmem=2G

module load bwameth

# Index fasta file
bwameth.py index ref.fa

# Align the Reads
bwameth.py --threads ${NSLOTS} \
           --reference ref.fa fastq1.gz fastq2.gz \
           | samtools view -b - > bwa-meth.bam

# Check the alignments
samtools flagstat bwa-meth.bam

References