From 796a36ed12f01950213be16533e79ab0508744f4 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Tue, 16 Nov 2010 19:11:58 +0000 Subject: [PATCH] remove ZQ if both BQ and ZQ are present --- bam_md.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.5