]> git.donarmstrong.com Git - samtools.git/blobdiff - sam.c
fixed minor things in Makefile
[samtools.git] / sam.c
diff --git a/sam.c b/sam.c
index 8411d81f0af8b19e04cc1ffc77e1f741efd6987b..9a6e201d75e24d366903ff4e937f80d71e45303c 100644 (file)
--- a/sam.c
+++ b/sam.c
@@ -43,7 +43,7 @@ samfile_t *samopen(const char *fn, const char *mode, const void *aux)
                                        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
@@ -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);