INNER CODE UNIT · C
h
lh3/seqtk · seqtk.c:695
else h = stk_reg_read(argv[optind+1]);
if (h == 0) {
fprintf(stderr, "[E::%s] failed to read the list of regions in file '%s'\n", __func__, argv[optind+1]);
return 1;
}
// subseq
fp = strcmp(argv[optind], "-")? gzopen(argv[optind], "r") : gzdopen(fileno(stdin), "r");
if (fp == 0) {
fprintf(stderr, "[E::%s] failed to open the input file/stream\n", __func__);
return 1;
}
seq = kseq_init(fp);
while ((l = kseq_read(seq)) >= 0) {
reglist_t *p;
k = kh_get(reg, h, seq->name.s);
if (k == kh_end(h)) continue;
p = &kh_val(h, k);
for (i = 0; i < p->n; ++i) {