Pruning a VCF file and extracting pruned in snps using bcftools
1
1
Entering edit mode
3.8 years 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.

bcftools SNP • 4.4k views
ADD COMMENT
0
Entering edit mode

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

which posts please ?

ADD REPLY
3
Entering edit mode
3.8 years ago
4galaxy77 2.9k

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
ADD COMMENT
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1782 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