Skip to content
Commits on Source (9)
# this YAML file can be used with drone tool (https://github.com/drone/drone)
# TODO remove dropbox dependency
# Usage: copy to .drone.yml, edit dropbox access token, run 'drone exec'
build:
image: lomereiter/centos-ldc:latest
commands:
- export LANG=C
- export PATH=/opt/llvm/bin:/usr/local/bin:$PATH
- /usr/bin/scl enable devtoolset-4 --
- yum install -y git
- llvm-config --version
- ldc2 --version
- gcc --version
- git submodule update --init
- git clone https://github.com/dlang/undeaD
- make sambamba-ldmd2-64
- curl -L "https://dl.dropboxusercontent.com/u/7916095/shunit2-2.0.3.tgz" | tar zx
- ./.run_tests.sh
- readelf -V build/sambamba | grep 'Name:' | grep GLIBC
- export ACCESS_TOKEN=# !!! PUT YOUR DROPBOX TOKEN HERE !!!
- ./.dropbox.sh build/sambamba
<!--
If you are reporting a bug, please provide:
* version of sambamba
* version of samtools if the issue is with pileup tool
* the command line or bash script used (feel free to shorten paths and filenames)
* whenever possible, a set of BAM/BED files to reproduce the issue
* bonus points if you try to minimize the test case yourself, as issues are often localized:
- try to use sambamba slice to first extract the reference where the error occurs
- if that succeeds (the error is still reproducible), continue to crop the file in binary-search fashion
* suggestions regarding privacy concerns for human data:
- try to minimize the test case (few variants => much harder to tell anything about the patient)
- write a script that changes the reference and/or applies a fixed shift to all record & record mate positions
- apply a random base permutation, e.g. A->C, C->T, T->A, G->G
You can also suggest a new feature, but please understand that neither of maintainers uses sambamba in daily jobs anymore.
As such, while it has some chances to get picked up by another person, if you possess any programming skills whatsoever, we encourage you to try your hand at it! (Feel free to ask us questions about the codebase or D quirks over email)
-->
build/
undeaD/
shunit*
/*.sam
/*.bam
......
......@@ -7,3 +7,6 @@
[submodule "lz4"]
path = lz4
url = https://github.com/Cyan4973/lz4
[submodule "undeaD"]
path = undeaD
url = https://github.com/dlang/undeaD
......@@ -17,14 +17,13 @@ before_install:
- export PATH=$(pwd)/${LDC_VERSION}/bin:${PATH}
- export LIBRARY_PATH=$(pwd)/${LDC_VERSION}/lib:${LIBRARY_PATH}
- git submodule update --init --recursive
- git clone https://github.com/dlang/undeaD.git
- wget https://github.com/craigcitro/r-travis/raw/master/scripts/dropbox.sh
- chmod +x dropbox.sh
- curl -L "https://dl.dropboxusercontent.com/u/7916095/shunit2-2.0.3.tgz" | tar zx
- curl -L https://www.dropbox.com/s/7mmiwmc1wm8cuos/shunit2-2.0.3.tgz?dl=1 | tar zx
script:
- make sambamba-ldmd2-64
- ./.run_tests.sh
- ./run_tests.sh
after_success:
- tar cjvf sambamba_osx.tar.bz2 ./build/sambamba
......
......@@ -20,7 +20,7 @@ endef
else
LINK_CMD=gcc -Wl,--gc-sections -o build/sambamba build/sambamba.o $(STATIC_LIB_SUBCMD) -l:libphobos2-ldc.a -l:libdruntime-ldc.a -lrt -lpthread -lm
LINK_CMD=gcc -Wl,--gc-sections -o build/sambamba build/sambamba.o $(STATIC_LIB_SUBCMD) -lphobos2-ldc -ldruntime-ldc -lrt -lpthread -lm -ldl
DMD_STATIC_LIBS=-L-Lhtslib -L-l:libhts.a -L-l:libphobos2.a -L-Llz4/lib -L-l:liblz4.a
define split-debug
......
# Docker makefile
#
# To build sambamba using a Docker image
#
# make -f Makefile.docker
#
# To run with the DMD compiler instead:
#
# make DRUN="dlanguage/dmd dmd" -f Makefile.docker
#
# run with
#
# ./build/sambamba
#
# Note: you'll need to set the correct LIB_PATHS for libz and libz4 your system
DRUN=dlanguage/ldc ldc2
# Mount the lib search paths on Docker for libz and libz4
LIBZ_LIB_PATH=/gnu/store/yd7bplsvf9nj72wn2z6n38rq9hfmjgd9-zlib-1.2.11/lib
LIBZ4_LIB_PATH=/gnu/store/2n80sdqh39y3sgrfyd97ag0sjx5bx9dl-lz4-1.8.0/lib
CWD=$(shell pwd)
D_COMPILER=docker run -v $(LIBZ_LIB_PATH):$(LIBZ_LIB_PATH) -v $(LIBZ4_LIB_PATH):$(LIBZ4_LIB_PATH) -v $(CWD):/src $(DRUN)
DFLAGS = -wi -I. -IBioD -IundeaD/src
LIBS = htslib/libhts.a -L-L$(LIBZ4_LIB_PATH) -L-L$(LIBZ_LIB_PATH) -L-L$(LDC_LIB_PATH) -L-L$(CWD)/lib -L-lrt -L-lpthread -L-lm -L-lz -L-llz4
SRC = $(wildcard main.d utils/*.d thirdparty/*.d cram/*.d) $(wildcard undeaD/src/undead/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d)
OBJ = $(SRC:.d=.o) utils/ldc_version_info_.o
OUT = build/sambamba
.PHONY: all
debug: DFLAGS += -O0 -g -d-debug -link-debuglib
all: debug
htslib-static:
cd htslib && $(MAKE)
ldc-version-info:
./gen_ldc_version_info.py $(shell which ldmd2) > utils/ldc_version_info_.d
utils/ldc_version_info_.o: ldc-version-info
$(D_COMPILER) $(DFLAGS) -c utils/ldc_version_info_.d -od=$(dir $@)
build-setup: htslib-static ldc-version-info
mkdir -p build/
guix guix-debug default debug release static profile: $(OUT)
# ---- Compile step
%.o: %.d
$(D_COMPILER) $(DFLAGS) -c $< -od=$(dir $@)
# ---- Link step
$(OUT): build-setup $(OBJ)
$(D_COMPILER) $(DFLAGS) -of=build/sambamba $(OBJ) $(LIBS)
test:
./run_tests.sh
check: test
debug-strip: debug
objcopy --only-keep-debug build/sambamba sambamba.debug
objcopy --strip-debug build/sambamba
objcopy --add-gnu-debuglink=sambamba.debug build/sambamba
mv sambamba.debug build/
clean-d:
rm -rf build/*
rm -f $(OBJ) $(OUT) trace.{def,log}
install:
install -m 0755 build/sambamba $(prefix)/bin
clean: clean-d
cd htslib ; make clean
......@@ -17,27 +17,32 @@ DLIBS = $(LDC_LIB_PATH)/libphobos2-ldc.a $(LDC_LIB_PATH)/libdruntime-ldc.a
DLIBS_DEBUG = $(LDC_LIB_PATH)/libphobos2-ldc-debug.a $(LDC_LIB_PATH)/libdruntime-ldc-debug.a
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
LIBS_STATIC = $(LDC_LIB_PATH)/libc.a $(DLIBS) htslib/libhts.a $(LDC_LIB_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) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d)
OBJ = $(SRC:.d=.o) utils/ldc_version_info_.o
OUT = build/sambamba
# The Guix targets resolve the RPATH automatically
guix: DFLAGS += -O -g -inline
guix: DFLAGS += -O -release -g # Guix strips debug flags
guix-debug: DFLAGS += -O0 -g -d-debug
# The development options are run from ~/.guix-profile and need to inject the RPATH
# 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
release: DFLAGS += -O -release -inline -noboundscheck $(RPATH)
release: DFLAGS += -O -release $(RPATH)
static: DFLAGS += -O -release -static -L-Bstatic
profile: DFLAGS += -g -O -profile $(RPATH)
guix release: LIBS += $(DLIBS)
static: LIBS = $(LIBS_STATIC)
guix-debug debug profile: LIBS += $(DLIBS_DEBUG)
.PHONY: all guix guix-debug debug release profile clean test
.PHONY: all guix guix-debug debug release static profile clean test
all: debug
......@@ -53,7 +58,7 @@ utils/ldc_version_info_.o: ldc-version-info
build-setup: htslib-static ldc-version-info
mkdir -p build/
guix guix-debug default debug release profile: $(OUT)
guix guix-debug default debug release static profile: $(OUT)
# ---- Compile step
%.o: %.d
......@@ -64,7 +69,9 @@ $(OUT): build-setup $(OBJ)
$(D_COMPILER) $(DFLAGS) -of=build/sambamba $(OBJ) $(LIBS)
test:
./.run_tests.sh
./run_tests.sh
check: test
debug-strip: debug
objcopy --only-keep-debug build/sambamba sambamba.debug
......
[![Anaconda-Server Badge](https://anaconda.org/bioconda/sambamba/badges/installer/conda.svg)](https://conda.anaconda.org/bioconda)
# 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)
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.13200.svg)](http://dx.doi.org/10.5281/zenodo.13200)
# Sambamba
## Table of Contents
- [Introduction](#intro)
- [Binary installation](#install)
- [Getting help](#help)
- [Compiling](#compile)
- [Debugging and troubleshooting](#debug)
- [License](#license)
- [Credits](#credits)
<a name="intro"></a>
# Introduction
Sambamba is a high performance modern robust and fast tool (and
library), written in the D programming language, for working with SAM
and BAM files. Current parallelised functionality is an important
and BAM files. Current functionality is an important
subset of samtools functionality, including view, index, sort,
markdup, and depth.
markdup, and depth. Most tools support piping: just specify `/dev/stdin`
or `/dev/stdout` as filenames.
Because of efficient use of modern multicore CPUs, usually `sambamba` is much faster
than `samtools`. For example, indexing a 2.5 Gb BAM file (fully cached into RAM)
on a 8 core machine utilizes all cores at 64% CPU:
For almost 5 years the main advantage over `samtools` was parallelized BAM reading.
Finally in March 2017 `samtools` 1.4 was released, reaching parity on this.
That said, we still have quite a few interesting features to offer:
time sambamba index merged_NIT20120138_F3_20130715.bam -t8
- faster `sort` (no benchmarks yet, sorry)
- 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
real 0m17.398s
user 1m25.841s
sys 0m3.752s
Sambamba is free and open source software, licensed under GPLv2+.
See manual pages [online](https://lomereiter.github.io/sambamba/docs/sambamba-view.html)
to know more about what is available and how to use it.
meanwhile samtools is *4x* slower:
For more information on Sambamba you can contact Artem Tarasov and Pjotr Prins.
time samtools index merged_NIT20120138_F3_20130715.bam
<a name="install"></a>
# Binary installation
## Install stable release
real 1m8.083s
user 1m6.640s
sys 0m1.448s
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
In practice, the speedup is usually smaller since I/O becomes a bottleneck.
Even so, it makes a big difference, shifting the focus to I/O optimization, i.e.
less temporary files, more UNIX pipes, faster disk storage, tweaking filesystem, etc.
Most tools in `sambamba` support piping: just specify `/dev/stdin` or `/dev/stdout` as filenames.
```sh
wget https://github.com/biod/sambamba/releases/download/v0.6.6/sambamba_v0.6.6_linux.tar.bz2
tar xvjf sambamba_v0.6.6_linux.tar.bz2
./sambamba_v0.6.6
Notice that `samtools` implements parallel BAM compression in `sort` and `merge`,
but `sambamba` should be faster for these tasks (given same amount of memory)
due to more cache-friendly approach to parallelization.
If it is not the case for you, please file a bug.
sambamba 0.6.6
Sambamba is free and open source software, licensed under GPLv2+.
See manual pages [online](https://lomereiter.github.io/sambamba/docs/sambamba-view.html)
to know more about what is available and how to use it.
Usage: sambamba [command] [args...]
For more information on Sambamba you can contact Artem Tarasov and Pjotr Prins.
Available commands: 'view', 'index', 'merge', 'sort',
'flagstat', 'slice', 'markdup', 'depth', 'mpileup'
To get help on a particular command, just call it without args.
```
## Install latest pre-release
A *latest* pre-release of sambamba 0.6.7 for Linux that includes debug
information and *all* dependencies is available from this
[link](http://test-gn2.genenetwork.org/ipfs/QmakasNfZhdbPA3xJYNxNX7at5FtYnS4hUNnvDbzxhZf2J). This
24Mb download reflects the development edition and includes recent
versions of libraries, samtools and bcftools. It should install on any
Linux distribution, including old ones on HPC clusters.
Install the tarball by unpacking it and running the contained install
script with a target directory e.g.
```sh
wget http://test-gn2.genenetwork.org/ipfs/QmakasNfZhdbPA3xJYNxNX7at5FtYnS4hUNnvDbzxhZf2J/hb13hjys1064jmb6z17yc1f822hv9zsz-sambamba-0.6.7-pre1-7cff065-x86_64.tar.bz2
tar xvjf QmakasNfZhdbPA3xJYNxNX7at5FtYnS4hUNnvDbzxhZf2J/hb13hjys1064jmb6z17yc1f822hv9zsz-sambamba-0.6.7-pre1-7cff065-x86_64.tar.bz2
./install.sh ~/sambamba-test
~/sambamba-test/bin/sambamba
# Binaries
sambamba 0.6.7-pre1
If you are already a Conda user, please use [`bioconda`](https://bioconda.github.io/) channel.
If you are not, strongly consider becoming one.
Usage: sambamba [command] [args...]
Available commands: 'view', 'index', 'merge', 'sort',
'flagstat', 'slice', 'markdup', 'depth', 'mpileup'
```
Binaries are also available through the following packaging tools (note the version numbers):
## Bioconda install
[![Install with CONDA](https://anaconda.org/bioconda/sambamba/badges/installer/conda.svg)](https://anaconda.org/bioconda/sambamba)
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).
## Debian GNU/Linux install
Debian: see Debian packages.
## Homebrew install
Users of Homebrew can also use the formula from `homebrew-science`.
For those not in the mood to learn/install new package managers, there are of course Github [releases](https://github.com/lomereiter/sambamba/releases).
<a name="help"></a>
# Getting help
Sambamba has a
[mailing list](https://groups.google.com/forum/#!forum/sambamba-discussion)
for installation help and general discussion.
## Reporting a sambamba bug or issue
Before posting an issue search the issue tracker and
[mailing list](https://groups.google.com/forum/#!forum/sambamba-discussion)
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 .log.txt file in the
output directory.
## Check list:
1. [X] I have found and issue with sambamba
2. [ ] I have searched for it on the [issue tracker](https://github.com/biod/sambamba/issues) (also check closed issues)
3. [ ] I have searched for it on the [mailing list](https://groups.google.com/forum/#!forum/sambamba-discussion)
4. [ ] I have tried the latest [release](https://github.com/biod/sambamba/releases) of sambamba
5. [ ] I have read and agreed to below code of conduct
6. [ ] If it is a support/install question I have posted it to the [mailing list](https://groups.google.com/forum/#!forum/sambamba-discussion)
7. [ ] If it is software development related I have posted a new issue on the [issue tracker](https://github.com/biod/sambamba/issues) or added to an existing one
8. [ ] In the message I have included the output of my sambamba run
9. [ ] In the message I have included the relevant .log.txt file in the output directory
10. [ ] 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.
## Code of conduct
By using sambamba and communicating with its communtity you implicitely
agree to abide by the
[code of conduct](https://software-carpentry.org/conduct/) as
published by the Software Carpentry initiative.
<a name="compile"></a>
# Compiling Sambamba
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.
## Compilation dependencies
- zlib
- htslib (submodule)
- lz4 (submodule)
- BioD (submodule)
- undeaD (submodule)
- python2
## Compiling for Linux
The LDC compiler's github repository also provides binary images. The current
......@@ -64,16 +182,18 @@ preferred release for sambamba is LDC - the LLVM D compiler (>= 1.1.0). After
installing LDC:
```sh
git clone --recursive https://github.com/lomereiter/sambamba.git
git clone --recursive https://github.com/biod/sambamba.git
cd sambamba
git clone https://github.com/dlang/undeaD
make sambamba-ldmd2-64
```
Installing LDC only means unpacking an archive and setting some environmental variables, e.g. unpacking into `$HOME`:
Installing LDC only means unpacking an archive and setting some
environmental variables, e.g. unpacking into `$HOME`:
```sh
cd
wget https://github.com/ldc-developers/ldc/releases/download/$ver/ldc2-$ver-linux-x86_64.tar.xz
wget https://github.com/ldc-developers/ldc/releases/download/v$ver/ldc2-$ver-linux-x86_64.tar.xz
tar xJf ldc2-$ver-linux-x86_64.tar.xz
export PATH=~/ldc2-$ver-linux-x86_64/bin/:$PATH
export LIBRARY_PATH=~/ldc2-$ver-linux-x86_64/lib/
......@@ -81,48 +201,71 @@ export LIBRARY_PATH=~/ldc2-$ver-linux-x86_64/lib/
### GNU Guix
A GNU Guix package for LDC is also available
To build sambamba the LDC compiler is also available in GNU Guix:
```sh
guix package -i ldc
```
## Compiling for Mac OS X
```sh
brew install ldc
git clone --recursive https://github.com/lomereiter/sambamba.git
git clone --recursive https://github.com/biod/sambamba.git
cd sambamba
git clone https://github.com/dlang/undeaD
make sambamba-ldmd2-64
```
# Troubleshooting
## Development
In case of crashes it's helpful to have GDB stacktraces (`bt` command). A full stacktrace
for all threads:
Sambamba development and issue tracker is on
[github](https://github.com/biod/sambamba). Developer
documentation can be found in the source code and the [development
documentation](https://github.com/biod/sambamba-dev-docs).
<a name="debug"></a>
# Debugging and troubleshooting
## Dump core
In a crash sambamba can dump a core. To make this happen set
```sh
ulimit -c unlimited
```
thread apply all backtrace full
and run your command. Send us the core file so we can reproduce the state at
time of segfault.
## Use catchsegv
Another option is to use catchsegv
```sh
catchsegv ./build/sambamba command
```
Note that GDB should be made aware of D garbage collector:
this will show state on stdout which can be sent to us.
## Using gdb
In case of crashes it's helpful to have GDB stacktraces (`bt`
command). A full stacktrace for all threads:
```
handle SIGUSR1 SIGUSR2 nostop noprint
thread apply all backtrace full
```
A binary relocatable install of sambamba with debug information can be fetched from
Note that GDB should be made aware of D garbage collector:
```sh
wget http://biogems.info/contrib/genenetwork/s7l4l5jnrwvvyr3pva242yakvmbfpm06-sambamba-0.6.6-pre3-6ae174b-debug-x86_64.tar.bz2
md5sum ca64fd6f2fa2ba901937afc6b189e98d
mkdir tmp
tar xvjf ../*sambamba*.tar.bz2
cd tmp
```
handle SIGUSR1 SIGUSR2 nostop noprint
```
unpack the tarball and run the contained install.sh script with TARGET
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
......@@ -134,19 +277,29 @@ Run sambamba in gdb with
gdb --args ~/sambamba-test/sambamba-*/bin/sambamba view --throw-error
```
# Development
<a name="license"></a>
# License
Sambamba development and issue tracker is on
[github](https://github.com/lomereiter/sambamba). Developer
documentation can be found in the source code and the [development
documentation](https://github.com/lomereiter/sambamba-dev-docs).
Sambamba is distributed under GNU Public License v2+.
# Copyright
<a name="credits"></a>
# Credit
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:
# Citation
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.
If you are using Sambamba in your research, please cite the following article:
```bibtex
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}
```
......@@ -23,7 +23,7 @@ test:
- sambamba view
about:
home: https://github.com/lomereiter/sambamba
home: https://github.com/biod/sambamba
license: GPLv2
summary: Tools for working with SAM/BAM data"""
......@@ -31,7 +31,7 @@ import json
from urllib2 import urlopen
from hashlib import md5
latest_release = json.loads(urlopen("https://api.github.com/repos/lomereiter/sambamba/releases").read())[0]
latest_release = json.loads(urlopen("https://api.github.com/repos/biod/sambamba/releases").read())[0]
sambamba_version = latest_release['tag_name'][1:]
downloads = {}
......
sambamba (0.6.6-2) UNRELEASED; urgency=medium
sambamba (0.6.7-1) unstable; urgency=medium
[ Steffen Moeller ]
* debian/upstream/metadata:
- yamllint cleanliness
- added references to registries
-- Steffen Moeller <moeller@debian.org> Mon, 25 Sep 2017 15:03:49 +0200
[ Andreas Tille ]
* New upstream version
* Use dh-dlang
* Standards-Version: 4.1.3
* debhelper 11
* enable hardening options
* move bash_completion scripts to new location
-- Andreas Tille <tille@debian.org> Tue, 20 Mar 2018 10:53:49 +0100
sambamba (0.6.6-1) unstable; urgency=medium
......
Source: sambamba
Section: science
Priority: optional
Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Uploaders: Andreas Tille <tille@debian.org>
Build-Depends: debhelper (>= 10.4),
ldc,
libbiod-dev (>= 0.1.0-4),
Section: science
Priority: optional
Build-Depends: debhelper (>= 11~),
dh-dlang,
libbiod-dev (>= 0.1.0-5),
libhts-dev,
liblz4-dev,
libundead-dev (>= 1.0.7-1),
libundead-dev (>= 1.0.9-2),
meson (>= 0.40),
pkg-config,
python,
zlib1g-dev
Standards-Version: 4.0.0
Standards-Version: 4.1.3
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/sambamba.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/sambamba.git
Homepage: https://github.com/lomereiter/sambamba
......
......@@ -8,9 +8,6 @@ Subject: [PATCH] Add Meson build file
1 file changed, 135 insertions(+)
create mode 100644 meson.build
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..e7c31d9
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,135 @@
......@@ -148,4 +145,4 @@ index 0000000..e7c31d9
+#
+
+install_man(manpages)
+install_data(['etc/bash_completion.d/sambamba'], install_dir: '/etc/bash_completion.d/')
+install_data(['etc/bash_completion.d/sambamba'], install_dir: '/usr/share/bash-completion/completions')
#!/usr/bin/make -f
# DH_VERBOSE := 1
# for hardening you might like to uncomment this:
# export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DFLAGS=-O3 -g -release
include /usr/share/dh-dlang/dlang-flags.mk
# we can not build with NEON on armhf, the Debian builders
# don't support it.
......
#!/usr/bin/env python
#!/usr/bin/env python2
from __future__ import print_function
import re, sys, subprocess
if len(sys.argv) < 2:
print("Usage: {} <path to ldmd2 executable>".format(sys.argv[0]))
print("Usage: {0} <path to ldmd2 executable>".format(sys.argv[0]))
sys.exit(1)
ldc = sys.argv[1].replace("ldmd2", "ldc2")
ldc_output = subprocess.check_output([ldc, "-version"])
ldc_output = subprocess.Popen([ldc, '-version'], stdout=subprocess.PIPE).communicate()[0]
version_re = r"""^.+\((?P<LDC>[^\)]+)\):\n\s*based on DMD (?P<DMD>\S+) and LLVM (?P<LLVM>\S+)\n(?:\s*built with (?P<BOOTSTRAP>.*)\n)?"""
match = re.match(version_re, ldc_output, re.MULTILINE)
......@@ -19,4 +19,4 @@ print("module utils.ldc_version_info_;")
for component, version in match.groupdict().items():
if version is None:
version = "version not available"
print("immutable {}_VERSION_STRING = \"{}\";".format(component, version))
print("immutable {0}_VERSION_STRING = \"{1}\";".format(component, version))
......@@ -3,4 +3,4 @@
# download shunit2 in order to run tests:
# curl -L "https://dl.dropboxusercontent.com/u/7916095/shunit2-2.0.3.tgz" | tar zx --overwrite
./.test_suite.sh | tee /dev/stderr | grep -q 'success rate: 100%'
./test_suite.sh | tee /dev/stderr | grep -q 'success rate: 100%'
......@@ -1150,9 +1150,7 @@ int depth_main(string[] args) {
if (query !is null) {
read_filter = createFilterFromQuery(query);
} else {
read_filter = createFilterFromQuery("mapping_quality > 0 and "
"not duplicate and "
"not failed_quality_control");
read_filter = createFilterFromQuery("mapping_quality > 0 and not duplicate and not failed_quality_control");
}
auto bam_filenames = args[1 .. $];
......
/*
This file is part of Sambamba.
Copyright (C) 2012-2016 Artem Tarasov <lomereiter@gmail.com>
Copyright (C) 2012-2017 Artem Tarasov <lomereiter@gmail.com>
Sambamba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -34,7 +34,7 @@ import bio.bam.reader, bio.bam.readrange, bio.bam.writer, bio.bam.referenceinfo,
bio.bam.multireader;
import std.traits, std.typecons, std.range, std.algorithm, std.parallelism,
std.exception, std.file, std.typetuple, std.conv, std.array, std.bitmanip,
std.c.stdlib, std.datetime, undead.stream : BufferedFile, FileMode;
core.stdc.stdlib, std.datetime, undead.stream : BufferedFile, FileMode;
/// Read + its index (0-based)
struct IndexedBamRead {
......@@ -81,14 +81,14 @@ class MallocArray(T) {
/// call manually!
void free() {
std.c.stdlib.free(_p);
core.stdc.stdlib.free(_p);
_p = null;
}
this(size_t initial_size=16, float grow_factor=1.5) {
enforce(initial_size >= 16);
enforce(grow_factor >= 1.2);
_p = cast(T*)std.c.stdlib.malloc(initial_size * T.sizeof);
_p = cast(T*)core.stdc.stdlib.malloc(initial_size * T.sizeof);
_sz = initial_size;
_gf = grow_factor;
}
......@@ -112,7 +112,7 @@ class MallocArray(T) {
} else {
assert(_cur == _sz);
_sz = cast(size_t)(_sz * _gf);
_p = cast(T*)std.c.stdlib.realloc(_p, _sz * T.sizeof);
_p = cast(T*)core.stdc.stdlib.realloc(_p, _sz * T.sizeof);
_p[_cur++] = element;
}
}
......@@ -576,15 +576,13 @@ struct SingleEndBasicInfo {
}
static assert(SingleEndBasicInfo.sizeof == 8);
// 24 bytes :-(
struct SingleEndInfo {
SingleEndBasicInfo basic_info;
alias basic_info this;
ulong idx;
ushort score;
uint score;
}
// 32 bytes
struct PairedEndsInfo {
mixin(bitfields!(short, "library_id", 16,
ushort, "ref_id1", 14,
......@@ -594,7 +592,7 @@ struct PairedEndsInfo {
int coord2;
ushort ref_id2;
ushort score; // sum of base qualities that are >= 15
uint score; // sum of base qualities that are >= 15
ulong idx1, idx2;
SingleEndBasicInfo read1_basic_info() @property {
......@@ -608,7 +606,7 @@ struct PairedEndsInfo {
}
}
static assert(PairedEndsInfo.sizeof == 32);
static assert(PairedEndsInfo.sizeof == 40);
bool singleEndInfoComparator(S1, S2)(auto ref S1 s1, auto ref S2 s2) {
if (s1.library_id < s2.library_id) return true;
......@@ -705,8 +703,8 @@ int computeFivePrimeCoord(R)(auto ref R read) {
}
}
ushort computeScore(R)(auto ref R read) {
return reduce!"a + b"(0, read.base_qualities.filter!"a >= 15").to!ushort;
uint computeScore(R)(auto ref R read) {
return reduce!"a + b"(0, read.base_qualities.filter!"a >= 15").to!uint;
}
auto collectSingleEndInfo(IndexedBamRead read, ReadGroupIndex read_group_index) {
......@@ -744,7 +742,7 @@ PairedEndsInfo combine(ref SingleEndInfo s1, ref SingleEndInfo s2) {
result.reversed2 = s2.reversed;
result.coord1 = s1.coord;
result.coord2 = s2.coord;
result.score = cast(ushort)(s1.score + s2.score);
result.score = cast(uint)(s1.score + s2.score);
result.idx1 = s1.idx;
result.idx2 = s2.idx;
return result;
......@@ -1263,7 +1261,7 @@ int markdup_main(string[] args) {
// marking or removing duplicates
bam = new MultiBamReader(args[1 .. $-1]);
bam.setBufferSize(io_buffer_size);
bam.setBufferSize(io_buffer_size / (args.length - 2));
auto out_stream = new BufferedFile(args[$-1], FileMode.OutNew, io_buffer_size);
auto writer = new BamWriter(out_stream, compression_level);
writer.setFilename(args[$-1]);
......
......@@ -747,6 +747,4 @@ int pileup_main(string[] args) {
return 1;
}
}
return 0;
}