]> git.donarmstrong.com Git - samtools.git/commitdiff
* automatically fix errors in GL
authorHeng Li <lh3@live.co.uk>
Thu, 24 Feb 2011 14:35:06 +0000 (14:35 +0000)
committerHeng Li <lh3@live.co.uk>
Thu, 24 Feb 2011 14:35:06 +0000 (14:35 +0000)
 * output unrecognized FORMAT as "."

bcftools/bcf.c
bcftools/vcf.c

index b749847d2fc1ce7ca5e5cea755258cdb570a8358..88ba1babe2ae232877afd4fbf85a4cf095f73eda 100644 (file)
@@ -259,7 +259,7 @@ void bcf_fmt_core(const bcf_hdr_t *h, bcf1_t *b, kstring_t *s)
                                        if (k > 0) kputc(',', s);
                                        ksprintf(s, "%.2f", d[k]);
                                }
-                       }
+                       } else kputc('.', s); // custom fields
                }
        }
 }
index 6d3abaa495516014135e68f43225e7b97a7f5710..d8cb1e6d3efc56b8c119f677b25d292f696e3428 100644 (file)
@@ -224,7 +224,7 @@ int vcf_read(bcf_t *bp, bcf_hdr_t *h, bcf1_t *b)
                                        y = b->n_alleles * (b->n_alleles + 1) / 2;
                                        for (j = 0; j < y; ++j) {
                                                x = strtod(q, &q);
-                                               data[(k-9) * y + j] = x;
+                                               data[(k-9) * y + j] = x > 0? -x/10. : x;
                                                ++q;
                                        }
                                }