Fork me on GitHub


Iceberg reaches end-of-life on 30th November 2020. If you are running jobs on Iceberg then you need to take urgent action to ensure that your jobs/scripts will run on ShARC or Bessemer. If you have never used ShARC or Bessemer then now is the time to test your scripts. Not all software on Iceberg is available on ShARC/Bessemer.


SAM (Sequence Alignment/Map) format is a generic format for storing large nucleotide sequence alignments.

Interactive Usage

After connecting to Iceberg (see Establishing a SSH connection), start an interactive session with the qsh command.

Next, load a specific version of Samtools with one of the following:

module load apps/gcc/6.2/samtools/1.3.1
module load apps/gcc/5.2/samtools/1.2

This command makes the Samtools binary directory available to your session.


Once you have made Samtools available to the system using the module command above, you can read the man pages by typing

man samtools

Installation notes

This section is primarily for system administrators.

Version 1.3.1

This install script:

  1. Built Samtools plus the bundled HTSlib, HTSlib utilities such as bgzip plus various useful plugins. Compiled using GCC 6.2 (GNU Compiler Collection (gcc)).

  2. Ran all tests using make tests; a summary of the results is shown below; for full results see /usr/local/packages6/apps/gcc/6.2/samtools/1.3.1/tests.log

    Number of tests:
        total            .. 423
        passed           .. 403
        failed           .. 0
        expected failure .. 20
        unexpected pass  .. 0
    test/merge/test_bam_translate test/merge/test_bam_translate.tmp
    cd test/mpileup && ./ mpileup.reg
    === Testing mpileup.reg regressions ===
    Expected   passes:   124
    Unexpected passes:   0
    Expected   failures: 0
    Unexpected failures: 0
    => PASS
    cd test/mpileup && ./ depth.reg
    === Testing depth.reg regressions ===
    Expected   passes:   14
    Unexpected passes:   0
    Expected   failures: 0
    Unexpected failures: 0
    => PASS
  3. Installed Samtools to /usr/local/packages6/apps/gcc/6.2/samtools/1.3.1

Next, this modulefile was installed as /usr/local/modulefiles/apps/gcc/6.2/samtools/1.3.1

Version 1.2

Installed using GCC 5.2 (GNU Compiler Collection (gcc))

module load compilers/gcc/5.2

tar -xvjf ./samtools-1.2.tar.bz2
cd samtools-1.2
mkdir -p /usr/local/packages6/apps/gcc/5.2/samtools/1.2
make prefix=/usr/local/packages6/apps/gcc/5.2/samtools/1.2
make prefix=/usr/local/packages6/apps/gcc/5.2/samtools/1.2 install
#tabix and bgzip are not installed by the above procedure.
#We can get them by doing the following
cd htslib-1.2.1/
mv ./tabix /usr/local/packages6/apps/gcc/5.2/samtools/1.2/bin/
mv ./bgzip /usr/local/packages6/apps/gcc/5.2/samtools/1.2/bin/

The test suite was run with

make test 2>&1 | tee make_tests.log

The summary of the test output was

Test output:
Number of tests:
    total            .. 368
    passed           .. 336
    failed           .. 0
    expected failure .. 32
    unexpected pass  .. 0

test/merge/test_bam_translate test/merge/test_bam_translate.tmp
cd test/mpileup && ./
Samtools mpileup tests:

EXPECTED FAIL: Task failed, but expected to fail;
when running $samtools mpileup -x -d 8500 -B -f mpileup.ref.fa deep.sam|awk '{print $4}'

Expected   passes:   123
Unexpected passes:   0
Expected   failures: 1
Unexpected failures: 0

The full log is on the system at /usr/local/packages6/apps/gcc/5.2/samtools/1.2/make_tests.log

This modulefile was installed as /usr/local/modulefiles/apps/gcc/5.2/samtools/1.2