Skip to content

Instantly share code, notes, and snippets.

@andreas-wilm
Created August 24, 2018 08:08
Show Gist options
  • Save andreas-wilm/eab90600574657c610be835ff3e4fce2 to your computer and use it in GitHub Desktop.
Save andreas-wilm/eab90600574657c610be835ff3e4fce2 to your computer and use it in GitHub Desktop.
hts-nim bgzip read example
import hts
var b: BGZ
open(b, "example.txt.gz", mode="rb")
set_threads(b, 2)
var kstr: kstring_t
kstr.l = 0
kstr.m = 0
kstr.s = nil
var p = kstr.addr
while true:
if b.read_line(p) <= 0:
break
echo tell(b), " : ", $kstr.s
discard close(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment