High-Performance Computing at the NIH

RSS Feed
SAMtools on Helix

SAM (Sequence Alignment/Map) format is a generic format for storing large nucleotide sequence alignments. SAM aims to be a format that:

- Is flexible enough to store all the alignment information generated by various alignment programs;
- Is simple enough to be easily generated by alignment programs or converted from existing alignment formats;
- Is compact in file size;
- Allows most of operations on the alignment to work on a stream without loading the whole alignment into memory;
- Allows the file to be indexed by genomic position to efficiently retrieve all reads aligning to a locus.

SAM Tools provide various utilities for manipulating alignments in the SAM format, including sorting, merging, indexing and generating alignments in a per-position format.

Program Location

/usr/local/samtools/

The easiest way to add samtools, bcftools and the miscellaneous tools to your path is by using the modules commands as in the example below:

[user@helix]$ module avail samtools                   (see what versions are available)

------------------- /usr/local/Modules/3.2.9/modulefiles -------------------
samtools/0.1.12a         samtools/0.1.15          samtools/0.1.18(default)
samtools/0.1.13          samtools/0.1.17

[user@helix]$ module load samtools                     (load the default version)

[user@helix]$ module list                              (see what version is loaded)
Currently Loaded Modulefiles:
  1) samtools/0.1.18

[user@helix]$ module unload samtools                   (unload this version)

[user@helix]$ module load samtools/0.1.15              (load a specific version)

[user@helix]$ module list
Currently Loaded Modulefiles:
  1) samtools/0.1.15

Sample Session on Helix

SAMtools sample files can be copied from:

/usr/local/samtools/examples
to your own /data/user area.
% module load samtools
  
% cd /home/user/samtools/run1
% samtools faidx ex1.fa                                # index the reference FASTA

% samtools import ex1.fa.fai ex1.sam.gz ex1.bam        # SAM->BAM

% samtools index ex1.bam                               # index BAM

% samtools tview ex1.bam ex1.fa                        # view alignment

% samtools pileup -cf ex1.fa ex1.bam                   # pileup and consensus

Documentation

http://samtools.sourceforge.net/