Mapping tutorial BME
The first step in nearly every next-gen sequence analysis pipeline is to map sequencing reads to a reference genome. In this tutorial we'll run some common mapping tools on TACC.
The world of read mappers seems to be settling down a bit after being a bioinformatics Wild West where there was a new gun in town every week that promised to be a faster and more accurate shot than the current record holder. Things seem to have reached the point where there is mainly a trade-off between speed, accuracy, and configurability among read mappers that have remained popular.
There are over 50 read mapping programs listed here. We're going to (mainly) stick to BWA in this class.
Each mapper has its own set of limitations (on the lengths of reads it accepts, on how it outputs read alignments, on how many mismatches there can be, on whether it produces gapped alignments, on whether it supports SOLiD colorspace data, etc.).
Mapping tools summary
See if you can find some other modules on Lonestar that pertain to Alignment
Example: E. coli genome re-sequencing data
Before We Start
In order to save a lot of typing, and to allow us some flexibility in designing these courses, we will establish a UNIX shell variable BI to point to the current filesystem location of the BioITeam directory. For any shell you open that accesses Lonestar during today's tutorial, please enter the following command:
export BI=/corral-repl/utexas/BioITeam
We also have some handy scripts for you to use, but we need to add them to your path for convenience:
export PATH=$PATH:$BI/bin
Note: to see what that did, you can type
echo $PATHand you should see the new BioITeam folder at the end. The PATH variable contains all the places Linux looks for all the commands you type.
Finally, we will use bioperl in our scripts, so let's load that into our environment:
module load perl bioperlData
The data files for this example are in the path:
$BI/ngs_course/intro_to_mapping/data
File Name | Description | Sample |
|---|---|---|
| Paired-end Illumina, First of pair, FASTQ format | Re-sequenced E. coli genome |
| Paired-end Illumina, Second of pair, FASTQ format | Re-sequenced E. coli genome |
| Reference Genome in Genbank format | E. coli B strain REL606 |
The easiest way to run the tutorial is to copy this entire directory to your $SCRATCH space and then run all of the commands from inside that directory. See if you can figure out how to do that. When you're in the right place, you should get output like this from the ls command.
login1$ ls
NC_012967.1.gbk SRR030257_1.fastq SRR030257_2.fastq
Exercises
What basic linux commands could help us quickly peek at the files that were just copied to get an idea of their contents?
How many sequences are in the file
SRR030257_1.fastq?
How many bases long are the reads in
SRR030257_1.fastq?
Converting sequence file formats
Occasionally you might download a sequence or have it emailed to you by a collaborator in one format, and then the program that you want to use demands that it be in another format. Why do they have to be so picky?
The bp_seqconvert.pl script that is installed as part of Bioperl is one helpful utility for converting between many common sequence formats. On TACC, the Bioperl modules are installed, but the helper script isn't. So, we've put it in a place that you can run it from for your convenience. However, remember that any time that you use the script you must have the bioperl module loaded. We did this earlier.
Run the script without any arguments to get the help message:
bp_seqconvert.pl
Exercises
The file NC_012967.1.gbk is in Genbank format. The files SRR030257_*.fastq are in FASTQ format.
Convert
NC_012967.1.gbkto FASTA format. Call the outputNC_012967.1.fasta.Does EMBL format have sequence features (like genes) annotated?
What information was lost by this conversion?
Extra reading
Mapping with BWA
BWA (the Burrows-Wheeler Aligner) is a fast mapping program. It's the successor to another aligner you might have used or heard of called MAQ (Mapping and Assembly with Quality).
To use BWA, we first need to load the software into our environment using TACC's module system.
Load the module:
module load bwa