for (j = 0; j < 4; ++j)
qsum[j] += calls[i].qsum[j];
int qsum_tot=0;
- for (j=0; j<4; j++) qsum_tot += qsum[j];
+ for (j=0; j<4; j++) { qsum_tot += qsum[j]; call->qsum[j] = 0; }
for (j = 0; j < 4; ++j) qsum[j] = qsum[j] << 2 | j;
// find the top 2 alleles
for (i = 1; i < 4; ++i) // insertion sort
if ((qsum[i]&3) != ref4) {
if (qsum[i]>>2 != 0)
{
- call->qsum[j] = (float)(qsum[i]>>2)/qsum_tot;
+ if ( j<4 ) call->qsum[j] = (float)(qsum[i]>>2)/qsum_tot; // ref N can make j>=4
call->a[j++] = qsum[i]&3;
}
else break;
}
kputc('\0', &s);
// INFO
- if (bc->ori_ref < 0) kputs("INDEL;", &s);
+ if (bc->ori_ref < 0) ksprintf(&s,"INDEL;IS=%d,%f;", bca->max_support, bca->max_frac);
kputs("DP=", &s); kputw(bc->ori_depth, &s); kputs(";I16=", &s);
for (i = 0; i < 16; ++i) {
if (i) kputc(',', &s);