]> git.donarmstrong.com Git - samtools.git/blobdiff - sam.c
* samtools-0.1.4-10 (r341)
[samtools.git] / sam.c
diff --git a/sam.c b/sam.c
index 04be5c57745a8036dce8b2e3ede563f38aa8cdbb..5b02abbc94daad6f5eb7b19f596fba6d9dc54109 100644 (file)
--- a/sam.c
+++ b/sam.c
@@ -19,6 +19,7 @@ bam_header_t *bam_header_dup(const bam_header_t *h0)
                h->target_len[i] = h0->target_len[i];
                h->target_name[i] = strdup(h0->target_name[i]);
        }
+       if (h0->rg2lib) h->rg2lib = bam_strmap_dup(h0->rg2lib);
        return h;
 }
 
@@ -46,6 +47,7 @@ samfile_t *samopen(const char *fn, const char *mode, const void *aux)
                                        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);
                }
+               sam_header_parse_rg(fp->header);
        } else if (mode[0] == 'w') { // write
                fp->header = bam_header_dup((const bam_header_t*)aux);
                if (mode[1] == 'b') { // binary
@@ -118,7 +120,7 @@ int samwrite(samfile_t *fp, const bam1_t *b)
        }
 }
 
-int sampileup(samfile_t *fp, int mask, int min_mapQ, bam_pileup_f func, void *func_data)
+int sampileup(samfile_t *fp, int mask, bam_pileup_f func, void *func_data)
 {
        bam_plbuf_t *buf;
        int ret;
@@ -127,8 +129,7 @@ int sampileup(samfile_t *fp, int mask, int min_mapQ, bam_pileup_f func, void *fu
        buf = bam_plbuf_init(func, func_data);
        bam_plbuf_set_mask(buf, mask);
        while ((ret = samread(fp, b)) >= 0)
-               if (b->core.qual >= min_mapQ)
-                       bam_plbuf_push(b, buf);
+               bam_plbuf_push(b, buf);
        bam_plbuf_push(0, buf);
        bam_plbuf_destroy(buf);
        bam_destroy1(b);