]> git.donarmstrong.com Git - samtools.git/blobdiff - bam2bcf.c
* change the order of PL/GL according to the latest VCF spec
[samtools.git] / bam2bcf.c
index 98acb5dd2ff051eacb86f8efd72c00c370798617..bd5503d7e55cef2479c1a8d12d3dc0855eab06f2 100644 (file)
--- a/bam2bcf.c
+++ b/bam2bcf.c
@@ -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;