@@ -229,7 +229,7 @@ proc init(arr: var coverage_t, tlen:int) =
229229 arr.set_len (int (tlen))
230230 zeroMem (arr[0 ].addr , len (arr) * sizeof (arr[0 ]))
231231
232- proc coverage (bam: hts.Bam , arr: var coverage_t, region: var region_t, mapq:int = - 1 , eflag: uint16 = 1796 , iflag:uint16 = 0 , read_groups:seq [cstring ]= (@ []), fast_mode:bool = false ): int =
232+ proc coverage (bam: hts.Bam , arr: var coverage_t, region: var region_t, mapq:int = - 1 , eflag: uint16 = 1796 , iflag:uint16 = 0 , read_groups:seq [string ]= (@ []), fast_mode:bool = false ): int =
233233 # depth updates arr in-place and yields the tid for each chrom.
234234 # returns -1 if the chrom is not found in the bam header
235235 # returns -2 if the chrom was found in the header, but there was no data for it
@@ -258,7 +258,7 @@ proc coverage(bam: hts.Bam, arr: var coverage_t, region: var region_t, mapq:int=
258258 if iflag != 0 and ((rec.flag and iflag) == 0 ):
259259 continue
260260 if has_read_groups:
261- var t = tag [cstring ](rec, " RG" )
261+ var t = tag [string ](rec, " RG" )
262262 if t.isNone or not read_groups.contains (t.get):
263263 continue
264264 if tgt.tid != rec.b.core.tid:
@@ -551,7 +551,7 @@ proc main(bam: hts.Bam, chrom: region_t, mapq: int, eflag: uint16, iflag: uint16
551551 var
552552 targets = bam.hdr.targets
553553 sub_targets = get_targets (targets, chrom)
554- read_groups: seq [cstring ]
554+ read_groups: seq [string ]
555555 rchrom : region_t
556556 arr: coverage_t
557557 prefix: string = $ (args[" <prefix>" ])
@@ -582,7 +582,7 @@ proc main(bam: hts.Bam, chrom: region_t, mapq: int, eflag: uint16, iflag: uint16
582582
583583 if $ args[" --read-groups" ] != " nil" :
584584 for r in ($ args[" --read-groups" ]).split (',' ):
585- read_groups.add (r. cstring )
585+ read_groups.add ($ r )
586586 var levels = get_min_levels (targets)
587587
588588 var chrom_region_distribution, chrom_global_distribution: seq [int64 ]
@@ -775,7 +775,7 @@ when(isMainModule):
775775 when not defined (release) and not defined (lto):
776776 stderr.write_line " [mosdepth] WARNING: built in debug mode; will be slow"
777777
778- let version = " mosdepth 0.3.1 "
778+ let version = " mosdepth 0.3.2 "
779779 let env_fasta = getEnv (" REF_PATH" )
780780 var doc = format ("""
781781 $version
0 commit comments