]> git.donarmstrong.com Git - samtools.git/blobdiff - sam.c
* samtools-0.1.4-3 (r324)
[samtools.git] / sam.c
diff --git a/sam.c b/sam.c
index 48a4b34ef10ee92280d5843a3ccd81593cd34540..9a6e201d75e24d366903ff4e937f80d71e45303c 100644 (file)
--- a/sam.c
+++ b/sam.c
@@ -116,7 +116,7 @@ int samwrite(samfile_t *fp, const bam1_t *b)
        }
 }
 
-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;
@@ -125,7 +125,8 @@ int sampileup(samfile_t *fp, int mask, bam_pileup_f func, void *func_data)
        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);