filtering VCF sites and impose whatever excluded ad missing
1
0
Entering edit mode
28 days ago
Matteo Ungaro ▴ 100

Hi there I have several individual VCF files on which I'm working on to retain calls with only a depth greater than 10 and a genotype quality greater than 30. Also, I'm preserving missing sites.

However, I wonder if there is a way to set the condition so that every site excluded from the previous filters e.g. MIN(FMT/DP)>10 & MIN(FMT/GQ)>30 can be set as missing. Below the exact command I used:

bcftools view --threads 32 -i 'MIN(FMT/DP)>10 & MIN(FMT/GQ)>30 | GT[*]="mis"' -R chromosome.list $d/output/${ID}.vcf.gz -Oz -o $d/output/${ID}_filtered.vcf.gz

Let me know, thanks in advance!

conditions vcf filters bcftools • 270 views
ADD COMMENT
2
Entering edit mode
28 days ago

not sure about your query but you could play with bcftools +setGT

bcftools +setGT in.vcf.gz -- -t q -n . -i 'FORMAT/DP<10 || FORMAT/GQ < 30'
ADD COMMENT
0
Entering edit mode

@Pierre Lindenbaum I'm not familiar with +setGT... what is meant to do? Also, you mean the query I need is not easily doable just by using bcftools?

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Oh I see, I think I got it. However, this will require to first run the command you shared, and then run what I was using on top, is that the case? If so, would there be a way to do it in one command; not that it is strictly necessary but just form my understanding. Thanks again!

ADD REPLY

Login before adding your answer.

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