This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to filter vcf files with bcftools and to check whether the filtering worked

Hi guys, I have to filter a vcf file removing REF allele being equal to N. I wrote the following command line:

bcftools view -e 'REF = "N"' HT_Third_10_Plates_Batch.vcf > HT_Third_10_Plates_Batch_withoutN.vcf

But I'm not sure it worked... I got a HT_Third_10_Plates_Batch_withoutN.vcf as big as the input, and I know there are REF allele being equal to N.

How can I be sure it worked? Is it the command correct?

Thank u!

vcf bcftools

Simplest way is by counting the lines.

bcftools view -H HT_Third_10_Plates_Batch.vcf | wc -l

bcftools view -H HT_Third_10_Plates_Batch_withoutN.vcf | wc -l

0 answers

No answers yet.

Log in to answer this question.