r546: minor mapQ tuning

This commit is contained in:
Heng Li 2017-11-01 13:20:39 -04:00
parent cd24dc8834
commit 22290db3e4
2 changed files with 3 additions and 3 deletions

2
main.c
View File

@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "getopt.h"
#define MM_VERSION "2.3-r545-dirty"
#define MM_VERSION "2.3-r546-dirty"
#ifdef __linux__
#include <sys/resource.h>

4
pe.c
View File

@ -159,8 +159,8 @@ void mm_pair(void *km, int max_gap_ref, int pe_bonus, int sub_diff, int match_sc
mapq_pe_alt = (int)(6.02f * ((max>>32) - (sc.a[sc.n - 2]>>32)) / match_sc - 4.343f * logf(n_sub)); // n_sub > 0 because it counts the optimal, too
mapq_pe = mapq_pe < mapq_pe_alt? mapq_pe : mapq_pe_alt;
}
if (r[0]->mapq < mapq_pe) r[0]->mapq = (r[0]->mapq + mapq_pe * 3) / 4;
if (r[1]->mapq < mapq_pe) r[1]->mapq = (r[1]->mapq + mapq_pe * 3) / 4;
if (r[0]->mapq < mapq_pe) r[0]->mapq = (int)(.2f * r[0]->mapq + .8f * mapq_pe + .499f);
if (r[1]->mapq < mapq_pe) r[1]->mapq = (int)(.2f * r[1]->mapq + .8f * mapq_pe + .499f);
if (sc.n == 1) {
if (r[0]->mapq < 2) r[0]->mapq = 2;
if (r[1]->mapq < 2) r[1]->mapq = 2;