BAMTOOLS is a collection of tools for manipulating genome alignment
information stored in the BAM file format.

BAMTOOLS includes both a C++ library and a command line interface.

The command line tools include:

  • convert
  • count
  • coverage
  • filter
  • header
  • index
  • merge
  • random
  • revert
  • sort
  • split
  • stats

Web Site:

The BAMTOOLS home page at github:



On any ARC cluster, check the installation details
by typing "module spider bamtools".

BAMTOOLS requires that the appropriate modules be loaded before it can
be used. One version of the appropriate commands for use on NewRiver is:

module purge
module load gcc/5.2.0
module load bamtools/2.4


The following batch file demonstrates the use of BAMTOOLS:

#! /bin/bash
#PBS -l walltime=0:05:00
#PBS -l nodes=1:ppn=1
#PBS -W group_list=newriver
#PBS -q open_q
#PBS -j oe
module purge
module load gcc/5.2.0
module load bamtools/2.4
#  Report the number of alignments.
bamtools count -in sim_reads_aligned.bam
#  Convert to FASTQ format.
bamtools convert -format fastq -in sim_reads_aligned.bam -out sim_reads_aligned.fq

A complete set of files to carry out a similar process are available in