Skip to content
Commits on Source (10)
......@@ -7,6 +7,3 @@
[submodule "BioD"]
path = BioD
url = https://github.com/biod/BioD.git
[submodule "undeaD"]
path = undeaD
url = https://github.com/biod/undeaD.git
......@@ -15,14 +15,20 @@
After checking out the source from github with git submodules is is
possibleto install the build tools with GNU Guix
guix package -i gcc gdb bash ld-wrapper ldc which python2 git
guix package -i gcc-toolchain gdb bash ld-wrapper ldc which python2 git
Even better, with Guix, you can create a light-weight container in the source tree
and run our development setup
and run our development setup (gold was added lately by ldc)
guix environment -C guix --ad-hoc gcc gdb bash ld-wrapper ldc which python git
guix environment -C guix --ad-hoc gcc-toolchain gdb bash ld-wrapper ldc which python git binutils-gold vim
make clean
make -j 4
make check
this way all dependencies are isolated.
## Build Sambamba with Debian
Make sure the environment is minimal with something like
env -i /bin/bash --login --noprofile --norc
......@@ -26,59 +26,61 @@ ifeq ($(UNAME_S),Darwin)
SYS = OSX
else
SYS = LINUX
LINK_OBJ = utils/ldc_version_info_.o
endif
DFLAGS = -wi -I. -IBioD -IundeaD/src -g
DFLAGS = -wi -I. -IBioD -g -J.
DLIBS = $(LIBRARY_PATH)/libphobos2-ldc.a $(LIBRARY_PATH)/libdruntime-ldc.a
DLIBS_DEBUG = $(LIBRARY_PATH)/libphobos2-ldc-debug.a $(LIBRARY_PATH)/libdruntime-ldc-debug.a
LIBS = htslib/libhts.a lz4/lib/liblz4.a -L-L$(LIBRARY_PATH) -L-lpthread -L-lm
LIBS_STATIC = $(LIBRARY_PATH)/libc.a $(DLIBS) htslib/libhts.a $(LIBRARY_PATH)/liblz4.a
SRC = $(wildcard main.d utils/*.d thirdparty/*.d cram/*.d) $(wildcard undeaD/src/undead/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio2/*.d BioD/bio2/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d)
OBJ = $(SRC:.d=.o) utils/ldc_version_info_.o
OUT = bin/sambamba
LIBS = htslib/libhts.a lz4/lib/liblz4.a -L-L$(LIBRARY_PATH) -L-lpthread -L-lm -L-lz
LIBS_STATIC = $(LIBRARY_PATH)/libc.a $(DLIBS) htslib/libhts.a $(LIBRARY_PATH)/liblz4.a -L-lz
SRC = utils/ldc_version_info_.d utils/lz4.d utils/strip_bcf_header.d $(sort $(wildcard BioD/contrib/undead/*.d BioD/contrib/undead/*/*.d)) utils/version_.d $(sort $(wildcard thirdparty/*.d cram/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio/*/*/*/*.d BioD/bio/*/*/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d))
OBJ = $(SRC:.d=.o)
OUT = bin/sambamba-$(shell cat VERSION)
STATIC_LIB_PATH=-Lhtslib -Llz4
.PHONY: all debug release static clean test
all: release
debug: DFLAGS += -O0 -d-debug -link-debuglib
profile: DFLAGS += -fprofile-instr-generate=profile.raw
release static profile pgo-static: DFLAGS += -O3 -release -enable-inlining -boundscheck=off
coverage: DFLAGS += -cov
release static pgo-static: DFLAGS += -O3 -release -enable-inlining -boundscheck=off -L-lz
static: DFLAGS += -static -L-Bstatic
pgo-static: DFLAGS += -fprofile-instr-use=profile.data
all: release
lz4-static: lz4/lib/liblz4.a
lz4/lib/liblz4.a: lz4/lib/lz4.c lz4/lib/lz4hc.c lz4/lib/lz4frame.c lz4/lib/xxhash.c
cd lz4/lib && gcc -O3 -c lz4.c lz4hc.c lz4frame.c xxhash.c && $(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o
htslib-static:
cd htslib && $(MAKE)
cd htslib && $(MAKE) -j8
ldc-version-info:
utils/ldc_version_info_.d:
python3 ./gen_ldc_version_info.py $(shell which ldmd2) > utils/ldc_version_info_.d
cat utils/ldc_version_info_.d
utils/ldc_version_info_.o: ldc-version-info
$(D_COMPILER) $(DFLAGS) -c utils/ldc_version_info_.d -od=$(dir $@)
ldc_version_info: utils/ldc_version_info_.d
build-setup: lz4-static htslib-static ldc-version-info
build-setup: ldc_version_info lz4-static htslib-static
mkdir -p bin/
default debug release static: $(OUT)
profile: release
./bin/sambamba sort /gnu/data/in_raw.bam -p > /dev/null
coverage: debug
profile: debug
$(OUT) sort /gnu/data/in_raw.bam -p > /dev/null
ldc-profdata merge -output=profile.data profile.raw
rm ./bin/sambamba ./bin/sambamba.o # trigger rebuild
rm $(OUT) ./bin/sambamba.o # trigger rebuild
default: all
......@@ -86,17 +88,18 @@ default: all
%.o: %.d
$(D_COMPILER) $(DFLAGS) -c $< -od=$(dir $@)
singleobj:
singleobj: build-setup
$(info compile single object...)
$(D_COMPILER) -singleobj $(DFLAGS) -c -of=bin/sambamba.o $(SRC)
$(D_COMPILER) -singleobj $(DFLAGS) -c -of=$(OUT).o $(SRC)
# ---- Link step
$(OUT): build-setup singleobj utils/ldc_version_info_.o
$(OUT): singleobj
$(info linking...)
$(D_COMPILER) $(DFLAGS) -of=bin/sambamba bin/sambamba.o $(LINK_OBJ) $(LIBS)
$(D_COMPILER) $(DFLAGS) -of=$(OUT) $(OUT).o $(LINK_OBJ) $(LIBS)
test:
./run_tests.sh
test: $(OUT)
$(OUT) --version
./run_tests.sh $(OUT)
check: test
......@@ -106,16 +109,18 @@ debug-strip:
objcopy --add-gnu-debuglink=sambamba.debug bin/sambamba
mv sambamba.debug bin/
pgo-static: profile static debug-strip
pgo-static: static debug-strip
install:
install -m 0755 bin/sambamba $(prefix)/bin
clean: clean-d
cd htslib ; $(MAKE) clean
rm lz4/lib/*.[oa]
rm -f profile.data
rm -f profile.raw
clean-d:
rm -rf bin/*
rm -vf utils/ldc_version_info_.d
rm -f $(OBJ) $(OUT) trace.{def,log}
# GNU Guix makefile. GNU Guix is the package manager for GNU and we
# use it for sambamba development and deployment. Normally use the
# standard Makefile instead because it compiles into a singleobj.
# standard Makefile instead because it compiles into a singleobj which
# gives better performance. This Makefile is for development purposes.
#
# To build sambamba on GNU Guix:
#
......@@ -10,33 +11,30 @@
#
# ./bin/sambamba
#
# certain paths may need to be set, e.g.
# But it is preferred to run in a Guix environment/container. For more
# information see INSTALL.md
#
# make UNDEAD_PATH=../undeaD/src -f Makefile.guix
#
# For more information see INSTALL.md
#
# The following two are modified by the Guix package:
D_COMPILER=ldc2
ifndef GUIX
GUIX=$(HOME)/.guix-profile
endif
LDC_LIB_PATH=$(GUIX)/lib
BIOD_PATH=./BioD
# DLIBS = $(LIBRARY_PATH)/libphobos2-ldc.a $(LIBRARY_PATH)/libdruntime-ldc.a
# DLIBS_DEBUG = $(LIBRARY_PATH)/libphobos2-ldc-debug.a $(LIBRARY_PATH)/libdruntime-ldc-debug.a
UNDEAD_PATH=../undeaD/src
BIOD_PATH=../BioD
DFLAGS = -wi -I. -I$(BIOD_PATH) -IundeaD/src -I$(UNDEAD_PATH)
DFLAGS = -wi -I. -I$(BIOD_PATH) -J.
# DLIBS = $(LDC_LIB_PATH)/libphobos2-ldc.a $(LDC_LIB_PATH)/libdruntime-ldc.a
# DLIBS_DEBUG = -debuglib=phobos2-ldc-debug,druntime-ldc-debug $(LDC_LIB_PATH)/libphobos2-ldc-debug.a $(LDC_LIB_PATH)/libdruntime-ldc-debug.a -link-debuglib
DLIBS_DEBUG = -debuglib=phobos2-ldc-debug-shared,druntime-ldc-debug-shared -link-debuglib -L-lphobos2-ldc-debug-shared -L-ldruntime-ldc-debug-shared
RPATH = -L--rpath=$(dir $(realpath $(LDC_LIB_PATH)/libz.so)):$(dir $(realpath $(LDC_LIB_PATH)/liblz4.so))
LIBS = htslib/libhts.a -L-L$(LDC_LIB_PATH) -L-lrt -L-lpthread -L-lm -L-lz -L-llz4
# DLIBS_DEBUG = -debuglib=phobos2-ldc-debug-shared,druntime-ldc-debug-shared -link-debuglib -L-lphobos2-ldc-debug-shared -L-ldruntime-ldc-debug-shared
# RPATH = -L--rpath=$(dir $(realpath $(LDC_LIB_PATH)/libz.so)):$(dir $(realpath $(LDC_LIB_PATH)/liblz4.so))
RPATH = -L--rpath=$(LIBRARY_PATH)
LIBS = htslib/libhts.a -L-L$(LDC_LIB_PATH) -L-lrt -L-lpthread -L-lm -L-lz lz4/lib/liblz4.a
# LIBS = htslib/libhts.a -L-lrt -L-lpthread -L-lm -L-lz -L-llz4
LIBS_STATIC = $(DLIBS) htslib/libhts.a $(LDC_LIB_PATH)/liblz4.a
SRC = $(wildcard main.d utils/*.d thirdparty/*.d cram/*.d) $(wildcard undeaD/src/undead/*.d undeaD/src/undead/*/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio2/*.d BioD/bio2/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d)
OBJ = $(SRC:.d=.o)
OUT = bin/sambamba
LIBS_STATIC = $(DLIBS) htslib/libhts.a lz4/lib/liblz4.a
SRC = $(wildcard main.d utils/*.d thirdparty/*.d cram/*.d) $(wildcard BioD/contrib/undead/*.d BioD/contrib/undead/*/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio/*/*/*/*.d BioD/bio/*/*/*/*/*.d BioD/bio/*/*/*/*/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d)
OBJ = $(SRC:.d=.o) utils/ldc_version_info_.o
OUT = bin/sambamba-$(shell cat VERSION)
static: OUT += -static
.PHONY: all guix guix-debug debug release static profile clean test
......@@ -46,17 +44,19 @@ guix: DFLAGS += -O -release -g # Guix strips debug flags
guix-debug: DFLAGS += -O0 -g -d-debug -unittest
# The following options are run in development from ~/.guix-profile and need to inject the RPATH
debug: DFLAGS += -O0 -g -d-debug $(RPATH) -link-debuglib -unittest
debug: DFLAGS += -O0 -g -d-debug $(RPATH) -link-debuglib -unittest
release static: DFLAGS += -O3 -release $(RPATH) -enable-inlining -Hkeep-all-bodies -boundscheck=off
static: DFLAGS += -static -L-Bstatic -L-L/gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25/lib/
static: DFLAGS += -static -L-Bstatic -L-L/gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25/lib/
profile: DFLAGS += -g -O -fprofile-instr-generate=profile.raw $(RPATH)
profile: DFLAGS += -g -O -profile $(RPATH)
profile: LIBS += -L=-lprofile_rt
guix release: LIBS += $(DLIBS)
guix release: LIBS += $(DLIBS)
static: LIBS = $(LIBS_STATIC)
static: LIBS = $(LIBS_STATIC)
guix-debug debug profile: LIBS += $(DLIBS_DEBUG)
......@@ -67,12 +67,25 @@ all: debug
# sambamba/subsample.d: bio2/pileup.d
utils/ldc_version_info_.d:
./gen_ldc_version_info.py $(shell which ldc2) > utils/ldc_version_info_.d
python3 ./gen_ldc_version_info.py $(shell which ldmd2) > utils/ldc_version_info_.d
cat utils/ldc_version_info_.d
ldc_version_info: utils/ldc_version_info_.d
lz4/lib/liblz4.a: lz4/lib/lz4.c lz4/lib/lz4hc.c lz4/lib/lz4frame.c lz4/lib/xxhash.c
cd lz4/lib && gcc -O3 -c lz4.c lz4hc.c lz4frame.c xxhash.c && $(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o
lz4-static: lz4/lib/liblz4.a
build-setup: ldc_version_info lz4-static htslib-static
mkdir -p bin/
# utils/ldc_version_info_.o: utils/ldc_version_info_.d
# $(D_COMPILER) $(DFLAGS) -c utils/ldc_version_info_.d -od=$(dir $@)
utils/ldc_version_info_.o: utils/ldc_version_info_.d
$(D_COMPILER) $(DFLAGS) -c utils/ldc_version_info_.d -od=$(dir $@)
guix guix-debug default debug release static profile: ldc_version_info $(OUT)
guix guix-debug default debug release static profile: $(OUT)
debug profile release: lz4-static
# ---- Compile step
%.o: %.d
......@@ -80,12 +93,12 @@ guix guix-debug default debug release static profile: $(OUT)
# ---- Link step
$(OUT): $(OBJ)
cd htslib && $(MAKE)
cd htslib && $(MAKE) -j 4
mkdir -p bin/
$(D_COMPILER) $(DFLAGS) -of=bin/sambamba $(OBJ) $(LIBS)
$(D_COMPILER) $(DFLAGS) -of=$(OUT) $(OBJ) $(LIBS)
test: clean-tests
./run_tests.sh
./run_tests.sh $(OUT)
biod:
cd $(BIOD_PATH)/src_ragel && make
......@@ -103,6 +116,7 @@ install:
clean-c:
cd htslib ; make clean
rm -v lz4/lib/*.[oa]
clean-d:
rm -v $(OBJ) $(OUT) trace.{def,log}
......@@ -111,4 +125,4 @@ clean-d:
clean-tests:
rm -rf output/*
clean: clean-d clean-tests
clean: clean-c clean-d clean-tests
[![Build Status](https://travis-ci.org/biod/sambamba.svg?branch=master)](https://travis-ci.org/biod/sambamba) [![Anaconda-Server Badge](https://anaconda.org/bioconda/sambamba/badges/installer/conda.svg)](https://conda.anaconda.org/bioconda) [![DL](https://anaconda.org/bioconda/sambamba/badges/downloads.svg)](https://anaconda.org/bioconda/sambamba)
g[![Build Status](https://travis-ci.org/biod/sambamba.svg?branch=master)](https://travis-ci.org/biod/sambamba) [![AnacondaBadge](https://anaconda.org/bioconda/sambamba/badges/installer/conda.svg)](https://anaconda.org/bioconda/sambamba) [![DL](https://anaconda.org/bioconda/sambamba/badges/downloads.svg)](https://anaconda.org/bioconda/sambamba) [![BrewBadge](https://img.shields.io/badge/%F0%9F%8D%BAbrew-sambamba-brightgreen.svg)](https://github.com/brewsci/homebrew-bio)
[![GuixBadge](https://img.shields.io/badge/gnuguix-sambamba-brightgreen.svg)](https://www.gnu.org/software/guix/packages/S/)
[![DebianBadge](https://badges.debian.net/badges/debian/testing/sambamba/version.svg)](https://packages.debian.org/testing/sambamba)
# sambamba
# SAMBAMBA
Table of Contents
=================
* [sambamba](#sambamba)
* [Table of Contents](#table-of-contents)
* [Introduction](#introduction)
* [Binary installation](#binary-installation)
* [Install stable release](#install-stable-release)
......@@ -38,41 +38,45 @@ Table of Contents
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. Because of its efficiency is an important work
horse running in many sequencing centres around the world
today.
SAM and BAM files. Because of its efficiency Sambamba is an important
work horse running in many sequencing centres around the world today.
As of November 2019, Sambamba has been cited over
[277 times](http://scholar.google.nl/citations?hl=en&user=5ijHQRIAAAAJ)
and has been installed from Conda over
[120K times](https://anaconda.org/bioconda/sambamba).
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
In March 2017 `samtools` 1.4 was released, reaching parity at least on
architecture. A
[recent performance comparison](https://github.com/guigolab/sambamBench-nf)
shows that sambamba holds its ground and can do better in different
configurations. Here are some comparison
shows that sambamba still holds its ground and can even do better.
Here are some comparison
[metrics](https://public-docs.crg.es/rguigo/Data/epalumbo/sambamba_ws_report.html). For
example for flagstat sambamba is 1.4x faster than samtools. For index
example, for flagstat sambamba is 1.4x faster than samtools. For index
they are similar. For Markdup almost 6x faster and for view 4x
faster. For sort sambamba has been beaten, though sambamba is up to 2x
faster than samtools on large RAM machines (120GB+).
faster. For sort sambamba has been beaten, though sambamba is notably
up to 2x faster than samtools on large RAM machines (120GB+).
In addition sambamba has a few interesting features to offer, in particular
- faster large machine `sort`, see [performance](./test/benchmark/stats.org)
- fast large machine `sort`, see [performance](./test/benchmark/stats.org)
- automatic index creation when writing any coordinate-sorted file
- `view -L <bed file>` utilizes BAM index to skip unrelated chunks
- `depth` allows to measure base, sliding window, or region coverages
- [Chanjo](https://www.chanjo.co/) builds upon this and gets you to exon/gene levels of abstraction
- `markdup`, a fast implementation of Picard algorithm
- `slice` quickly extracts a region into a new file, tweaking only first/last chunks
- and more
- and more (you'll have to try)
Even though Sambamba started out as a samtools clone we are now in the
process of adding new functionality - also in the
[BioD project](https://github.com/biod/BioD). The D language is
extremely suitable for high performance computing. At this point we
think that the BAM format is here to stay for processing sequencing
extremely suitable for high performance computing (HPC). At this point
we think that the BAM format is here to stay for processing sequencing
data and we aim to make it easy to parse and process BAM files.
Sambamba is free and open source software, licensed under GPLv2+.
......@@ -88,39 +92,42 @@ For more information on Sambamba contact the mailing list (see [Getting help](#g
For those not in the mood to learn/install new package managers, there
are Github source and binary
[releases](https://github.com/biod/sambamba/releases). Simply download
the tarball, unpack it and run it. For example
the tarball, unpack it and run it according to the accompanying
release notes.
```bash
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.
```
Below package managers Conda, GNU Guix, Debian and Homebrew also
provide recent binary installs for Linux. For MacOS you may use Conda
or Homebrew.
## Bioconda install
[![Install with CONDA](https://anaconda.org/bioconda/sambamba/badges/installer/conda.svg)](https://anaconda.org/bioconda/sambamba)
Ther should be binary downloads for Linux and MacOS.
With Conda use the [`bioconda`](https://bioconda.github.io/) channel.
## GNU Guix install
A [GNU Guix package](https://www.gnu.org/software/guix/packages/s.html) for sambamba is available. The development version is packaged [here](https://gitlab.com/genenetwork/guix-bioinformatics/blob/master/gn/packages/sambamba.scm).
[![GuixBadge](https://img.shields.io/badge/gnuguix-sambamba--0.6.8-brightgreen.svg)](https://www.gnu.org/software/guix/packages/S/)
A reproducible [GNU Guix package](https://www.gnu.org/software/guix/packages/s.html) for sambamba is available. The development version is packaged [here](https://gitlab.com/genenetwork/guix-bioinformatics/blob/master/gn/packages/sambamba.scm).
## Debian GNU/Linux install
Debian: see [Debian packages](https://tracker.debian.org/pkg/sambamba).
[![DebianBadge](https://badges.debian.net/badges/debian/testing/sambamba/version.svg)](https://packages.debian.org/testing/sambamba)
See also Debian package [status](https://tracker.debian.org/pkg/sambamba).
## Homebrew install
Users of Homebrew can also use the formula from `homebrew-science`.
[![BrewBadge](https://img.shields.io/badge/%F0%9F%8D%BAbrew-sambamba-brightgreen.svg)](https://github.com/brewsci/homebrew-bio)
Users of Homebrew can also use the formula from [homebrew-bio](https://github.com/brewsci/homebrew-bio).
brew install brewsci/bio/sambamba
It should work for Linux and MacOS.
<a name="help"></a>
# Getting help
......@@ -284,7 +291,8 @@ command). A full stacktrace for all threads:
thread apply all backtrace full
```
Note that GDB should be made aware of D garbage collector:
Note that GDB should be made aware of D garbage collector which emits
SIGUSR signals and gdb needs to ignore them with
```
handle SIGUSR1 SIGUSR2 nostop noprint
......@@ -308,13 +316,14 @@ gdb -ex 'handle SIGUSR1 SIGUSR2 nostop noprint' \
<a name="license"></a>
# License
Sambamba is distributed under GNU Public License v2+.
Sambamba is generously distributed under GNU Public License v2+.
<a name="credits"></a>
# Credit
If you are using Sambamba in your research and want to support future
work on Sambamba, please cite the following publication:
Citations are the bread and butter of Science. If you are using
Sambamba in your research and want to support our 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](https://doi.org/10.1093/bioinformatics/btv098). Bioinformatics, 2015.
......
## ChangeLog v0.7.1 (20191128)
+ Fixed major segfault problem that got introduced after ldc 1.10, see https://github.com/biod/sambamba/issues/393
+ make error message more informative - see https://github.com/biod/sambamba/pull/411/files, thanks https://github.com/EwaMarek
## ChangeLog v0.7.0 (20190529)
+ Release avoids crashing problem by building with ldc-1.10.0, see https://github.com/biod/sambamba/issues/393
+ Merge pull request #396 from joelmartin/flagstat-return returning 0
## ChangeLog v0.6.9 (20190313)
+ Added support for Picard style sorting, see https://github.com/biod/sambamba/issues/369 - thanks https://github.com/TimurIs
+ Add a new sorting option to pull together mates when sorting by read name, see https://github.com/biod/sambamba/pull/380 - thanks https://github.com/emi80
+ Many module renames to build a BioD for the future - thanks https://github.com/george-githinji
## ChangeLog v0.6.8 (20181004)
Pre-release with a much faster statically compiled binary. 10-20%
......@@ -33,7 +49,7 @@ To install the image, download and
```sh
md5sum sambamba-0.6.8.gz
25efb5604ae5fe7c750e8020326787c5 sambamba-0.8.6.gz
ee61000bcb33a82013c284bac8feb91f sambamba-0.6.8.gz
gzip -d sambamba-0.6.8.gz
chmod a+x sambamba-0.6.8
......@@ -43,7 +59,7 @@ sambamba 0.6.8 by Artem Tarasov and Pjotr Prins (C) 2012-2018
LDC 1.10.0 / DMD v2.080.1 / LLVM6.0.1 / bootstrap LDC - the LLVM D compiler (0.17.4)
```
The binary images were reproducibly built on x86_64 with
The binary images were built on x86_64 with
```sh
~/.config/guix/current/bin/guix pull -l
......@@ -53,7 +69,6 @@ Generation 3 Sep 25 2018 09:39:08
branch: origin/master
commit: 932839ff124ff3b0dd3070914fb1c5beec69bf32
guix environment -C guix --ad-hoc gcc gdb bash ld-wrapper ldc which python git
make clean && make -j 16 && make check
......@@ -65,7 +80,7 @@ for x in `ldd bin/sambamba|cut -d ' ' -f 3` ; do realpath $x ; done
/gnu/store/bmaxmigwnlbdpls20px2ipq1fll36ncd-gcc-8.2.0-lib/lib/libgcc_s.so.1
/gnu/store/l4lr0f5cjd0nbsaaf8b5dmcw1a1yypr3-glibc-2.27/lib/libc-2.27.so
# build static image
make clean && make release -j 16 && make check
make clean && make static -j 16 && make check
```
Git submodule versions were
......
......@@ -8,8 +8,8 @@ import cram.exception;
import cram.wrappers;
import cram.slicereader;
import bio.bam.abstractreader, bio.bam.referenceinfo,
bio.sam.header, bio.bam.reference, bio.bam.read;
import bio.std.hts.bam.abstractreader, bio.std.hts.bam.referenceinfo,
bio.std.hts.sam.header, bio.std.hts.bam.reference, bio.std.hts.bam.read;
import std.string, std.array, std.range, std.algorithm, std.conv, std.typecons;
import std.parallelism;
......@@ -108,7 +108,7 @@ class CramReader : IBamSamReader {
return reads;
}
std.range.InputRange!(bio.bam.read.BamRead) allReads() @property {
std.range.InputRange!(bio.std.hts.bam.read.BamRead) allReads() @property {
return inputRangeObject(reads());
}
......
......@@ -3,9 +3,9 @@ module cram.reference;
import cram.exception, cram.wrappers, cram.slicereader;
import cram.htslib;
import bio.bam.abstractreader;
import bio.bam.referenceinfo;
import bio.bam.read;
import bio.std.hts.bam.abstractreader;
import bio.std.hts.bam.referenceinfo;
import bio.std.hts.bam.read;
import std.string;
import std.parallelism;
import std.range, std.algorithm;
......
module cram.slicereader;
import cram.htslib, cram.wrappers, cram.exception;
import bio.bam.abstractreader, bio.bam.read;
import bio.std.hts.bam.abstractreader, bio.std.hts.bam.read;
alias AllocateFunc = ubyte[] function(size_t);
......
module cram.writer;
import undead.stream;
import contrib.undead.stream;
import std.string;
import cram.htslib;
import cram.exception;
import bio.bam.read;
import bio.bam.referenceinfo;
import bio.sam.header;
import bio.std.hts.bam.read;
import bio.std.hts.bam.referenceinfo;
import bio.std.hts.sam.header;
extern(C) {
int fai_build(const(char)* fn);
......
sambamba (0.6.8-1) UNRELEASED; urgency=medium
sambamba (0.7.1-1) unstable; urgency=medium
[ Andreas Tille ]
* New upstream release
Closes: #907489
* Point Vcs fields to salsa.debian.org
......@@ -8,7 +9,25 @@ sambamba (0.6.8-1) UNRELEASED; urgency=medium
* Allow pre-releases in watch file
* Versioned Build-Depends: libbiod (>= 0.2.1)
-- Andreas Tille <tille@debian.org> Thu, 04 Oct 2018 10:06:08 +0200
[ Steffen Möller ]
* Update metadata with ref to conda
[ Matthias Klumpp ]
* New upstream version: 0.7.1
* Run tests and build with strong optimizations
* add-meson-build.patch: Update Meson build definition
- Closes: #907489
- We link against BioD stantically now
- Tests are integrated into Meson
- Allow switching on stronger optimizations used by the
upstream Makefile
* Depend on latest libbiod (>= 0.2.3)
* Don't depend on libundead
* Bump dh compat level to 12
* Bump standards version (No changes needed)
* Remove test artifacts in clean target
-- Matthias Klumpp <mak@debian.org> Sun, 15 Dec 2019 12:52:42 +0100
sambamba (0.6.7-2) unstable; urgency=medium
......
......@@ -3,18 +3,17 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.
Uploaders: Andreas Tille <tille@debian.org>
Section: science
Priority: optional
Build-Depends: debhelper (>= 11~),
Build-Depends: debhelper-compat (= 12),
dh-dlang,
libbiod-dev (>= 0.2.1),
libbiod-dev (>= 0.2.3),
libhts-dev,
liblz4-dev,
libundead-dev,
meson (>= 0.40),
meson (>= 0.48),
pkg-config,
python,
zlib1g-dev,
shunit2
Standards-Version: 4.2.1
shunit2,
zlib1g-dev
Standards-Version: 4.4.1
Vcs-Browser: https://salsa.debian.org/med-team/sambamba
Vcs-Git: https://salsa.debian.org/med-team/sambamba.git
Homepage: https://github.com/lomereiter/sambamba
......
......@@ -13,4 +13,3 @@ License: GPL-2+
License: GPL-2+
On Debian systems you can find the full text of the GNU General Public
License version 2 or later at /usr/share/common-licenses/GPL-2.
\ No newline at end of file
From 8a7812717d7810355786219a250671539b933e0f Mon Sep 17 00:00:00 2001
From 61437f3f44ced71436b366f1789fb5ee4e3cabeb Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Sun, 30 Apr 2017 17:41:14 +0200
Subject: [PATCH] Add Meson build file
Date: Sun, 15 Dec 2019 02:24:44 +0100
Subject: [PATCH] Add Meson build definition
---
meson.build | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 135 insertions(+)
.gitignore | 1 +
meson.build | 141 ++++++++++++++++++++++++++++++++++++++++++++++
meson_options.txt | 1 +
3 files changed, 143 insertions(+)
create mode 100644 meson.build
create mode 100644 meson_options.txt
diff --git a/.gitignore b/.gitignore
index 7062b3a..a6cbb18 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ shunit*
/*.cram
/*.crai
/*.txt
+!meson_options.txt
*.hex
*.zcat
*.out
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..3dd9cde
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,138 @@
+project('Sambamba', 'd')
+
+project_version = '0.6.6'
@@ -0,0 +1,141 @@
+project('Sambamba', 'd',
+ meson_version : '>=0.48',
+ license : 'GPL-2.0',
+ version : '0.7.1',
+ default_options : ['buildtype=debugoptimized']
+)
+
+source_root = meson.source_root()
+build_root = meson.build_root()
+
+# we need a C compiler for the static library search (for BioD) to work,
+# as the D compiler abstraction in Meson doesn't have find_library() capabilities yet
+add_languages('c')
+
+if meson.get_compiler('d').get_id() != 'llvm'
+ error('We only support the LLVm D compiler at time. Please compile with LDC.')
+ error('We only support the LLVM D compiler at time. Please compile with LDC.')
+endif
+extra_dflags = []
+if get_option('optimize_strong')
+ extra_dflags = ['-O3', '-release', '-enable-inlining', '-boundscheck=off']
+endif
+
+#
......@@ -30,14 +59,13 @@ Subject: [PATCH] Add Meson build file
+ 'sambamba/fixbins.d',
+ 'sambamba/flagstat.d',
+ 'sambamba/index.d',
+ 'sambamba/markdup.d',
+ 'sambamba/markdup2.d',
+ 'sambamba/markdup.d',
+ 'sambamba/merge.d',
+ 'sambamba/pileup.d',
+ 'sambamba/slice.d',
+ 'sambamba/sort.d',
+ 'sambamba/subsample.d',
+ 'sambamba/validate.d',
+ 'sambamba/utils/common/bed.d',
+ 'sambamba/utils/common/file.d',
+ 'sambamba/utils/common/filtering.d',
......@@ -51,7 +79,8 @@ Subject: [PATCH] Add Meson build file
+ 'sambamba/utils/common/tmpdir.d',
+ 'sambamba/utils/view/alignmentrangeprocessor.d',
+ 'sambamba/utils/view/headerserializer.d',
+ 'sambamba/view.d'
+ 'sambamba/validate.d',
+ 'sambamba/view.d',
+]
+
+utils_src = [
......@@ -90,12 +119,10 @@ Subject: [PATCH] Add Meson build file
+#
+# Dependencies
+#
+undead_dep = dependency('undead', version: '>=1.0.6')
+biod_dep = dependency('biod', version: '>=0.1.0')
+biod_dep = dependency('biod', version: '>=0.1.0', static: true)
+lz4_dep = dependency('liblz4')
+htslib_dep = dependency('htslib', version: '>=1.3.2')
+
+
+#
+# Configure
+#
......@@ -123,29 +150,30 @@ Subject: [PATCH] Add Meson build file
+ cram_src,
+ thirdparty_src,
+ version_info_d_fname],
+ dependencies: [undead_dep,
+ biod_dep,
+ dependencies: [biod_dep,
+ lz4_dep,
+ htslib_dep],
+ d_args: extra_dflags,
+ d_import_dirs: [include_directories('.')],
+ install: true
+)
+
+sambamba_test_exe = executable('sambamba_test',
+ [sambamba_src,
+ utils_src,
+ cram_src,
+ thirdparty_src],
+ dependencies: [undead_dep,
+ biod_dep,
+ lz4_dep,
+ htslib_dep],
+ d_args: meson.get_compiler('d').unittest_args(),
+ link_args: '-main'
+test_exe = find_program(join_paths(source_root, 'test', 'test_suite.sh'))
+test('sambamba_test',
+ test_exe,
+ env: ['sambamba=' + sambamba_exe.full_path()],
+ workdir: source_root
+)
+
+#
+# Install extra files
+#
+
+install_man(manpages)
+install_data(['etc/bash_completion.d/sambamba'], install_dir: '/usr/share/bash-completion/completions')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..607da9a
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('optimize_strong', type : 'boolean', value: false)
01_add_meson.patch
disable-assert.patch
01_add-meson-build.patch
02_disable-assert.patch
#!/usr/bin/make -f
# DH_VERBOSE := 1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dh-dlang/dlang-flags.mk
%:
dh $@ --buildsystem=meson
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
./run_tests.sh
endif
override_dh_auto_configure:
dh_auto_configure -- -Doptimize_strong=true
override_missing:
override_dh_missing:
dh_missing --fail-missing
override_dh_auto_clean:
dh_auto_clean
-rm -r $(CURDIR)/output/
......@@ -12,6 +12,9 @@ example, see this [[http://forum.dlang.org/thread/gvtjhpxdqpboppoodmxm@forum.dla
carefully, suggests we should use multiple implementations for file
access.
The current version for sambamba is much loved for markdup, depth and
slice options. It is logical to revisit these.
Here we document some of the choices we are making for the new
design. Starting with markdup2, the new version is a prototype for new
sambamba architecture using more canonical D language features,
......@@ -71,3 +74,9 @@ should use that.
Because of the pipes it is crucial sambamba gives clear error messages
and should be capable of writing to a log file.
* Markdup
The original markdup routine is written in sambamba/markdup.d. It
maintains state in a structure called IndexedBamRead with an index
value and the read object.