VCF keep only genotyped positions
1
0
Entering edit mode
3.2 years ago
sahahig469 ▴ 10

Hi,

I am working with a VCF (See screenshot) created from a gam file. In my case I am using an option that would call every covered position but as you can see in position "565982" some of them don't have a genotype. I would like to know if there is an easy way to filter my VCF recovering only my position with a genotype called ? I was thinking about doing my own script that would parse the VCF but pretty sure something is already out there doing it, but I can't find it.

Thanks a lot

PS: without using this option I would have "normal" VCF but the call 0/0 are not reported and I want to recover those aswell in my case.

Scren

vcf genotype snp • 607 views
ADD COMMENT
1
Entering edit mode
3.2 years ago
4galaxy77 2.8k

So if a GT isn't called then it is present as a zero? If so, then you can remove them by something like bcftools view -e'GT=="0"' in.bcf > out.bcf(not tested).

ADD COMMENT
1
Entering edit mode

Thanks a lot for your quick tips. It worked as expected and way quicker than coding my own one ! Thank you !

ADD REPLY

Login before adding your answer.

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