Skip to content

Commit

Permalink
fix but on summary stats with regions
Browse files Browse the repository at this point in the history
closes #207
  • Loading branch information
brentp committed Sep 15, 2023
1 parent 1d9b913 commit 1bfeaa2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
tests/all
tests/funcs
nimcache
*.d4
*.bam
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.3.5
======
+ fix bug with summary min for regions (#207 thanks to Xavier for supplying test-case)

v0.3.4
======
+ bump version for build supporting gs:// urls
Expand Down
8 changes: 7 additions & 1 deletion mosdepth.nim
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,12 @@ proc main(bam: hts.Bam, chrom: region_t, mapq: int, eflag: uint16, iflag: uint16
var fd4:D4
var fbase: BGZI

# use clear to set min depth to uint32.high
chrom_region_stat.clear()
chrom_stat.clear()
global_region_stat.clear()
global_stat.clear()

var region_distribution = new_seq[int64](1000)
var global_distribution = new_seq[int64](1000)

Expand Down Expand Up @@ -775,7 +781,7 @@ when(isMainModule):
when not defined(release) and not defined(lto):
stderr.write_line "[mosdepth] WARNING: built in debug mode; will be slow"

let version = "mosdepth 0.3.4"
let version = "mosdepth 0.3.5"
let env_fasta = getEnv("REF_PATH")
var doc = format("""
$version
Expand Down
2 changes: 1 addition & 1 deletion mosdepth.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.3.4"
version = "0.3.5"
author = "Brent Pedersen"
description = "fast depth"
license = "MIT"
Expand Down
13 changes: 13 additions & 0 deletions tests/funcs.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import unittest
import mosdepth
import depthstat
import os

suite "mosdepth-suite":

test "depthstat min":
var d = newSeq[int32]()
var t = newDepthStat(d)
check t.min_depth > 0

var dd: depth_stat
# "not that this always starts as 0 so we must set clear to increase it"
check dd.min_depth == 0
dd.clear()
check dd.min_depth > 0

test "test-quantize-args":

var rs = get_quantize_args(":1")
Expand Down

0 comments on commit 1bfeaa2

Please sign in to comment.