Skip to content

Commit 507d39a

Browse files
committed
r1013: changed to a more accurate similarity est
Based on DOI:10.1101/2021.01.15.426881. One minimap2 reviewer suggested the right formula to me but I thought the difference would be insignificant. I was wrong.
1 parent 827ca4b commit 507d39a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

esterr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ void mm_est_err(const mm_idx_t *mi, int qlen, int n_regs, mm_reg1_t *regs, const
5959
n_tot = en - st + 1;
6060
if (r->qs > avg_k && r->rs > avg_k) ++n_tot;
6161
if (qlen - r->qs > avg_k && l_ref - r->re > avg_k) ++n_tot;
62-
r->div = logf((float)n_tot / n_match) / avg_k;
62+
r->div = n_match >= n_tot? 0.0f : (float)(1.0 - pow((double)n_match / n_tot, 1.0 / avg_k));
6363
}
6464
}

main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "mmpriv.h"
88
#include "ketopt.h"
99

10-
#define MM_VERSION "2.17-r1012-dirty"
10+
#define MM_VERSION "2.17-r1013-dirty"
1111

1212
#ifdef __linux__
1313
#include <sys/resource.h>

0 commit comments

Comments
 (0)