]> git.donarmstrong.com Git - samtools.git/commitdiff
* output max mapping quality in indel line
authorHeng Li <lh3@live.co.uk>
Thu, 12 Feb 2009 10:30:29 +0000 (10:30 +0000)
committerHeng Li <lh3@live.co.uk>
Thu, 12 Feb 2009 10:30:29 +0000 (10:30 +0000)
bam_plcmd.c
bamtk.c

index 58e2be15384e010164274cce1ce8f15a5edbb4c3..2803659aba760952d3cee687601684184390bf0e 100644 (file)
@@ -109,7 +109,7 @@ static int pileup_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *p
 {
        pu_data_t *d = (pu_data_t*)data;
        bam_maqindel_ret_t *r = 0;
-       int i, j, rb;
+       int i, j, rb, max_mapq = 0;
        uint32_t x;
        if (d->hash && kh_get(64, d->hash, (uint64_t)tid<<32|pos) == kh_end(d->hash)) return 0;
        if (d->format & BAM_PLF_GLF) return glt_func(tid, pos, n, pu, data);
@@ -143,6 +143,7 @@ static int pileup_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *p
        printf("%d\t", n);
        for (i = 0; i < n; ++i) {
                const bam_pileup1_t *p = pu + i;
+               if (max_mapq < p->b->core.qual) max_mapq = p->b->core.qual;
                if (p->is_head) printf("^%c", p->b->core.qual > 93? 126 : p->b->core.qual + 33);
                if (!p->is_del) {
                        int c = bam_nt16_rev_table[bam1_seqi(bam1_seq(p->b), p->qpos)];
@@ -186,6 +187,7 @@ static int pileup_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *p
                if (r->gt < 2) printf("%s/%s\t", r->s[r->gt], r->s[r->gt]);
                else printf("%s/%s\t", r->s[0], r->s[1]);
                printf("%d\t%d\t", r->q_cns, r->q_ref);
+               printf("%d\t%d\t", max_mapq, n);
                printf("%s\t%s\t", r->s[0], r->s[1]);
                //printf("%d\t%d\t", r->gl[0], r->gl[1]);
                printf("%d\t%d\t%d\t%d\n", r->cnt1, r->cnt2, r->cnt_ambi, r->cnt_anti);
diff --git a/bamtk.c b/bamtk.c
index 9b75ed61b61d12d7c4993c8d298922e7c7ee2975..f9269a36205a6267fa3d2dc6c7d58fdecfcfa424 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -3,7 +3,7 @@
 #include "bam.h"
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.2-4"
+#define PACKAGE_VERSION "0.1.2-5"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);