Broken vcf header, no column name?
2
0
Entering edit mode
8.0 years ago

Hi,

Trying to use VCF tool's vcf-compare function.

I have bgzipped and tabixed indexed my files

bgzip -c file.vcf > file.vcf.gz
tabix -p vcf file.vcf.gz

I then call vcf-compare file1.vcf.gz file2.vcf.gz but get the error:

Broken VCF header, no column names?
 at /usr/share/perl5/Vcf.pm line 172.
    Vcf::throw(Vcf4_2=HASH(0x25c1df8), "Broken VCF header, no column names?") called at /usr/share/perl5/Vcf.pm line 866
    VcfReader::_read_column_names(Vcf4_2=HASH(0x25c1df8)) called at /usr/share/perl5/Vcf.pm line 601
    VcfReader::parse_header(Vcf4_2=HASH(0x25c1df8)) called at /usr/bin/vcf-compare line 198
    main::compare_vcfs(HASH(0x1fa1850)) called at /usr/bin/vcf-compare line 19

What can I do about this?

vcf vcftools • 7.2k views
ADD COMMENT
1
Entering edit mode

You need the -h option in tabix, to preserve the headers.

ADD REPLY
0
Entering edit mode

Thanks - I tried this but the error persists

ADD REPLY
0
Entering edit mode

what's the output of grep "#CHROM" -m1 file.vcf ?

ADD REPLY
1
Entering edit mode
8.0 years ago
bcftools query -f '%CHROM\t%POS\t%REF\t%ALT[\t%SAMPLE=%GT]\n' file.vcf.gz

To understand more: https://samtools.github.io/hts-specs/VCFv4.2.pdf

And more: https://samtools.github.io/bcftools/bcftools.html (go to "query" subcommand and -f option)

Out of curiosity: what happens when you do a grep "#CHROM" on your vcf file? Do you get any line?

ADD COMMENT
0
Entering edit mode
8.0 years ago

Thanks I fixed it - I had to gunzip the .gz files provided to me from the pipeline and rezip them. Once I tabixed them after this it worked fine.

ADD COMMENT

Login before adding your answer.

Traffic: 2353 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6