This is a test version of Biostars. For the public version, visit https://www.biostars.org.
VEP annotated vcf is not readable in bcftools

I separated the list of snps from VEP text file. I would like to extract those snps from VEP annotated file (File format:#Unloaded Variant, LOCATION, ALLELE) and create output file as vcf output (CHRM, POS, REF, ALT, FILTER with genotypes) to use for allele frequency count

bcftools plink

1 answer

Bcftools can read and parse VEP annotated vcf files. You can then format the output as you like.

Are you using "--vcf" option when running vep?

It would be easier if you supply your commands and examples from the files.

I generated with --vcf then, I am not able to put filtering criteria like replace . with NA , select only NA frequency column. CADD filtering. Can you guide me how to filter these INFO columns in vcf file and create new vcf files.

  1. I also have Variant id information from VEP annotated columns like as follows, Can I use it to extract from vcf file

X.Uploaded_variation chr1_728076_-/TTC rs148146441 rs148146441 chr1_9122138_T/- rs139855605

You can parse the CSQ field with split-vep command and write your filters as bcftools expressions. To filter dots you can use MAX_AF="." to get low freqs and novels you can combine these expressions with logic operators MAX_AF <= 0.001 || MAX_AF="."

Here is an example command that would get you variants with deleterious CADD scores that are novel or low frequency: We use -c option to indicate the type of the column in this case MAX_AF is float and CADD_Pred is and Int otherwise bcftools gonna turned them all into strings. -f option is formating -d explodes the transcripts and -A sets delimiter between the CSQ columns.

bcftools +split-vep test/split-vep.vcf -c MAX_AF:Float,CADD_Phred:Int -f '%CHROM:%POS %CSQ\n' -d -A tab -i '(MAX_AF <= 0.001 || MAX_AF=".") && CADD_Phred > 30'

You can read more about it here:

https://samtools.github.io/bcftools/howtos/plugin.split-vep.html

and here:

https://samtools.github.io/bcftools/bcftools.html#expressions

Thank you.

Log in to answer this question.