fixed negative mapping quality; still byggy

This commit is contained in:
Heng Li 2011-10-24 14:00:36 -04:00
parent 8512b55ce3
commit b204437c7e
2 changed files with 2 additions and 1 deletions

View File

@ -428,6 +428,7 @@ static void print_hits(const bntseq_t *bns, const bsw2opt_t *opt, bsw2seq1_t *ks
if (p->n_seeds < 2) c *= .2;
qual = (int)(c * (p->G - subo) * (250.0 / p->G + 0.03 / opt->a) + .499);
if (qual > 250) qual = 250;
if (qual < 0) qual = 0;
if (p->flag&1) qual = 0;
}
ksprintf(&str, "\t%d\t", qual);

View File

@ -35,7 +35,7 @@ typedef struct {
#include "ksort.h"
KSORT_INIT_GENERIC(int)
#define __hitG_lt(a, b) ((a).n_seeds > (b).n_seeds || ((a).n_seeds == (b).n_seeds && (a).G > (b).G))
#define __hitG_lt(a, b) (((a).G + ((int)(a).n_seeds<<2)) > (b).G + ((int)(b).n_seeds<<2))
KSORT_INIT(hitG, bsw2hit_t, __hitG_lt)
static const bsw2cell_t g_default_cell = { 0, 0, MINUS_INF, MINUS_INF, MINUS_INF, 0, 0, 0, -1, -1, {-1, -1, -1, -1} };