r940: fixed a bug - missing primary hit
This commit is contained in:
parent
5e00d08346
commit
282130a64e
|
|
@ -88,7 +88,9 @@ alignments and assigns mapQ following these two rules:
|
||||||
|
|
||||||
In theory, non-ALT alignments from step 1 should be identical to alignments
|
In theory, non-ALT alignments from step 1 should be identical to alignments
|
||||||
against a reference genome with ALT contigs. In practice, the two types of
|
against a reference genome with ALT contigs. In practice, the two types of
|
||||||
alignments may differ in rare cases due to seeding heuristics.
|
alignments may differ in rare cases due to seeding heuristics. When an ALT hit
|
||||||
|
is significantly better than non-ALT hits, BWA-MEM may miss seeds on the
|
||||||
|
non-ALT hits. This happens more often for contig mapping.
|
||||||
|
|
||||||
If we don't care about ALT hits, we may skip postprocessing (step 2).
|
If we don't care about ALT hits, we may skip postprocessing (step 2).
|
||||||
Nonetheless, postprocessing is recommended as it improves mapQ and gives more
|
Nonetheless, postprocessing is recommended as it improves mapQ and gives more
|
||||||
|
|
@ -134,7 +136,7 @@ not to high resolution for now.
|
||||||
|
|
||||||
### Evaluating ALT Mapping
|
### Evaluating ALT Mapping
|
||||||
|
|
||||||
(To come later...)
|
(Coming soon...)
|
||||||
|
|
||||||
## Problems and Future Development
|
## Problems and Future Development
|
||||||
|
|
||||||
|
|
|
||||||
9
bwamem.c
9
bwamem.c
|
|
@ -980,14 +980,14 @@ void mem_reg2sam(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac,
|
||||||
extern char **mem_gen_alt(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, mem_alnreg_v *a, int l_query, const char *query);
|
extern char **mem_gen_alt(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, mem_alnreg_v *a, int l_query, const char *query);
|
||||||
kstring_t str;
|
kstring_t str;
|
||||||
kvec_t(mem_aln_t) aa;
|
kvec_t(mem_aln_t) aa;
|
||||||
int k;
|
int k, l;
|
||||||
char **XA = 0;
|
char **XA = 0;
|
||||||
|
|
||||||
if (!(opt->flag & MEM_F_ALL))
|
if (!(opt->flag & MEM_F_ALL))
|
||||||
XA = mem_gen_alt(opt, bns, pac, a, s->l_seq, s->seq);
|
XA = mem_gen_alt(opt, bns, pac, a, s->l_seq, s->seq);
|
||||||
kv_init(aa);
|
kv_init(aa);
|
||||||
str.l = str.m = 0; str.s = 0;
|
str.l = str.m = 0; str.s = 0;
|
||||||
for (k = 0; k < a->n; ++k) {
|
for (k = l = 0; k < a->n; ++k) {
|
||||||
mem_alnreg_t *p = &a->a[k];
|
mem_alnreg_t *p = &a->a[k];
|
||||||
mem_aln_t *q;
|
mem_aln_t *q;
|
||||||
if (p->score < opt->T) continue;
|
if (p->score < opt->T) continue;
|
||||||
|
|
@ -999,9 +999,10 @@ void mem_reg2sam(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac,
|
||||||
q->XA = XA? XA[k] : 0;
|
q->XA = XA? XA[k] : 0;
|
||||||
q->flag |= extra_flag; // flag secondary
|
q->flag |= extra_flag; // flag secondary
|
||||||
if (p->secondary >= 0) q->sub = -1; // don't output sub-optimal score
|
if (p->secondary >= 0) q->sub = -1; // don't output sub-optimal score
|
||||||
if (k && p->secondary < 0) // if supplementary
|
if (l && p->secondary < 0) // if supplementary
|
||||||
q->flag |= (opt->flag&MEM_F_NO_MULTI)? 0x10000 : 0x800;
|
q->flag |= (opt->flag&MEM_F_NO_MULTI)? 0x10000 : 0x800;
|
||||||
if (k && !p->is_alt && q->mapq > aa.a[0].mapq) q->mapq = aa.a[0].mapq;
|
if (l && !p->is_alt && q->mapq > aa.a[0].mapq) q->mapq = aa.a[0].mapq;
|
||||||
|
++l;
|
||||||
}
|
}
|
||||||
if (aa.n == 0) { // no alignments good enough; then write an unaligned record
|
if (aa.n == 0) { // no alignments good enough; then write an unaligned record
|
||||||
mem_aln_t t;
|
mem_aln_t t;
|
||||||
|
|
|
||||||
2
main.c
2
main.c
|
|
@ -4,7 +4,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#ifndef PACKAGE_VERSION
|
#ifndef PACKAGE_VERSION
|
||||||
#define PACKAGE_VERSION "0.7.10-r939-dirty"
|
#define PACKAGE_VERSION "0.7.10-r940-dirty"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int bwa_fa2pac(int argc, char *argv[]);
|
int bwa_fa2pac(int argc, char *argv[]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue