This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Annotating Tabix Indexed Vcf

I would like to annotate a tabix indexed vcf. Thus, my input is a tabix file and my output should also be a tabix file. How can this be accomplished?

vcf tabix

1 answer

unzip your vcf, annotate it, sort, compress with bgzip and re-index with tabix.

gunzip -c yourfile.vcf.gz > tmp1.vcf
annotatetool1  tmp1.vcf > tmp2.vcf
annotatetool2  tmp2.vcf > tmp3.vcf
vcf-sort <  tmp3.vcf |  bgzip -c > annot.vcf.gz
tabix -p vcf annot.vcf.gz

If your tools use stdin and stdout, almost all the command lines below can fit into one pipeline

gunzip -c yourfile.vcf.gz | annotatetool1 | annotatetool2 |  vcf-sort |  bgzip -c >  annot.vcf.gz &&   tabix -p vcf annot.vcf.gz

Log in to answer this question.