Objectives

In this lab, you will explore a popular fast mapper called BWA. Simulated RNA-seq data will be provided to you; the data contains 75 bp paired-end reads that have been generated in silico to replicate real gene count data from Drosophila. The data simulates two biological groups with three biological replicates per group (6 samples total).  The objectives of this lab is mainly to:

 

  1. Learn how BWA works and how to use it.

Introduction

BWA (the Burrows-Wheeler Aligner) is a fast short read aligner. It's the successor to another aligner you might have used or heard of called MAQ (Mapping and Assembly with Quality). As the name suggests, it uses the burrows-wheeler transform to perform alignment in a time and memory efficient manner.

BWA Variants

BWA has three different algorithms:

Get your data

Six raw data files have been provided for all our further RNA-seq analysis:


cds
cd my_rnaseq_course
cd day_1/bwa_exercise

Run BWA

Load the module:

module load bwa/0.7.7 

There are multiple versions of BWA on TACC, so you might want to check which one you have loaded for when you write up your awesome publication that was made possible by your analysis of next-gen sequencing data.

module spider bwa
module list
bwa

You can see the different commands available under the bwa package from the command line help:

bwa

 

Part 1. Create a index of your reference

NO NEED TO RUN THIS NOW- YOUR INDEX HAS ALREADY BEEN BUILT!

bwa index -a bwtsw reference/genome.fa


Part 2. Align the samples to reference using bwa mem

Alternatively, lets also try running alignment using the newest and greatest, BWA MEM. Alignment is just one single step with bwa mem.

 

Create a commands file and use launcher_creator.py followed by sbatch.

nano commands.mem
 
bwa mem reference/genome.fa data/GSM794483_C1_R1_1.fq data/GSM794483_C1_R1_2.fq > C1_R1.mem.sam
bwa mem reference/genome.fa data/GSM794484_C1_R2_1.fq data/GSM794484_C1_R2_2.fq > C1_R2.mem.sam
bwa mem reference/genome.fa data/GSM794485_C1_R3_1.fq data/GSM794485_C1_R3_2.fq > C1_R3.mem.sam
bwa mem reference/genome.fa data/GSM794486_C2_R1_1.fq data/GSM794486_C2_R1_2.fq > C2_R1.mem.sam
bwa mem reference/genome.fa data/GSM794487_C2_R2_1.fq data/GSM794487_C2_R2_2.fq > C2_R2.mem.sam
bwa mem reference/genome.fa data/GSM794488_C2_R3_1.fq data/GSM794488_C2_R3_2.fq > C2_R3.mem.sam

launcher_creator.py -n mem -t 04:00:00 -j commands.mem -q normal -a UT-2015-05-18 -m "module load bwa/0.7.7" -l bwa_mem_launcher.slurm

Since this will take a while to run, you can look at already generated results at: bwa_mem_results

 Help! I have a lots of reads and a large number of reads. Make BWA go faster!

Now that we are done mapping, lets look at how to assess mapping results.