I am trying to add gene identifiers to a vcf file using vcftools 0.1.14. I first use the below command to unzip the vcf, sort, compress with bgzip, and index it with tabix. Thank you :).
gunzip -c TSVC_007.vcf.gz | vcf-sort | bgzip -c > TSVC_007.vcf && tabix -p vcf TSVC_007.vcf
I then take the bgzip vcf and in vcf-tools run: where TSVC_007 is bgzip compressed vcf and test.bed is the bed file to use:
chr1 1234 12345 AGRN
cat TSVC_007.vcf | vcf-annotate -a test.bed -d key=INFO,ID=ANN,Number=1,Type=Integer,Description='My custom annotation' -c CHROM,FROM,TO,INFO/ANN > out.vcf
Broken VCF header, no column names? at /usr/local/share/perl/5.18.2/Vcf.pm line 172. Vcf::throw('Vcf4_2=HASH(0x16ffc20)', 'Broken VCF header, no column names?') called at /usr/local/share/perl/5.18.2/Vcf.pm line 866 VcfReader::_read_column_names('Vcf4_2=HASH(0x16ffc20)') called at /usr/local/share/perl/5.18.2/Vcf.pm line 601 VcfReader::parse_header('Vcf4_2=HASH(0x16ffc20)') called at /usr/local/bin/vcf-annotate line 408 main::annotate('HASH(0x1786e00)') called at /usr/local/bin/vcf-annotate line 33