uint32_t *cigar = bam1_cigar(b);
bam1_core_t *c = &b->core;
kpa_par_t conf = kpa_par_def;
- // find the start and end of the alignment
if (c->flag & BAM_FUNMAP) return -1;
+ if (bam_aux_get(b, "BQ")) return -2;
+ // find the start and end of the alignment
x = c->pos, y = 0, yb = ye = xb = xe = -1;
for (k = 0; k < c->n_cigar; ++k) {
int op, l;
else if (op == BAM_CDEL) x += l;
}
if (write_bq) {
- for (i = 0; i < c->l_qseq; ++i) bq[i] = bq[i] - qual[i] + 33;
+ for (i = 0; i < c->l_qseq; ++i) bq[i] = bq[i] - qual[i] + 64;
bam_aux_append(b, "BQ", 'Z', c->l_qseq + 1, bq);
free(bq);
}
fprintf(stderr, "[bam_fillmd] fail to find sequence '%s' in the reference.\n",
fp->header->target_name[tid]);
}
- if (is_realn) bam_prob_realn_core(b, ref, 0);
+ if (is_realn) bam_prob_realn_core(b, ref, 1);
if (capQ > 10) {
int q = bam_cap_mapQ(b, ref, capQ);
if (b->core.qual > q) b->core.qual = q;