This is a test version of Biostars. For the public version, visit https://www.biostars.org.
using vcftools to add gene name to vcf file

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:

example bed:

chr1   1234   12345   AGRN

command:

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

Error:

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
vcftools

1 answer

If you are open to trying other tools, and the gene annotations come from one of the databases supported by SnpEff, you may like to give it a try.

The syntax will be as simple as:

java -Xmx4g -jar snpEff.jar -v -stats ex1.html GRCh37.75 protocols/ex1.vcf > protocols/ex1.ann.vcf

I will give this a try as well.... thank you.

Log in to answer this question.