fp->header = sam_header_read2((const char*)aux);
}
if (fp->header->n_targets == 0)
- fprintf(stderr, "[samopen] empty header.\n");
+ fprintf(stderr, "[samopen] no @SQ lines in the header.\n");
} else fprintf(stderr, "[samopen] SAM header is present: %d sequences.\n", fp->header->n_targets);
}
} else if (mode[0] == 'w') { // write
}
}
-int sampileup(samfile_t *fp, int mask, bam_pileup_f func, void *func_data)
+int sampileup(samfile_t *fp, int mask, int min_mapQ, bam_pileup_f func, void *func_data)
{
bam_plbuf_t *buf;
int ret;
buf = bam_plbuf_init(func, func_data);
bam_plbuf_set_mask(buf, mask);
while ((ret = samread(fp, b)) >= 0)
- bam_plbuf_push(b, buf);
+ if (b->core.qual >= min_mapQ)
+ bam_plbuf_push(b, buf);
bam_plbuf_push(0, buf);
bam_plbuf_destroy(buf);
bam_destroy1(b);