From: Heng Li <lh3@live.co.uk>
Date: Mon, 9 Aug 2010 17:05:07 +0000 (+0000)
Subject: do not print refname if file is converted from VCF
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ce14f3df8a5356e711949efb243d2e78b8e38e5e;p=samtools.git

do not print refname if file is converted from VCF
---

diff --git a/bcftools/bcf.c b/bcftools/bcf.c
index fdc13b8..2cb9876 100644
--- a/bcftools/bcf.c
+++ b/bcftools/bcf.c
@@ -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);