Improving 'properly paired' flag.

If one end has a low quality tail that happens to have a score-20 hit,
the pair won't be flagged as properly paired because bwa-mem thought it has
multiple hits. By filtering with -T, we won't have this problem.
This commit is contained in:
Heng Li 2013-03-09 18:05:50 -05:00
parent 740d2c1314
commit 2d01a297fb
3 changed files with 3 additions and 3 deletions

2
bwa.1
View File

@ -235,7 +235,7 @@ attached to every read in the output. An example is '@RG\\tID:foo\\tSM:bar'.
.BI -T \ INT
Don't output alignment with score lower than
.IR INT .
This option only affects output. [30]
This option affects output and occasionally SAM flag 2. [30]
.TP
.B -a
Output all found alignments for single-end or unpaired paired-end reads. These

View File

@ -260,7 +260,7 @@ int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, co
// 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)
if (a[i].a[j].secondary < 0) break;
if (a[i].a[j].secondary < 0 && a[i].a[j].score >= opt->T) break;
is_multi[i] = j < a[i].n? 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

2
main.c
View File

@ -3,7 +3,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.1-r347"
#define PACKAGE_VERSION "0.7.1-r348-beta"
#endif
int bwa_fa2pac(int argc, char *argv[]);