Skip to content

Commit

Permalink
r381: fixed a bug when upper bound < max read len
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Apr 19, 2013
1 parent db7a986 commit 3f8caef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bwape.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ static int infer_isize(int n_seqs, bwa_seq_t *seqs[2], isize_info_t *ii, double
tmp = (int)(p25 - OUTLIER_BOUND * (p75 - p25) + .499);
ii->low = tmp > max_len? tmp : max_len; // ii->low is unsigned
ii->high = (int)(p75 + OUTLIER_BOUND * (p75 - p25) + .499);
if (ii->low > ii->high) {
fprintf(stderr, "[infer_isize] fail to infer insert size: upper bound is smaller than read length\n");
free(isizes);
return -1;
}
for (i = 0, x = n = 0; i < tot; ++i)
if (isizes[i] >= ii->low && isizes[i] <= ii->high)
++n, x += isizes[i];
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "utils.h"

#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.3-r380-beta"
#define PACKAGE_VERSION "0.7.3-r381-beta"
#endif

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

0 comments on commit 3f8caef

Please sign in to comment.