This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Remove sites with heterozygote excess with VCFtools

I am trying to filter out SNPs with heterozygote excess p-value less than 0.05 using VCFtools, but I can't find a command that allows me to do this. I have tried doing that using the --hwe command, but this seems to do the filtering based on the HWE p-value, removing more than I actually need do. On the other hand, the --hardy command creates a .hwe file, where I can check manually the problematic sites, but still I don't get how I can remove them from the original .vcf file. Any ideas/suggestions on how to proceed?

snps genomics vcftools hetexcess

1 answer

vcftools is depcrecated - don't use it anymore

bcftools +fill-tags in.bcf -Ou -- -t all | bcftools view -e'HWE<=0.05' > out.bcf

Log in to answer this question.