]> git.donarmstrong.com Git - samtools.git/commitdiff
remove ZQ if both BQ and ZQ are present
authorHeng Li <lh3@live.co.uk>
Tue, 16 Nov 2010 19:11:58 +0000 (19:11 +0000)
committerHeng Li <lh3@live.co.uk>
Tue, 16 Nov 2010 19:11:58 +0000 (19:11 +0000)
bam_md.c

index e1e756d1d77907a9d67e9bb65337cc87705338c0..44d46a492438beecae74fc648c9564a566565be7 100644 (file)
--- a/bam_md.c
+++ b/bam_md.c
@@ -173,7 +173,10 @@ int bam_prob_realn_core(bam1_t *b, const char *ref, int apply_baq)
        // test if BQ or ZQ is present
        if ((bq = bam_aux_get(b, "BQ")) != 0) ++bq;
        if ((zq = bam_aux_get(b, "ZQ")) != 0 && *zq == 'Z') ++zq;
-       if (bq && zq) return -2; // do not know what to do...
+       if (bq && zq) { // remove the ZQ tag
+               bam_aux_del(b, zq-1);
+               zq = 0;
+       }
        if (bq || zq) {
                if ((apply_baq && zq) || (!apply_baq && bq)) return -3; // in both cases, do nothing
                if (bq && apply_baq) { // then convert BQ to ZQ