From 935a6e6064411ae55da88d9fcfccab78434e4c67 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Wed, 27 Sep 2017 23:51:05 -0400 Subject: [PATCH] r450: differentiate exact repeats via mapq --- hit.c | 1 + main.c | 2 +- pe.c | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hit.c b/hit.c index 4d98847..111ec27 100644 --- a/hit.c +++ b/hit.c @@ -383,6 +383,7 @@ void mm_set_mapq(int n_regs, mm_reg1_t *regs, int min_chain_sc, int match_sc, in mapq -= (int)(4.343f * logf(r->n_sub + 1) + .499f); mapq = mapq > 0? mapq : 0; r->mapq = mapq < 60? mapq : 60; + if (r->p && r->p->dp_max > r->p->dp_max2 && r->mapq == 0) r->mapq = 1; } else r->mapq = 0; } } diff --git a/main.c b/main.c index 17b7b11..c525f8c 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "getopt.h" -#define MM_VERSION "2.2-r448-dirty" +#define MM_VERSION "2.2-r450-dirty" #ifdef __linux__ #include diff --git a/pe.c b/pe.c index f74dddd..bdf16b1 100644 --- a/pe.c +++ b/pe.c @@ -135,6 +135,13 @@ void mm_pair(void *km, int max_gap_ref, int pe_bonus, int sub_diff, int match_sc } if (r[0]->mapq < mapq_pe) r[0]->mapq = (r[0]->mapq + mapq_pe) / 2; if (r[1]->mapq < mapq_pe) r[1]->mapq = (r[1]->mapq + mapq_pe) / 2; + if (sc.n == 1) { + if (r[0]->mapq < 2) r[0]->mapq = 2; + if (r[1]->mapq < 2) r[1]->mapq = 2; + } else if (max > sc.a[sc.n - 2]) { + if (r[0]->mapq < 1) r[0]->mapq = 1; + if (r[1]->mapq < 1) r[1]->mapq = 1; + } } kfree(km, a);