X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=blobdiff_plain;f=bam2bcf.c;fp=bam2bcf.c;h=f69684dc8c31acce2636b17a8da95374ecb3231a;hp=ed78ea6c7048fb9d21248cb4812726c77e3afd45;hb=74e6aebb5c07d14cdccc5f8abb40fd4a00b2be86;hpb=ec294adf095b60c90e57e31f3af1335138c5a22a diff --git a/bam2bcf.c b/bam2bcf.c index ed78ea6..f69684d 100644 --- a/bam2bcf.c +++ b/bam2bcf.c @@ -196,7 +196,7 @@ int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, 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 @@ -210,7 +210,7 @@ int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, 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; @@ -313,7 +313,7 @@ int bcf_call2bcf(int tid, int pos, bcf_call_t *bc, bcf1_t *b, bcf_callret1_t *bc } 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);