filtering heterozygous genotypes
1
0
Entering edit mode
3 months ago
analyst ▴ 70

I have merged vcf file. I need to keep heterozygous genotypes with heterozygosity < 0.2.

How can I do through bcftools?

I found this command to remove heterozygous genotypes:

bcftools view -e 'GT="het"' merged_annotated_snps.vcf > merged_annotated_polymorphic_snps.vcf

How can I modify above command to retain genotypes with heterozygosity < 0.2 ?

Also my goal is to keep polymorphic alleles.

Thanks a lot

bcftools heterozygous • 518 views
ADD COMMENT
1
Entering edit mode
3 months ago

How can I modify above command to retain genotypes with heterozygosity < 0.2 ?

you meant Allele Frequency ? if INFO/AF is defined

bcftools view -i 'AF>=0.2'  in.vcf

otherwise, set AF using bcftools +fill-tags

ADD COMMENT
0
Entering edit mode

No i mean heterozygosity such as 'GT="het"'

ADD REPLY

Login before adding your answer.

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