The SAM format is a standard format for storing large nucleotide sequence alignments. The BAM format is just the binary form from SAM. SAMtools is a toolkit for manipulating alignments in SAM/BAM format, including sorting, merging, indexing and generating alignments in a per-position format.

The basic usage of SAMtools is:

$ samtools COMMAND [options]
where COMMAND is one of the following SAMtools commands:

  • view: SAM/BAM and BAM/SAM conversion
  • sort: sort alignment file
  • mpileup: multi-way pileup
  • depth: compute the depth
  • faidx: index/extract FASTA
  • tview: text alignment viewer
  • index: index alignment
  • idxstats: BAM index stats
  • fixmate: fix mate information
  • flagstat: simple stats
  • calmd: recalculate MD/NM tags and ‘=’ bases
  • merge: merge sorted alignments
  • rmdup: remove PCR duplicates
  • reheader: replace BAM header
  • cat: concatenate BAMs
  • bedcov: read depth per BED region
  • targetcut: cut fosmid regions
  • phase: phase heterozygotes
  • bamshuf: shuffle and group alignments by name

For detailed description and more information on a specific command, just type:

$ samtools COMMAND
or check the SAMtools manual.

The page Running SAMtools Commands shows how to run SAMtools on HCC.