From bd85af08abb09a81d12f0c351b3a6500bfe95042 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Mon, 15 Sep 2014 12:13:04 -0400 Subject: [PATCH] r826: improved alt mapping for PE --- bwamem_pair.c | 6 +++--- main.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bwamem_pair.c b/bwamem_pair.c index c79cc69..f212427 100644 --- a/bwamem_pair.c +++ b/bwamem_pair.c @@ -276,9 +276,9 @@ int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, co char **XA[2]; // check if an end has multiple hits even after mate-SW for (i = 0; i < 2; ++i) { - for (j = 1; j < a[i].n; ++j) + for (j = 1; j < n_pri[i]; ++j) if (a[i].a[j].secondary < 0 && a[i].a[j].score >= opt->T) break; - is_multi[i] = j < a[i].n? 1 : 0; + is_multi[i] = j < n_pri[i]? 1 : 0; } if (is_multi[0] || is_multi[1]) goto no_pairing; // TODO: in rare cases, the true hit may be long but with low score // compute mapQ for the best SE hit @@ -316,7 +316,7 @@ int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, co int k = a[i].a[z[i]].secondary; if (k >= 0) { // switch secondary and primary assert(a[i].a[k].secondary < 0); - for (j = 0; j < a[i].n; ++j) + for (j = 0; j < n_pri[i]; ++j) if (a[i].a[j].secondary == k || j == k) a[i].a[j].secondary = z[i]; a[i].a[z[i]].secondary = -1; diff --git a/main.c b/main.c index a2543e4..4a38fbd 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.7.10-r824-dirty" +#define PACKAGE_VERSION "0.7.10-r826-dirty" #endif int bwa_fa2pac(int argc, char *argv[]);