Use samtools to explore alignments
SAMtools is a collection of tools for manipulating and analyzing SAM and BAM alignment files.
Use samtools view to convert the SAM file from 2 steps ago into a BAM file. BAM is the binary format corresponding to the SAM text format:
Use samtools sort to convert the BAM file to a sorted BAM file:
We now have a sorted BAM file called eg2.sorted.bam. Sorted BAM is a useful format because the alignments are (a) compressed, which is convenient for long-term storage, and (b) sorted, which is convenient for variant discovery.
To learn more about samtools, check out our samtools tutorial.