Skip to content

Commit 60b7284

Browse files
committed
r941: set a min length for 3rd-round seeding
1 parent 282130a commit 60b7284

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

bwamem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static void mem_collect_intv(const mem_opt_t *opt, const bwt_t *bwt, int len, co
147147
if (seq[x] < 4) {
148148
if (1) {
149149
bwtintv_t m;
150-
x = bwt_seed_strategy1(bwt, len, seq, x, opt->max_mem_intv, &m);
150+
x = bwt_seed_strategy1(bwt, len, seq, x, opt->min_seed_len, opt->max_mem_intv, &m);
151151
if (m.x[2] > 0) kv_push(bwtintv_t, a->mem, m);
152152
} else { // for now, we never come to this block which is slower
153153
x = bwt_smem1a(bwt, len, seq, x, start_width, opt->max_mem_intv, &a->mem1, a->tmpv);
@@ -274,7 +274,7 @@ mem_chain_v mem_chain(const mem_opt_t *opt, const bwt_t *bwt, const bntseq_t *bn
274274
bwtintv_t *p = &aux->mem.a[i];
275275
int step, count, slen = (uint32_t)p->info - (p->info>>32); // seed length
276276
int64_t k;
277-
if (slen < opt->min_seed_len) continue; // ignore if too short or too repetitive
277+
// if (slen < opt->min_seed_len) continue; // ignore if too short or too repetitive
278278
step = p->x[2] > opt->max_occ? p->x[2] / opt->max_occ : 1;
279279
for (k = count = 0; k < p->x[2] && count < opt->max_occ; k += step, ++count) {
280280
mem_chain_t tmp, *lower, *upper;

bwt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ int bwt_smem1(const bwt_t *bwt, int len, const uint8_t *q, int x, int min_intv,
355355
return bwt_smem1a(bwt, len, q, x, min_intv, 0, mem, tmpvec);
356356
}
357357

358-
int bwt_seed_strategy1(const bwt_t *bwt, int len, const uint8_t *q, int x, int max_intv, bwtintv_t *mem)
358+
int bwt_seed_strategy1(const bwt_t *bwt, int len, const uint8_t *q, int x, int min_len, int max_intv, bwtintv_t *mem)
359359
{
360360
int i, c;
361361
bwtintv_t ik, ok[4];
@@ -367,7 +367,7 @@ int bwt_seed_strategy1(const bwt_t *bwt, int len, const uint8_t *q, int x, int m
367367
if (q[i] < 4) { // an A/C/G/T base
368368
c = 3 - q[i]; // complement of q[i]
369369
bwt_extend(bwt, &ik, ok, 0);
370-
if (ok[c].x[2] < max_intv) {
370+
if (ok[c].x[2] < max_intv && i - x >= min_len) {
371371
*mem = ok[c];
372372
mem->info = (uint64_t)x<<32 | (i + 1);
373373
return i + 1;

bwt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ extern "C" {
121121
int bwt_smem1(const bwt_t *bwt, int len, const uint8_t *q, int x, int min_intv, bwtintv_v *mem, bwtintv_v *tmpvec[2]);
122122
int bwt_smem1a(const bwt_t *bwt, int len, const uint8_t *q, int x, int min_intv, uint64_t max_intv, bwtintv_v *mem, bwtintv_v *tmpvec[2]);
123123

124-
int bwt_seed_strategy1(const bwt_t *bwt, int len, const uint8_t *q, int x, int max_intv, bwtintv_t *mem);
124+
int bwt_seed_strategy1(const bwt_t *bwt, int len, const uint8_t *q, int x, int min_len, int max_intv, bwtintv_t *mem);
125125

126126
#ifdef __cplusplus
127127
}

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "utils.h"
55

66
#ifndef PACKAGE_VERSION
7-
#define PACKAGE_VERSION "0.7.10-r940-dirty"
7+
#define PACKAGE_VERSION "0.7.10-r941-dirty"
88
#endif
99

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

0 commit comments

Comments
 (0)