Skip to content

Commit

Permalink
small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Apr 17, 2024
1 parent 5ec8fee commit 9525595
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mosdepth.nim
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ proc write_distribution(chrom: string, d: var seq[int64], fh:File) =
if irev > 300 and v == 0: continue
cum += float64(v) / float64(sum)
if cum < 8e-5: continue
fh.write_line(chrom, "\t", $irev & "\t" & su.format_float(cum, ffDecimal, precision=precision))
fh.write_line(chrom, "\t", irev, "\t", su.format_float(cum, ffDecimal, precision=precision))
# reverse it back because we use to update the full genome
reverse(d)

Expand Down Expand Up @@ -586,8 +586,8 @@ proc main(bam: hts.Bam, chrom: region_t, mapq: int, min_len: int, max_len: int,
global_region_stat.clear()
global_stat.clear()

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

if $args["--read-groups"] != "nil":
for r in ($args["--read-groups"]).split(','):
Expand Down

0 comments on commit 9525595

Please sign in to comment.