Pittsburgh Supercomputing Center 

Advancing the state-of-the-art in high-performance computing,
communications and data analytics.

SAMtools

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

Installed on blacklight and biou.

Other resources that may be helpful include:

  • Li H.*, Handsaker B.*, Wysoker A., Fennell T., Ruan J., Homer N.,  Marth G., Abecasis G., Durbin R. and 1000 Genome Project Data     Processing Subgroup , The Sequence alignment/map (SAM) format and SAMtools. Bioinformatics, 25, 2078-9. (2009) [PMID: 19505943]
  • Website: http://samtools.sourceforge.net

Running SAMtools

On blacklight

The SAMtools program is made availiable for use through the module command. To load the SAMtools module enter:

module load samtools

On biou

The SAMtools programs are availiable through the Galaxy instance on biou.

To make the SAMtools programs availiable through the command line,  csh users should enter the following command:

source /packages/bin/SETUP_BIO_SOFTWARE

To make the SAMtools programs availiable through the command line, bash users should enter the following command:

source /packages/bin/SETUP_BIO_SOFTWARE

Command Line Usage:

samtools <command> [options]

Available commands are:

view SAMBAM <-> 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 (r595 or later)
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
targetcut cut fosmid regions (for fosmid pool only)
phase phase heterozygotes

 

Example PBS script for blacklight

#PBS -q batch
#PBS -j oe
#PBS -l ncpus=16
#PBS -l walltime=11:30:00
#PBS -N Samtools
#
# ----------------
# Samtools Setup
# ----------------
source /usr/share/modules/init/bash
module load samtools/0.1.18 #
set -x
cd $SCRATCH #--------------------------------------------------------- # SAMFILE should point to your SAM files # REFFILE should point to the reference file to be indexed #--------------------------------------------------------- SAMFILE=Sample_pe.sam REFFILE=human_g1k_v37.fasta # ----------------------------------------------------------- # Illustrate the use SAMTOOLS to sort things so we can # use IGV for Visualization # ----------------------------------------------------------- samtools faidx $REFFILE samtools view -b -S -o Sample_pe.bam $SAMFILE samtools sort -m 25000000000 Sample_pe.bam Sample_pe.sorted samtools index Sample_pe.sorted.bam