]> git.donarmstrong.com Git - samtools.git/commitdiff
do not print refname if file is converted from VCF
authorHeng Li <lh3@live.co.uk>
Mon, 9 Aug 2010 17:05:07 +0000 (17:05 +0000)
committerHeng Li <lh3@live.co.uk>
Mon, 9 Aug 2010 17:05:07 +0000 (17:05 +0000)
bcftools/bcf.c

index fdc13b83f4ea7f714e159afbf6ba1e761fe42d60..2cb98761cf570d7e6ba6260217977c536158301e 100644 (file)
@@ -208,7 +208,9 @@ void bcf_fmt_core(const bcf_hdr_t *h, bcf1_t *b, kstring_t *s)
 {
        int i, j, x;
        s->l = 0;
-       kputs(h->ns[b->tid], s); kputc('\t', s);
+       if (h->n_ref) kputs(h->ns[b->tid], s);
+       else kputw(b->tid, s);
+       kputc('\t', s);
        kputw(b->pos + 1, s); kputc('\t', s);
        fmt_str(b->str, s); kputc('\t', s);
        fmt_str(b->ref, s); kputc('\t', s);