Skip to content
lomereiter edited this page Jun 26, 2012 · 9 revisions

There's a command line tool Sambamba, built on top of the library, located in CLItools/ directory. For compilation you need either DMD compiler (install from repository of download from http://dlang.org/download.html) or GDC (install according to instructions on https://bitbucket.org/goshawk/gdc/wiki/Home)

sambamba

Usage: sambamba [options] <input.bam> [region1 [...]]

Options: -q, --quality-threshold=THRESHOLD
                    skip reads with mapping quality < THRESHOLD
         -r, --read-group=READGROUP
                    output only reads from read group READGROUP
         -f, --format=sam|json
                    specify which format to use for output (default is SAM)
         -h, --with-header
                    print header before reads
         -H, --header
                    output only header
         -I, --reference-info
                    output only reference names and lengths in JSON
         -c, --count
                    output only count of matching records, hHI are ignored
         -v, --valid
                output only valid alignments
         -S, --sam-input
                specify that input is in SAM format
                (unnecessary if input file has .sam extension)

Regions are specified as in samtools, e.g. "chr1:1,000-2000" or "chr2" or "chr3:1,000,000". The tool outputs reads in SAM format by default, but you can also specify JSON.

How to compile

cd CLItools/
make sambamba-dmd

The executable sambamba will be in CLItools/build directory. You can just copy it to /usr/local/bin.