Created
August 24, 2018 08:08
-
-
Save andreas-wilm/eab90600574657c610be835ff3e4fce2 to your computer and use it in GitHub Desktop.
hts-nim bgzip read example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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