From: Heng Li Date: Tue, 16 Nov 2010 19:11:58 +0000 (+0000) Subject: remove ZQ if both BQ and ZQ are present X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=796a36ed12f01950213be16533e79ab0508744f4;p=samtools.git remove ZQ if both BQ and ZQ are present --- diff --git a/bam_md.c b/bam_md.c index e1e756d..44d46a4 100644 --- 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