This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to filter a multi-sample VCF file based on 0/0 genotype numbers

I created one multi-sample VCF file using CNVcaller program. When I checked VCF file, realized that some variants only have one 0/1 or 1/1 genotype and rest of genotypes for other samples are as 0/0. Based on my knowledge, the 0/0 genotype indicates the absence of the variant in the target sample, so I intend to remove the variants in which sample with the 0/0 genotype are more than 50% of the total samples.

Do you think the idea of removing the mentioned options is correct? How can I do this?

genotype vcf cnv

1 answer

bcftools view -i '(COUNT(GT="ref")+COUNT(GT="mis")) < {insert-correct-number-here}' input.vcf

What should be the correct number? For example, if I have 10 samples, the number should be 5 (According to the conditions that I had asked in the original question)?

Thank you Pierre, it worked for me

Log in to answer this question.