Pruning a VCF file and extracting pruned in snps using bcftools
1
1
Entering edit mode
22 months ago
AVA ▴ 40

I am new to the field of genomics and have only once or twice uses the bcftools before. I have to run a LMM using RVtests (it takes vcf format as input) for which I need to calculate a kinship matrix. In order to estimate the kinship matrix for each chromosome, I need to prune the vcf file for each chromosome based on a r2 0.25. Going through some earlier posts, I understood that I can use bcftools query. I would really appreciate if someone can suggest me a command line option for pruning a chromosome vcf file and obtaining a file with pruned in snps.

SNP bcftools bcftools query • 1.7k views
0
Entering edit mode

. Going through some earlier posts, I understood that I can use bcftools query.

2
Entering edit mode
22 months ago
4galaxy77 2.5k

You are right that bcftools can be used, but not query; use bcftools +prune instead.

Something like this should work for you:

bcftools +prune -l 0.25 -w 1000 input.bcf -Ob -o output.bcf

0
Entering edit mode

Thank you. I have bcftools-1.11 and yes the above command did work but with -m instead of -l.