Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: telatin/bamtocov
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.0
Choose a base ref
...
head repository: telatin/bamtocov
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 7,954 additions and 541 deletions.
  1. +33 −27 .github/workflows/build.yml
  2. +14 −0 .github/workflows/docker-image.yml
  3. +15 −2 .gitignore
  4. +58 −0 CITATION.cff
  5. +11 −0 CONTRIBUTING.md
  6. +59 −0 Makefile
  7. +41 −0 Makefile.old
  8. +17 −1 README.md
  9. +2 −2 bamtocov.nimble
  10. +19 −0 benchmark/Dockerfile
  11. +68 −0 benchmark/README.md
  12. +54 −0 benchmark/compare.sh
  13. +52 −0 benchmark/env.yaml
  14. +996 −0 benchmark/log.txt
  15. +3 −0 datasets/physical/target.bed
  16. +1 −0 datasets/ref/ref-250.fa.fai
  17. +1 −1 docs/1_install.md
  18. +1 −0 docs/2_overview.md
  19. +10 −5 docs/3_usage.md
  20. +22 −3 docs/5_history.md
  21. +1 −1 docs/notes/README.md
  22. +83 −0 docs/notes/longreads.md
  23. +61 −3 docs/notes/tests.md
  24. +7 −0 docs/scripts/README.md
  25. +43 −0 docs/scripts/average-coverage.md
  26. +55 −0 docs/scripts/feat-counts.md
  27. +60 −0 docs/scripts/low-cov-multisample.md
  28. +37 −0 docs/scripts/make-target-from-bam.md
  29. +59 −15 docs/tools/bamtocounts.md
  30. +21 −2 docs/tools/bamtocov.md
  31. +28 −0 input/artificial/Makefile
  32. +33 −0 input/artificial/README.md
  33. +3 −0 input/artificial/bamtocounts-2.4.0.tsv
  34. +4 −0 input/artificial/bamtocov-2.1.0.tsv
  35. +4 −0 input/artificial/bamtocov-2.4.0.tsv
  36. BIN input/artificial/chr1.png
  37. BIN input/artificial/chr2.png
  38. BIN input/artificial/chr3.png
  39. +24 −0 input/artificial/commands.md
  40. +3 −0 input/artificial/counts.tsv
  41. +5 −0 input/artificial/fc
  42. +15 −0 input/artificial/fc.summary
  43. +5 −0 input/artificial/featureCounts
  44. +15 −0 input/artificial/featureCounts.summary
  45. +19 −0 input/artificial/mos-target.mosdepth.global.dist.txt
  46. +19 −0 input/artificial/mos-target.mosdepth.region.dist.txt
  47. +9 −0 input/artificial/mos-target.mosdepth.summary.txt
  48. +9 −0 input/artificial/mos-target.per-base.bed
  49. BIN input/artificial/mos-target.per-base.bed.gz.csi
  50. +3 −0 input/artificial/mos-target.regions.bed
  51. BIN input/artificial/mos-target.regions.bed.gz.csi
  52. BIN input/artificial/reads.bam
  53. BIN input/artificial/reads.bam.bai
  54. +12 −0 input/artificial/reads.bed
  55. +6 −0 input/artificial/ref.fa
  56. +3 −0 input/artificial/ref.fa.fai
  57. +4 −0 input/artificial/target.bed
  58. +7 −0 input/artificial/target.gtf
  59. BIN input/mini-sorted.bam
  60. BIN input/mini-unsorted.bam
  61. BIN input/mini.bam.all.bw
  62. BIN input/mini.bam.bai
  63. +34 −0 input/mini.fa
  64. +3 −0 input/mini.fa.fai
  65. BIN input/mini2.bam.bai
  66. BIN input/mini3.bam.bai
  67. +6 −6 input/phi/annotation.gff
  68. +26 −0 input/phi/annotation.gtf
  69. +1 −0 input/phi/phi.fa.fai
  70. BIN input/phi/shotgun.bam.bai
  71. BIN input/phi/wildtype.bam.bai
  72. +3 −0 input/reg.bed
  73. +6 −0 input/regions.bed
  74. +9 −0 input/regions.gtf
  75. +6 −0 input/regions/check-regions.bed
  76. +20 −0 input/regions/per-base.bed
  77. +5 −0 input/someregions.bed
  78. +4 −0 input/sumtargets/fc
  79. +15 −0 input/sumtargets/fc.summary
  80. BIN input/sumtargets/reads.bam
  81. BIN input/sumtargets/reads.bam.bai
  82. +3 −0 input/sumtargets/reads.bed
  83. +2 −0 input/sumtargets/ref.fa
  84. +1 −0 input/sumtargets/ref.fa.fai
  85. +3 −0 input/sumtargets/target.bed
  86. +5 −0 input/sumtargets/target.gtf
  87. +28 −0 input/tiny/Makefile
  88. +38 −0 input/tiny/README.md
  89. +3 −0 input/tiny/bamtocounts-2.1.0.tsv
  90. +3 −0 input/tiny/bamtocounts-2.4.0.tsv
  91. +4 −0 input/tiny/bamtocov-DEV.tsv
  92. +4 −0 input/tiny/bamtocov2.1.0-target.tsv
  93. +4 −0 input/tiny/bamtocov2.4.0-target.tsv
  94. +5 −0 input/tiny/fc
  95. +15 −0 input/tiny/fc.summary
  96. BIN input/tiny/igv.png
  97. +16 −0 input/tiny/mos-target.mosdepth.global.dist.txt
  98. +16 −0 input/tiny/mos-target.mosdepth.region.dist.txt
  99. +5 −0 input/tiny/mos-target.mosdepth.summary.txt
  100. +35 −0 input/tiny/mos-target.per-base.bed
  101. BIN input/tiny/mos-target.per-base.bed.gz.csi
  102. +3 −0 input/tiny/mos-target.regions.bed
  103. BIN input/tiny/mos-target.regions.bed.gz.csi
  104. BIN input/tiny/reads.bam
  105. BIN input/tiny/reads.bam.bai
  106. +20 −0 input/tiny/reads.bed
  107. +24 −0 input/tiny/rebuild.sh
  108. +2 −0 input/tiny/ref.fa
  109. +1 −0 input/tiny/ref.fa.fai
  110. +3 −0 input/tiny/target.bed
  111. +5 −0 input/tiny/target.gtf
  112. +28 −0 input/tiny_2/Makefile
  113. +38 −0 input/tiny_2/README.md
  114. +3 −0 input/tiny_2/bamtocounts-2.1.0.tsv
  115. +3 −0 input/tiny_2/bamtocounts-2.4.0.tsv
  116. +5 −0 input/tiny_2/bamtocov-2.4.0.tsv
  117. +4 −0 input/tiny_2/bamtocov-DEV.tsv
  118. +4 −0 input/tiny_2/bamtocov2.1.0-target.tsv
  119. +4 −0 input/tiny_2/bamtocov2.4.0-target.tsv
  120. +6 −0 input/tiny_2/fc
  121. +15 −0 input/tiny_2/fc.summary
  122. BIN input/tiny_2/igv.png
  123. +16 −0 input/tiny_2/mos-target.mosdepth.global.dist.txt
  124. +16 −0 input/tiny_2/mos-target.mosdepth.region.dist.txt
  125. +5 −0 input/tiny_2/mos-target.mosdepth.summary.txt
  126. +30 −0 input/tiny_2/mos-target.per-base.bed
  127. BIN input/tiny_2/mos-target.per-base.bed.gz.csi
  128. +4 −0 input/tiny_2/mos-target.regions.bed
  129. BIN input/tiny_2/mos-target.regions.bed.gz.csi
  130. BIN input/tiny_2/reads.bam
  131. BIN input/tiny_2/reads.bam.bai
  132. +39 −0 input/tiny_2/reads.bed
  133. +24 −0 input/tiny_2/rebuild.sh
  134. +2 −0 input/tiny_2/ref.fa
  135. +1 −0 input/tiny_2/ref.fa.fai
  136. +4 −0 input/tiny_2/target.bed
  137. +6 −0 input/tiny_2/target.gtf
  138. BIN input/unsorted.bam
  139. +2 −0 nim.cfg
  140. +33 −6 scripts/average-coverage.py
  141. +184 −0 scripts/benchmarking/bam-stats.py
  142. +60 −0 scripts/benchmarking/bed-to-fasta.py
  143. +62 −0 scripts/benchmarking/bed-to-gtf.py
  144. +227 −0 scripts/benchmarking/make-bam-from-bed.py
  145. +233 −0 scripts/benchmarking/make-bam-targeted.py
  146. +1 −1 scripts/benchmarking/sim-shotgun.py
  147. +1 −1 scripts/benchmarking/simulate-long-bam.py
  148. +19 −0 scripts/comparecounts.py
  149. +137 −0 scripts/feat-counts.py
  150. +1 −1 scripts/gff2bed.py
  151. +70 −0 scripts/subproc/testr.py
  152. +218 −0 src/bamtarget.nim
  153. +203 −193 src/bamtocounts.nim
  154. +382 −0 src/bamtocounts_legacy.nim
  155. +179 −184 src/bamtocov.nim
  156. +141 −0 src/bamtoreads.nim
  157. +8 −24 src/covtotarget.nim
  158. +267 −18 src/covutils.nim
  159. +94 −0 src/gff2bed.nim
  160. +45 −33 tests/all.sh
  161. +27 −0 tests/batch.sh
  162. +27 −0 tests/benchmark.sh
  163. BIN tests/bin/bamcountrefs
  164. BIN tests/bin/bamtocounts
  165. BIN tests/bin/bamtocov
  166. BIN tests/bin/covtotarget
  167. +222 −0 tests/bin/shpec
  168. +31 −0 tests/exome-select/gtf-selection.py
  169. +48 −0 tests/features/Makefile
  170. +32 −0 tests/features/README.md
  171. +3 −0 tests/features/bamtocounts.tsv
  172. +3 −0 tests/features/bamtocounts_strict.tsv
  173. +10 −0 tests/features/compare.txt
  174. +5 −0 tests/features/fc
  175. +15 −0 tests/features/fc.summary
  176. +4 −0 tests/features/fc.tsv
  177. +2 −0 tests/features/ref.fa
  178. BIN tests/features/seqs.bam
  179. BIN tests/features/seqs.bam.bai
  180. +21 −0 tests/features/seqs.bed
  181. +4 −0 tests/features/speed.md
  182. +3 −0 tests/features/target.bed
  183. +5 −0 tests/features/target.gtf
  184. +90 −0 tests/mem-summary.py
  185. +12 −12 tests/results/mini_wig250_max.wig
  186. +138 −0 tests/shpec/bamtocov.sh
  187. +5 −0 tests/shpec/etc/example with spaces
  188. +3 −0 tests/shpec/etc/failing_example
  189. +12 −0 tests/shpec/etc/multi_assert_example
  190. +5 −0 tests/shpec/etc/multi_assert_fail_example
  191. +4 −0 tests/shpec/etc/old_example
  192. +5 −0 tests/shpec/etc/passing_example
  193. +3 −0 tests/shpec/etc/syntax_error
  194. +3 −0 tests/shpec/matchers/custom.sh
  195. +32 −0 tests/shpec/shell_compatibility_shpec.sh
  196. +275 −0 tests/shpec/shpec_shpec.txt
  197. +1,377 −0 tests/shunit2
  198. +37 −0 tests/target/check.sh
  199. +147 −0 tests/unit/bamtocov-base.sh
60 changes: 33 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# copied from Daniel Cook's Seq collection
name: "Build Bamtocov"

on:
- push
- pull_request
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:


jobs:
build:
@@ -40,7 +44,7 @@ jobs:
uses: actions/cache@v1
with:
path: $HOME/htslib
key: ${{ runner.os }}-htslib-1.10
key: ${{ runner.os }}-htslib-1.12

# Install Dependencies
- name: Install dependencies (Linux)
@@ -49,21 +53,17 @@ jobs:
sudo apt-get update
sudo apt-get -qy install bwa make build-essential cmake libncurses-dev ncurses-dev libbz2-dev lzma-dev liblzma-dev \
curl libssl-dev libtool autoconf automake libcurl4-openssl-dev
# Setup htslib
- name: Install htslib (linux)
if: runner.os == 'Linux'
run: |
cd
git clone --recursive https://github.com/samtools/htslib.git
cd htslib && git checkout 1.11 && autoheader && autoconf && ./configure --enable-libcurl
cd
sudo make -j 4 -C htslib install
sudo make -j 4 install
sudo ldconfig
#echo "::set-env name=LD_LIBRARY_PATH::${LD_LIBRARY_PATH}:${HOME}/htslib"
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/htslib" >> $GITHUB_ENV
ls -lh $HOME/htslib/*.so

#ls -lh $HOME/htslib/*.so
- name: Install hstlib (macos)
if: runner.os == 'macOS'
run: |
@@ -73,32 +73,38 @@ jobs:
with:
version: ${{ matrix.nimversion }}

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1


# Build and Test
- name: Build macOS executable
if: runner.os == 'macOS'
run: |
nimble build -y --verbose
ls -l bin/
bin/bamtocov --version
bash tests/all.sh
- name: Build Linux executable
bin/bamtocov input/mini.bam
bin/bamtocounts --version
bin/bamtocounts input/regions.bed input/mini.bam --debug --header
# TESTS
#bash tests/all.sh
- name: Build and Test Linux executable
if: runner.os == 'Linux'
run: |
nimble build -y --verbose
ls -l bin/
bin/bamtocov --version
bash tests/all.sh
- name: Upload Artifact
if: success()
uses: actions/upload-artifact@v1.0.0
with:
name: bamtocov_${{ matrix.os }}
path: bin/
bin/bamtocounts --version
bin/bamtocov input/mini.bam
bin/bamtocounts input/regions.bed input/mini.bam --debug --header
#bash tests/all.sh
tests/bin/shpec tests/shpec/bamtocov.sh
tests/unit/bamtocov-base.sh
bin/bamtocov --regions input/regions.bed -o report.txt input/mini.bam > /dev/null
cat report.txt
echo "WHERE: $HOME/htslib"
cat $HOME/htslib/version.h
14 changes: 14 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Docker Image CI

on: workflow_dispatch

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file benchmark/Dockerfile --tag bamtocovbenchmark:$(date +%s)
17 changes: 15 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
nimcache/
nimblecache/
htmldocs/
bin/*
*.bai
bin/bam*
./bin
profiling
multiqc/
.DS_Store
@@ -17,3 +17,16 @@ bamtocov_*
*.fa.pac
*.fa.sa
*sam
bamtocov-chrom*
_test
./shpec
shunit2/
.vscode
shpec/
_data/
bin/covtotarget
bin/gff2bed
trash
static/
hts_nim_static_builder
bin/*
58 changes: 58 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: >-
BamToCov, an efficient toolkit for sequence
coverage calculations
message: >-
Please cite this dataset using the metadata from
'preferred-citation'.
type: software
authors:
- given-names: Andrea
family-names: Telatin
email: andrea.telatin@quadram.ac.uk
affiliation: Quadram Institute Bioscience
orcid: 'https://orcid.org/0000-0001-7619-281X'
- given-names: Giovanni
family-names: Birolo
email: giovanni.birolo@unito.it
affiliation: University of Turin
identifiers:
- type: doi
value: 10.1101/2021.11.12.466787
description: >-
BamToCov: an efficient toolkit for sequence
coverage calculations
url: 'https://telatin.github.io/bamtocov/'
abstract: >
Motivation: Many genomics applications require the
computation of nucleotide coverage of a reference
genome or the ability to determine how many reads
map to a reference region.
Results: BamToCov is a toolkit for rapid and
flexible coverage computation that relies on a
memory efficient algorithm and is designed for
integration in pipelines; this is possible as a
result of reading alignment files from streams. The
tools in the suite can process sorted BAM or CRAM
files, allowing the user to extract coverage
information via different filtering approaches and
also save the output in different formats (BED, Wig
or counts).
The BamToCov algorithm can also handle
strand-specific and/or physical coverage analyses.
Availability: This program, accessory utilities,
and their documentation are freely available at
https://github.com/telatin/BamToCov.
keywords:
- bioinformatics
- sequence coverage
- next-generation sequencing
license: MIT
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Contributing to `bamtocov`

## Pull Requests
If you wish to fix a bug or add new features to the software we welcome **Pull Requests**.
We use [GitHub Flow style development](https://guides.github.com/introduction/flow/).

Please fork the repo, make the change, then submit a Pull Request against out master branch, with details about what the change is and what it fixes/adds.
We will then review your changes and merge them, or provide feedback on enhancements.

## Issues
If you find bugs, or if you would like to make suggestions or feature requests, feel free to open an [issue](https://github.com/telatin/bamtocov/issues).
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Create "make test"
.PHONY: testshpec testshunit2 test clean build

BIN=./bin
BIN2=./static
SOURCE=./src
LIBPATH=$(shell dirname $(shell which samtools) | sed 's/bin/lib/')
NIM_PATHS= --colors:on --noNimblePath --path:/local/giovanni/bamtocov/nimbledeps/pkgs/hts-0.3.17 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/docopt-0.6.8 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/regex-0.19.0 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/unicodedb-0.9.0 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/lapper-0.1.7
VERSION := $(shell grep version bamtocov.nimble | grep -o "[0-9]\\+\.[0-9]\.[0-9]\\+")
LIST=$(BIN)/bamtocov $(BIN)/bamtocounts $(BIN)/covtotarget $(BIN)/bamcountrefs $(BIN)/gff2bed $(BIN)/bamtocounts_legacy $(BIN)/bamtarget
STATIC=$(BIN2)/bamtocov $(BIN2)/bamtocounts $(BIN2)/covtotarget $(BIN2)/bamcountrefs $(BIN2)/gff2bed $(BIN2)/bamtocounts_legacy $(BIN2)/bamtarget


$(BIN)/%: $(SOURCE)/%.nim $(SOURCE)/covutils.nim bamtocov.nimble
nim c $(NIM_PATHS) -d:NimblePkgVersion=$(VERSION) -d:danger --opt:speed --out:$@ $<

all: $(LIST)

./hts_nim_static_builder:
wget "https://github.com/brentp/hts-nim/releases/download/v0.2.8/hts_nim_static_builder"
chmod +x hts_nim_static_builder

static: $(STATIC)


$(BIN2)/%: $(SOURCE)/%.nim bamtocov.nimble ./hts_nim_static_builder
mkdir -p $(BIN2)
echo target: $@
echo base: $(shell basename $@)
./hts_nim_static_builder -n bamtocov.nimble -s $< -- -d:NimblePkgVersion=$(VERSION)
mv ./$(shell basename $@) $(BIN2)

test: testshpec

testall: testbash testshpec testshunit2

testshpec:
@echo " --- Test shpec --- "
./tests/bin/shpec ./tests/shpec/bamtocov.sh

testshunit2:
@echo " --- Test shunit2 --- "
./tests/unit/bamtocov-base.sh

testbash:
@echo " --- Test (legacy) --- "
bash tests/all.sh


build:
nimble build


clean:
@echo "Cleaning..."
@for i in $(LIST); \
do \
if [ -e "$$i" ]; then rm -f $$i; echo "Removing $$i"; else echo "$$i Not found"; fi \
done
41 changes: 41 additions & 0 deletions Makefile.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Create "make test"
.PHONY: testshpec testshunit2 test clean build

BIN=./bin
SOURCE=./src
NIM_PATHS= --colors:on --noNimblePath --path:/local/giovanni/bamtocov/nimbledeps/pkgs/hts-0.3.17 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/docopt-0.6.8 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/regex-0.19.0 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/unicodedb-0.9.0 --path:/local/giovanni/bamtocov/nimbledeps/pkgs/lapper-0.1.7
VERSION := $(shell grep version bamtocov.nimble | grep -o "[0-9]\\+\.[0-9]\.[0-9]\\+")
LIST=$(BIN)/bamtocov $(BIN)/bamtoreads $(BIN)/bamtocounts $(BIN)/covtotarget $(BIN)/bamcountrefs $(BIN)/gff2bed $(BIN)/bamtocounts_legacy $(BIN)/bamtarget

$(BIN)/%: $(SOURCE)/%.nim $(SOURCE)/covutils.nim bamtocov.nimble
nim c $(NIM_PATHS) -d:NimblePkgVersion=$(VERSION) -d:release --opt:speed --out:$@ $<

all: $(LIST)


test: testshpec

testall: testbash testshpec testshunit2
testshpec:
@echo " --- Test shpec --- "
./tests/bin/shpec ./tests/shpec/bamtocov.sh

testshunit2:
@echo " --- Test shunit2 --- "
./tests/unit/bamtocov-base.sh

testbash:
@echo " --- Test (legacy) --- "
bash tests/all.sh


build:
nimble build


clean:
@echo "Cleaning..."
@for i in $(LIST); \
do \
if [ -e "$$i" ]; then rm -f $$i; echo "Removing $$i"; else echo "$$i Not found"; fi \
done
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
[![Build Bamtocov](https://github.com/telatin/bamtocov/actions/workflows/build.yml/badge.svg)](https://github.com/telatin/bamtocov/actions/workflows/build.yml)
[![Downloads](https://img.shields.io/conda/dn/bioconda/bamtocov)](https://anaconda.org/bioconda/bamtocov)
[![Platforms](https://anaconda.org/bioconda/bamtocov/badges/platforms.svg)](https://bioconda.github.io/recipes/bamtocov/README.html)
[![Paper](https://img.shields.io/badge/paper-bioinformatics-yellow)](https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btac125/6535233)

[![bamtocov logo](docs/bamtocov-banner.png)](https://telatin.github.io/bamtocov/)

@@ -24,9 +25,24 @@ The BamToCov package is available from :package: [BioConda](https://bioconda.git
conda install -y -c bioconda bamtocov
```

## References
## Benchmarks

Bamtocov has the smallest memory footprint of any other coverage tool, while maintaining reasonable speeds

* Four BAM files used for the benchmarks are [available from Zenodo](https://zenodo.org/record/5636944#.Yf_cMe7P36Y)
* A [Dockerfile](benchmark/) with an automatic speed test is available in this repository

## See also

* Brent Pedersen, Aaron Quinlan,
[hts-nim: scripting high-performance genomic analyses](https://academic.oup.com/bioinformatics/article/34/19/3387/4990493) (Bioinformatics)
* Giovanni Birolo, Andrea Telatin,
[covtobed: a simple and fast tool to extract coverage tracks from BAM files](https://joss.theoj.org/papers/10.21105/joss.02119) (JOSS)

Initially we also used [Lapper](https://brentp.github.io/nim-lapper/index.html),
and I recommend checking out this library for fast interval operations.

## Cite

Giovanni Birolo, Andrea Telatin,
[BamToCov: an efficient toolkit for sequence coverage calculations](https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btac125/6535233), Bioinformatics, 2022
4 changes: 2 additions & 2 deletions bamtocov.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "2.2.0"
version = "2.8.0"
author = "Andrea Telatin, Giovanni Birolo"
description = "BAM to Coverage"
license = "MIT"
@@ -10,7 +10,7 @@ license = "MIT"
requires "hts >= 0.3.1", "docopt >= 0.6.8", "nim >= 1.0.0", "lapper"
srcDir = "src"
binDir = "bin"
bin = @["covtotarget", "bamtocounts", "bamtocov", "bamcountrefs"]
bin = @["covtotarget", "bamtocounts", "bamtocov", "bamcountrefs", "gff2bed", "bamtarget"]
skipDirs = @["tests", "docs"]
skipFiles = @["example.bam"]

19 changes: 19 additions & 0 deletions benchmark/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM nfcore/base:1.9
LABEL authors="Andrea Telatin" \
description="Docker image containing all software requirements for the telatin/nextflow-example project"

# Install the conda environment
COPY benchmark/env.yaml /environment.yml
COPY benchmark/compare.sh /usr/local/bin/

RUN conda install -q -y -c conda-forge mamba && mamba env create -q -n env -f /environment.yml && conda clean -a

# Add conda installation dir to PATH (instead of doing 'conda activate')
ENV PATH /opt/conda/envs/env/bin:$PATH
# (alternative: replace the name with $(head -n 1 env.yaml | cut -f 2 -d " ") or similar

# Dump the details of the installed packages to a file for posterity
RUN conda env export --name env > workflow.yml

RUN compare.sh all
RUN cat *md
Loading