Skip to content

Commit

Permalink
r759: bugfix - frac_rep not working
Browse files Browse the repository at this point in the history
Also added commented code for a 3rd round seeding. Not used.
  • Loading branch information
lh3 committed May 9, 2014
1 parent c9b3350 commit 43b498a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
22 changes: 21 additions & 1 deletion bwamem.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,27 @@ static void mem_collect_intv(const mem_opt_t *opt, const bwt_t *bwt, int len, co
if (end - start < split_len || p->x[2] > opt->split_width) continue;
bwt_smem1(bwt, len, seq, (start + end)>>1, p->x[2]+1, &a->mem1, a->tmpv);
for (i = 0; i < a->mem1.n; ++i)
kv_push(bwtintv_t, a->mem, a->mem1.a[i]);
if ((a->mem1.a[i].info>>32) - (uint32_t)a->mem1.a[i].info >= opt->min_seed_len)
kv_push(bwtintv_t, a->mem, a->mem1.a[i]);
/*
{ // third pass:
int max_len = 0, max_i = -1;
for (i = 0; i < a->mem1.n; ++i) {
bwtintv_t *q = &a->mem1.a[i];
int start = q->info>>32, end = (int32_t)q->info;
if (end - start > max_len)
max_len = end - start, max_i = i;
}
if (max_i >= 0 && max_len > .9 * (end - start) && max_len >= split_len) {
bwtintv_t t = a->mem1.a[max_i];
int start = t.info>>32, end = (int32_t)t.info;
bwt_smem1(bwt, len, seq, (start + end)>>1, t.x[2]+1, &a->mem1, a->tmpv);
for (i = 0; i < a->mem1.n; ++i)
if ((a->mem1.a[i].info>>32) - (uint32_t)a->mem1.a[i].info >= opt->min_seed_len)
kv_push(bwtintv_t, a->mem, a->mem1.a[i]);
}
}
*/
}
// sort
ks_introsort(mem_intv, a->mem.n, a->mem.a);
Expand Down
2 changes: 1 addition & 1 deletion bwamem.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef struct {
int secondary; // index of the parent hit shadowing the current hit; <0 if primary
int seedlen0; // length of the starting seed
int n_comp; // number of sub-alignments chained together
int frac_rep;
float frac_rep;
uint64_t hash;
} mem_alnreg_t;

Expand Down
1 change: 1 addition & 0 deletions bwamem_pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, co
if (n_sub > 0) q_pe -= (int)(4.343 * log(n_sub+1) + .499);
if (q_pe < 0) q_pe = 0;
if (q_pe > 60) q_pe = 60;
q_pe = (int)(q_pe * (1. - .5 * (a[0].a[0].frac_rep + a[1].a[0].frac_rep)) + .499);
// the following assumes no split hits
if (o > score_un) { // paired alignment is preferred
mem_alnreg_t *c[2];
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "utils.h"

#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.8-r758-dirty"
#define PACKAGE_VERSION "0.7.8-r759-dirty"
#endif

int bwa_fa2pac(int argc, char *argv[]);
Expand Down

0 comments on commit 43b498a

Please sign in to comment.