Question: Broken vcf header, no column name?
0
gravatar for samuel.lipworth
2.3 years ago by
University of Oxford
samuel.lipworth30 wrote:

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-tools vcf • 2.1k views
ADD COMMENTlink modified 2.3 years ago • written 2.3 years ago by samuel.lipworth30
1

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

ADD REPLYlink written 2.3 years ago by Giovanni M Dall'Olio26k

Thanks - I tried this but the error persists

ADD REPLYlink written 2.3 years ago by samuel.lipworth30

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

ADD REPLYlink written 2.3 years ago by Pierre Lindenbaum118k
1
gravatar for Macspider
2.3 years ago by
Macspider2.8k
Vienna - BOKU
Macspider2.8k wrote:
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 COMMENTlink modified 2.3 years ago • written 2.3 years ago by Macspider2.8k
0
gravatar for samuel.lipworth
2.3 years ago by
University of Oxford
samuel.lipworth30 wrote:

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 COMMENTlink written 2.3 years ago by samuel.lipworth30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1051 users visited in the last hour