how to filter a multi-sample VCF file based on 0/0 genotype numbers
1
0
Entering edit mode
15 months ago
reza ▴ 300

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 • 992 views
ADD COMMENT
2
Entering edit mode
15 months ago
bcftools view -i '(COUNT(GT="ref")+COUNT(GT="mis")) < {insert-correct-number-here}' input.vcf
ADD COMMENT
0
Entering edit mode

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)?

ADD REPLY
0
Entering edit mode

the number should be 5

yes

ADD REPLY
0
Entering edit mode

Thank you Pierre, it worked for me

ADD REPLY

Login before adding your answer.

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