]> git.donarmstrong.com Git - samtools.git/blobdiff - bcftools/vcf.c
Revert one of my earlier changes - Heng was right, CIGAR P not sensible in a padded...
[samtools.git] / bcftools / vcf.c
index 81a38eaa7f2d853908ce3df575416c9092735d76..bc110847dab9e2b97d0248ddfef92312de561ce1 100644 (file)
@@ -124,10 +124,10 @@ int vcf_hdr_write(bcf_t *bp, const bcf_hdr_t *h)
        if (!bp->is_vcf) return bcf_hdr_write(bp, h);
        if (h->l_txt > 0) {
                if (strstr(h->txt, "##fileformat=")) has_ver = 1;
-               if (has_ver == 0) fprintf(v->fpout, "##fileformat=VCFv4.0\n");
+               if (has_ver == 0) fprintf(v->fpout, "##fileformat=VCFv4.1\n");
                fwrite(h->txt, 1, h->l_txt - 1, v->fpout);
        }
-       if (h->l_txt == 0) fprintf(v->fpout, "##fileformat=VCFv4.0\n");
+       if (h->l_txt == 0) fprintf(v->fpout, "##fileformat=VCFv4.1\n");
        fprintf(v->fpout, "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT");
        for (i = 0; i < h->n_smpl; ++i)
                fprintf(v->fpout, "\t%s", h->sns[i]);
@@ -186,7 +186,7 @@ int vcf_read(bcf_t *bp, bcf_hdr_t *h, bcf1_t *b)
                                                ((uint8_t*)b->gi[i].data)[k-9] = 0;
                                        } else if (b->gi[i].fmt == bcf_str2int("SP", 2)) {
                                                ((int32_t*)b->gi[i].data)[k-9] = 0;
-                                       } else if (b->gi[i].fmt == bcf_str2int("DP", 2)) {
+                                       } else if (b->gi[i].fmt == bcf_str2int("DP", 2) || b->gi[i].fmt == bcf_str2int("DV", 2)) {
                                                ((uint16_t*)b->gi[i].data)[k-9] = 0;
                                        } else if (b->gi[i].fmt == bcf_str2int("PL", 2)) {
                                                int y = b->n_alleles * (b->n_alleles + 1) / 2;
@@ -210,7 +210,7 @@ int vcf_read(bcf_t *bp, bcf_hdr_t *h, bcf1_t *b)
                                        int x = strtol(q, &q, 10);
                                        if (x > 0xffff) x = 0xffff;
                                        ((uint32_t*)b->gi[i].data)[k-9] = x;
-                               } else if (b->gi[i].fmt == bcf_str2int("DP", 2)) {
+                               } else if (b->gi[i].fmt == bcf_str2int("DP", 2) || b->gi[i].fmt == bcf_str2int("DV", 2)) {
                                        int x = strtol(q, &q, 10);
                                        if (x > 0xffff) x = 0xffff;
                                        ((uint16_t*)b->gi[i].data)[k-9] = x;