Skip to content

Commit

Permalink
Update for new nim
Browse files Browse the repository at this point in the history
  • Loading branch information
splichte authored and Ubuntu committed Feb 11, 2019
1 parent a362541 commit 6e79bb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Frameshift note: build with the latest nim (as of this writing, v0.19.4).
To build:
1) `nimble install -y`
2) `nim c -d:release mosdepth.nim`


fast BAM/CRAM depth calculation for **WGS**, **exome**, or **targeted sequencing**.
[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square)](http://bioconda.github.io/recipes/mosdepth/README.html)

Expand Down
6 changes: 3 additions & 3 deletions stats.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type
fragLengthHist: CountTableRef[int]
readLengthHist: CountTableRef[int]

proc countRead*(rs: var bamStats, rec: Record, chrom: string = nil) =
proc countRead*(rs: var bamStats, rec: Record, chrom: string = "") =
rs.totalReads += 1
if rec.flag.proper_pair:
rs.properPairs += 1
Expand All @@ -45,7 +45,7 @@ proc countRead*(rs: var bamStats, rec: Record, chrom: string = nil) =
if rec.flag.mate_unmapped: rs.singletons += 1
else: rs.bothMatesMapped += 1

if chrom != nil:
if chrom != "":
rs.refAlnHist.inc(chrom)
#if not rs.refAlnHist.hasKey(chrom):
# rs.refAlnHist[chrom] = 0
Expand Down Expand Up @@ -130,4 +130,4 @@ proc to_json*(rs: bamStats): string =
js["length_hist"].add($length, newJInt(count))

return js.pretty()


0 comments on commit 6e79bb8

Please sign in to comment.