Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SAMtools

...

SAMtools is a quite suite of commands for dealing with databases of mapped reads. You'll be using it quite a bit throughout the course.

Calling variants in reads mapped by bowtie

Right now, we'll be using it to call variants (find mutations) in the re-sequenced E. coli genome from the Introduction to mapping (bowtie, BWA). You will need the output SAM files from that tutorial to continue here.

...

Code Block
mkdir samtools_bowtie

Lets Let's copy over the read alignment file in the SAM format and the reference genome in FASTA format to the new directory, so that we don't have so many files cluttering our space up.

...

SAM is a text file, so it is slow to access information about a read. SAMtools and many of the commands that we will run later work on BAM files (essentially binary forms of the text SAM files). These can be loaded much more quickly. Typically, they also need to be sorted, so that when the program wants to look at all reads overlapping position 4,129,888, it can easily find them all at once without having to search through the entire BAM file.

...

For the data we are dealing with, predictions with an allele frequency not equal to 1 are not really applicable. (The reference genome is haploid. There aren't any heterozygotes.) How can we remove these lines from the file and continue on?

...

Output - Filtering Allele Frequencies

Calling variants in reads mapped by BWA

Follow the same directions to call variants in the BWA-mapped reads.

Just be sure you don't write over your old files. Maybe create another new directory:

Code Block

mkdir samtools_bwa

Exercise: Determining Differences Between Mappers.

Setup Set up a new output directory and then change into copy the respective VCF files to it.

Code Block
mkdir outputcomparison
cp samtools_bowtie/output.vcf output/bowtie.vcf
cp samtools_bwa/output.vcf output/bwa.vcf
cd outputcomparison

Bedtools is a suite of utility programs that work on a variety of file formats, one of which is conveniently VCF format. Using intersectBed and subtractBed we can find equal and different predictions between mappers.

...

Code Block
subtractBed -a bowtie.vcf -b intersect.vcf > unique_bowtie.vcf
subtractBed -a bwa.vcf -b intersect.vcf > unique_bwa.vcf

Exercises

  • Which mapper finds more variants?

Next up

We will examine the reads supporting these variants by Using the Integrative Genomics Viewer (IGV)

Output - Determining Differences Between Mappers