diff --git a/README.md b/README.md index 1114673..8b0f2be 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/stats.nim b/stats.nim index 1a13f23..2fd7f08 100644 --- a/stats.nim +++ b/stats.nim @@ -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 @@ -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 @@ -130,4 +130,4 @@ proc to_json*(rs: bamStats): string = js["length_hist"].add($length, newJInt(count)) return js.pretty() - \ No newline at end of file +