This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to extract all columns of CSQ using split-vep plugin of bcftools?

I have a vcf file containing CSQ column which has 350 parameters. How can extract all of them as table using bcftools +split-vep

plugin samtools bcftools vcf split-vep

extract all of them as table using

is this plugin able to convert vcf to a tabular format ?

1 answer

bcftools +split-vep -f '%CHROM\t%POS\t%REF\t%ALT\t%CSQ\n' -d -A tab input.vcf

And if you need headers:

echo -e "CHROM\tPOS\tREF\tALT\t$(bcftools +split-vep -l input.vcf | cut -f 2 | tr '\n' '\t' | sed 's/\t$//')" > output.tsv
bcftools +split-vep -f '%CHROM\t%POS\t%REF\t%ALT\t%CSQ\n' -d -A tab input.vcf >> output.tsv

Hi David,

Love the code, thanks! Do you know if its possible to get the ensembl vep headers onto the output? Thanks! Amy

Log in to answer this question.