How to filter vcf files with bcftools and to check whether the filtering worked
0
0
Entering edit mode
16 months ago
Khaleesi95 ▴ 40

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 • 538 views
ADD COMMENT
1
Entering edit mode

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
ADD REPLY
2
Entering edit mode
bcftools query -f '.' in.vcf | wc -c
ADD REPLY

Login before adding your answer.

Traffic: 1441 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6