Assessing Mapping Results I
Objectives
In this lab, you will explore the mapping results generated previously. You will learn how to assess mapping results using samtools and unix commands. You will also look at the differences between mapping with BWA and mapping with hisat2.
Get your data
To try out exercises, you'll need to access your mapping results.
# If using your own BWA mapped results (Sam files), they should be at: $SCRATCH/my_rnaseq_course/day_2/bwa_exercise # If not, you can look at the results from this directory: $SCRATCH/my_rnaseq_course/day_2/bwa_exercise/bwa_mem_results_transcriptome
Utilities for parsing and manipulating alignment files in SAM and BAM formats. It is useful for:
- Sorting alignment files
- Merging multiple alignment files
- Converting from SAM to BAM and vice versa.
- Retrieving reads based on different criteria : reads mapping to a particular region, reads mapping with a certain quality, unmapped reads, etc.
- Collecting statistics about your mapping result.
With mapping results in SAM format, we need to convert it to BAM format, sort the BAM file and create and index for the BAM file.
module load samtools
Syntax 1: Convert SAM file to BAM format.
samtools view -b -S samfile > bamfile
Syntax 2: Sort and index newly created BAM file.
samtools sort -o sortedbamfile bamfile samtools index sortedbamfile
WE ARE NOT GOING TO DO THIS RIGHT NOW, BUT TAKE A LOOK!
Submit to the TACC queue or run in an idev shell
Create a commands
file and use launcher_creator.py followed by sbatch.
Exercise 1: Let's get some statistics: Samtools flagstat
PREFERABLY, DO THIS IN YOUR IDEV SESSION (IF ITS STILL AVAILABLE)
Samtools flagstat can generate useful statistics about a mapped BAM file. Let's try it on one of our samples- C1_R1. Let's look at the BAM files for this sample, generated from bwa aln/sampe and generated from bwa mem. The two files are: C1_R1.bam and C1_R1.mem.bam
samtools flagstat bwa_mem_results_transcriptome/C1_R1.mem.bam
Exercise 2: Let's get some statistics: Samtools idxstats
samtools idxstats bwa_mem_results_transcriptome/C1_R1.mem.bam
Welcome to the University Wiki Service! Please use your IID (yourEID@eid.utexas.edu) when prompted for your email address during login or click here to enter your EID. If you are experiencing any issues loading content on pages, please try these steps to clear your browser cache.