Software Category


SAM (Sequence Alignment/Map) is a flexible generic format for storing nucleotide sequence alignments. Samtools provides efficient utilities on manipulating alignments in the SAM format.

Using Samtools on RCC Resources

Note that Samtools requires loading the GNU module. This can be done by running: module load gnu. Log in to a Spear or HPC node and run the following commands to create a folder and download the SAM example files into it:

$ module load gnu
$ mkdir ~/SAM-test
$ cd ~/SAM-test
$ wget
$ wget

Some example commands using the above data are shown below:

Index the reference FASTA

$ samtools faidx ex1.fa


$ samtools import ex1.fa.fai ex1.sam.gz ex1.bam

Index BAM

$ samtools index ex1.bam

View Alignment

$ samtools tview ex1.bam ex1.fa

Pileup and consensus

$ samtools pileup -cf ex1.fa ex1.bam
$ samtools pileup -cf ex1.fa -t ex1.fa.fai ex1.sam.gz

For detailed usage information, refer to the official Samtools documentation.