Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mosdepth.nim
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,14 @@ iterator regions(bam: hts.Bam, region: region_t, tid: int, targets: seq[
if tid != -1:
if stop == 0:
stop = targets[tid].length
for r in bam.query(tid, int(region.start), int(stop)):
yield r
Comment thread
brentp marked this conversation as resolved.
try:
for r in bam.query(tid, int(region.start), int(stop)):
yield r
# if the iterator fails due to an invalid read from the BAM (due to file
# corruption or filesystem issues), we want to gracefully exit with a
# nonzero return.
except hts.BamError:
quit getCurrentExceptionMsg()
else:
stderr.write_line("[mosdepth]", region.chrom, " not found")

Expand Down
2 changes: 1 addition & 1 deletion mosdepth.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"

# Dependencies

requires "hts >= 0.3.29", "docopt == 0.7.1", "nim >= 1.0.0", "https://github.com/brentp/d4-nim >= 0.0.5"
requires "hts >= 0.3.31", "docopt == 0.7.1", "nim >= 1.0.0", "https://github.com/brentp/d4-nim >= 0.0.5"

bin = @["mosdepth"]
skipDirs = @["tests"]
Expand Down
Loading