X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bam2bcf.c;h=bd5503d7e55cef2479c1a8d12d3dc0855eab06f2;hb=8ef16f0ffefe94ead2c9e367ebcb66490fdea2cb;hp=46f534ee7553182f790384921c8c667417838b75;hpb=c1e9248358a76e932de6f21039e56dbca9950dae;p=samtools.git diff --git a/bam2bcf.c b/bam2bcf.c index 46f534e..bd5503d 100644 --- a/bam2bcf.c +++ b/bam2bcf.c @@ -79,7 +79,7 @@ int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base, bcf_callaux_t } bca->bases[n++] = q<<5 | (int)bam1_strand(p->b)<<4 | b; // collect annotations - r->qsum[b] += q; + if (b < 4) r->qsum[b] += q; ++r->anno[0<<2|is_diff<<1|bam1_strand(p->b)]; min_dist = p->b->core.l_qseq - 1 - p->qpos; if (min_dist > p->qpos) min_dist = p->qpos; @@ -144,8 +144,8 @@ int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, x = call->n_alleles * (call->n_alleles + 1) / 2; // get the possible genotypes for (i = z = 0; i < call->n_alleles; ++i) - for (j = i; j < call->n_alleles; ++j) - g[z++] = call->a[i] * 5 + call->a[j]; + for (j = 0; j <= i; ++j) + g[z++] = call->a[j] * 5 + call->a[i]; for (i = 0; i < n; ++i) { uint8_t *PL = call->PL + x * i; const bcf_callret1_t *r = calls + i;