Skip to content

Commit

Permalink
r524: reverted to bwa-mem end bonus
Browse files Browse the repository at this point in the history
and reduced the cost of clipping when filtering by identity
  • Loading branch information
lh3 committed Oct 20, 2017
1 parent 15ed071 commit bd04372
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hit.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void mm_filter_by_identity(void *km, int n_regs, mm_reg1_t *regs, float min_iden
mm_reg1_t *r = &regs[(int32_t)aux[i]];
if (r->qs > en) {
for (j = en; j < r->qs; ++j)
n_diff += qual == 0 || qual[j] >= 53? 0.5f : 0.025f * (qual[j] - 33);
n_diff += qual == 0 || qual[j] >= 53? .25f : .05f * .25f * (qual[j] - 33);
blen += r->qs - en;
}
assert(r->p);
Expand All @@ -295,7 +295,7 @@ void mm_filter_by_identity(void *km, int n_regs, mm_reg1_t *regs, float min_iden
en = en > r->qe? en : r->qe;
}
for (j = en; j < qlen; ++j)
n_diff += qual == 0 || qual[j] >= 53? 0.5f : 0.025f * (qual[j] - 33);
n_diff += qual == 0 || qual[j] >= 53? .25f : .05f * .25f * (qual[j] - 33);
blen += qlen - en;
kfree(km, aux);
if (1.0f - n_diff / blen < min_iden)
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "getopt.h"

#define MM_VERSION "2.2-r523-dirty"
#define MM_VERSION "2.2-r524-dirty"

#ifdef __linux__
#include <sys/resource.h>
Expand Down
2 changes: 1 addition & 1 deletion map.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo)
mo->pe_ori = 0<<1|1; // FR
mo->a = 2, mo->b = 8, mo->q = 12, mo->e = 2, mo->q2 = 24, mo->e2 = 1;
mo->zdrop = 100;
mo->end_bonus = 15;
mo->end_bonus = 10;
mo->max_frag_len = 800;
mo->max_gap = 100;
mo->bw = 100;
Expand Down
6 changes: 5 additions & 1 deletion tex/minimap2.tex
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,11 @@ \subsection{Aligning short genomic reads}
SNAP~\citep{Zaharia:2011aa}. Minimap2 is 3--4 times as fast as Bowtie2 and
BWA-MEM, but is 1.3 times slower than SNAP. Minimap2 is more accurate on this
simulated data set than Bowtie2 and SNAP but less accurate than BWA-MEM
(Fig.~\ref{fig:eval}b).
(Fig.~\ref{fig:eval}b). Closer investigation reveals that BWA-MEM achieves
a higher accuracy partly because it tries to locally align a read in a small
region close to its mate. If we disable this feature, BWA-MEM becomes slightly
less accurate than minimap2. We might consider to implement a similar heuristic
in minimap2 in future.

\section{Conclusion}

Expand Down

0 comments on commit bd04372

Please sign in to comment.