Skip to content

Commit 6826327

Browse files
committed
dont count supplementary alignments for overlap
and add working static build nim.cfg
1 parent 2ec57ea commit 6826327

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

mosdepth.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ proc coverage(bam: hts.Bam, arr: var coverage_t, region: var region_t, mapq:int=
258258
# rec: --------------
259259
# mate: ------------
260260
# handle overlapping mate pairs.
261-
if (not fast_mode) and rec.flag.proper_pair:
261+
if (not fast_mode) and rec.flag.proper_pair and (not rec.flag.supplementary):
262262
if rec.b.core.tid == rec.b.core.mtid and rec.stop > rec.matepos and
263263
# First case is partial overlap, second case is complete overlap
264264
# For complete overlap we must check if the mate was already seen or not yet
@@ -285,7 +285,7 @@ proc coverage(bam: hts.Bam, arr: var coverage_t, region: var region_t, mapq:int=
285285
# 4623241 4623264
286286
# chr1 4623171 69M1D23M9S (pos: 4623171, value: 1)(pos: 4623241, value: 1)(pos: 4623240, value: -1)(pos: 4623264, value: -1)
287287
# chr1 4623223 4S97M (pos: 4623223, value: 1)(pos: 4623320, value: -1)
288-
assert rec.start < mate.stop
288+
assert (rec.start <= mate.stop)
289289
# each element will have a .value of 1 for start and -1 for end.
290290

291291
var ses = sequtils.to_seq(gen_start_ends(rec.cigar, rec.start))

nim.cfg

+9-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1+
# in htslib: ./configure --with-libdeflate --disable-libcurl
2+
# nim c -a -d:static -d:release mosdepth.nim
13
@if static:
4+
passC:"-static"
5+
passl:"-static"
6+
27
passl:"/home/brentp/src/htslib/libhts.a"
38
passl:"/home/brentp/src/libdeflate/libdeflate.a"
4-
#passl:"/usr/local/lib/libdeflate.a"
5-
passl:"/usr/lib/x86_64-linux-gnu/libz.a"
69
passl:"/usr/lib/x86_64-linux-gnu/liblzma.a"
7-
#passl:"/usr/lib/x86_64-linux-gnu/libcurl.a"
8-
passl:"/usr/lib/x86_64-linux-gnu/libbz2.a"
9-
passl:"/usr/lib/x86_64-linux-gnu/libssl.a"
10-
passl:"/usr/lib/x86_64-linux-gnu/libcrypto.a"
11-
passl:"/usr/lib/x86_64-linux-gnu/libcrypt.a"
12-
passl:"-lhts"
13-
passl:"-ldeflate"
14-
passl:"-lz"
15-
#passl:"-lcrypto"
16-
#passl:"-lcrypt"
17-
passl:"-llzma"
18-
passl:"-lcurl"
10+
passl:"/usr/lib/x86_64-linux-gnu/libz.a"
1911
passl:"-lbz2"
12+
passl:"-llzma"
2013
passl:"-lpthread"
2114
dynlibOverride:"hts"
15+
dynlibOverride:"bz2"
16+
dynlibOverride:"pthread"
2217
@end

0 commit comments

Comments
 (0)