Pittsburgh Supercomputing Center 

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


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 (2009)
    The Sequence alignment/map (SAM) format and SAMtools.
    Bioinformatics, 25, 2078-9. [PMID: 19505943]

    Website: http://samtools.sourceforge.net

Running SAMtools

1) Make SAMtools availiable for use
   a) blacklight:
   The SAMtools program will be made availiable for use through the module
   command. To load the SAMtools module enter:

   module load samtools

b) 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

2) Command Line Usage:

Usage:   samtools <command> [options]

       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 (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
# SAMFILE should point to your SAM files
# REFFILE should point to the reference file to be indexed
# -----------------------------------------------------------
# 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

Stay Connected

Stay Connected with PSC!

facebook 32 twitter 32 google-Plus-icon