- Introduction
- Binary installation
- Getting help
- Compiling
- Debugging and troubleshooting
- License
- Credits
Sambamba is a high performance highly parallel robust and fast tool
(and library), written in the D programming language, for working with
SAM and BAM files. Current functionality is an important subset of
samtools functionality, including view, index, sort, markdup, and
depth. Most tools support piping: just specify /dev/stdin or
/dev/stdout as filenames.
When we started writing sambamba (in 2012) the main advantage over
samtools was parallelized BAM reading and writing. In March 2017
samtools 1.4 was released, reaching parity on this. A
recent performance comparison
shows that sambamba holds its ground and can do better in different
configurations. Here are some comparison metrics.
In addition sambamba has a few interesting features to offer, in particular
- faster
sort, see performance - automatic index creation when writing any coordinate-sorted file
view -L <bed file>utilizes BAM index to skip unrelated chunksdepthallows to measure base, sliding window, or region coverages- Chanjo builds upon this and gets you to exon/gene levels of abstraction
markdup, a fast implementation of Picard algorithmslicequickly extracts a region into a new file, tweaking only first/last chunks- and more
Sambamba is free and open source software, licensed under GPLv2+. See manual pages online to know more about what is available and how to use it.
For more information on Sambamba contact Artem Tarasov and Pjotr Prins.
For those not in the mood to learn/install new package managers, there are Github source and binary releases. Simply download the tarball, unpack it and run it. For example
wget https://github.com/biod/sambamba/releases/download/v0.6.8/sambamba_v0.6.8_linux.tar.bz2
tar xvjf sambamba_v0.6.8_linux.tar.bz2
./sambamba_v0.6.8
sambamba 0.6.8
Usage: sambamba [command] [args...]
Available commands: 'view', 'index', 'merge', 'sort',
'flagstat', 'slice', 'markdup', 'depth', 'mpileup'
To get help on a particular command, just call it without args.With Conda use the bioconda channel.
A GNU Guix package for sambamba is available. The development version is packaged here.
Debian: see Debian packages.
Users of Homebrew can also use the formula from homebrew-science.
Sambamba has a mailing list for installation help and general discussion.
Before posting an issue search the issue tracker and mailing list first. It is likely someone may have encountered something similar. Also try running the latest version of sambamba to make sure it has not been fixed already. Support/installation questions should be aimed at the mailing list. The issue tracker is for development issues around the software itself. When reporting an issue include the output of the program and the contents of the output directory.
- I have found and issue with sambamba
- I have searched for it on the issue tracker (also check closed issues)
- I have searched for it on the mailing list
- I have tried the latest release of sambamba
- I have read and agreed to below code of conduct
- If it is a support/install question I have posted it to the mailing list
- If it is software development related I have posted a new issue on the issue tracker or added to an existing one
- In the message I have included the output of my sambamba run
- In the message I have included the relevant files in the output directory
- I have made available the data to reproduce the problem (optional)
To find bugs the sambamba software developers may ask to install a development version of the software. They may also ask you for your data and will treat it confidentially. Please always remember that sambamba is written and maintained by volunteers with good intentions. Our time is valuable too. By helping us as much as possible we can provide this tool for everyone to use.
By using sambamba and communicating with its communtity you implicitely agree to abide by the code of conduct as published by the Software Carpentry initiative.
Note: in general there is no need to compile sambamba. You can use a recent binary install as listed above.
The preferred method for compiling Sambamba is with the LDC compiler which targets LLVM.
- git (to check out the repo)
- gcc compiler 4.9 or later (for htslib)
- D compiler 1.7.0 or later (ldc2, see below)
- python2 (parses D-compiler header for version info)
- zlib (library)
- lz4 (library)
- htslib (submodule)
- BioD (source)
- undeaD (source)
- python2
The LDC compiler's github repository provides binary images. The current preferred release for sambamba is LDC - the LLVM D compiler (>= 1.6.1). After installing LDC from https://github.com/ldc-developers/ldc/releases/ with, for example
cd
wget https://github.com/ldc-developers/ldc/releases/download/v$ver/ldc2-1.7.0-linux-x86_64.tar.xz
tar xvJf ldc2-1.7.0-linux-x86_64.tar.xz
export PATH=$HOME/ldc2-1.7.0-linux-x86_64/bin:$PATH
export LIBRARY_PATH=$HOME/ldc2-1.7.0-linux-x86_64/libgit clone --recursive https://github.com/biod/sambamba.git
cd sambamba
makeTo build a debug release run
make clean && make debugTo run the test fetch shunit2 from https://github.com/kward/shunit2 and put it in the path so you can run
make checkTo build sambamba the LDC compiler is also available in GNU Guix:
guix package -i ldcNote: the Makefile does not work. Someone want to fix that using the Makefile.old version? See also biod#338.
brew install ldc
git clone --recursive https://github.com/biod/sambamba.git
cd sambamba
git clone https://github.com/dlang/undeaD
make sambamba-ldmd2-64Sambamba development and issue tracker is on github. Developer documentation can be found in the source code and the development documentation.
Important note: some popular Xeon processors segfault under heavy hyper threading - which Sambamba utilizes. Please read this when encountering seemingly random crashes.
In a crash sambamba can dump a core file. To make this happen set
ulimit -c unlimitedand run your command. Send us the core file so we can reproduce the state at time of segfault.
Another option is to use catchsegv
catchsegv ./build/sambamba commandthis will show state on stdout which can be sent to us.
In case of crashes it's helpful to have GDB stacktraces (bt
command). A full stacktrace for all threads:
thread apply all backtrace full
Note that GDB should be made aware of D garbage collector:
handle SIGUSR1 SIGUSR2 nostop noprint
A binary relocatable install of sambamba with debug information and all dependencies can be fetched from the binary link above. Unpack the tarball and run the contained install.sh script with TARGET
./install.sh ~/sambamba-test
Run sambamba in gdb with
gdb -ex 'handle SIGUSR1 SIGUSR2 nostop noprint' \
--args ~/sambamba-test/sambamba-*/bin/sambamba view --throw-error
Sambamba is distributed under GNU Public License v2+.
If you are using Sambamba in your research and want to support future work on Sambamba, please cite the following publication:
A. Tarasov, A. J. Vilella, E. Cuppen, I. J. Nijman, and P. Prins. Sambamba: fast processing of NGS alignment formats. Bioinformatics, 2015.
@article{doi:10.1093/bioinformatics/btv098,
author = {Tarasov, Artem and Vilella, Albert J. and Cuppen, Edwin and Nijman, Isaac J. and Prins, Pjotr},
title = {Sambamba: fast processing of NGS alignment formats},
journal = {Bioinformatics},
volume = {31},
number = {12},
pages = {2032-2034},
year = {2015},
doi = {10.1093/bioinformatics/btv098},
URL = { + http://dx.doi.org/10.1093/bioinformatics/btv098}