How to set genotypes with low GQ to missing. in a vcf file.
1
0
Entering edit mode
7.5 years ago
Apprentice ▴ 160

Hi.

I always appreciate all your help.

I have one vcf file (a.vcf).

"a.vcf"

CHROM POS ID REF ALT QUAL FILTER INFO FORMAT sample1 sample131 sample138 sample908

chr12 104350956 . G T 147880 PASS AC=1;AF=0.250;AN=4 GT:AD:DP:GQ ./.:.:0 0/1:25,22:47:99 0/0:36,0:36:99 0/1:36,3:39:30

I would like to get "b.vcf" , which the genotypes with GQ<90 were set to missing, "./." as below.

"b.vcf2

CHROM POS ID REF ALT QUAL FILTER INFO FORMAT sample1 sample131 sample138 sample908

chr12 104350956 . G T 147880 PASS AC=1;AF=0.250;AN=4 GT:AD:DP:GQ ./.:.:0 0/1:25,22:47:99 0/0:36,0:36:99 ./.:36,3:39:30

In the b.vcf, a genotype of sample908 was set to missing because of GQ<99 (GQ=30).

Could you tell me how to get the file?

I wuould like to get the file by using bcftools, if it's possible. If it's possible, could you tell me how to get the file using bcftools?

SNP genome sequence • 3.5k views
ADD COMMENT
2
Entering edit mode
6.5 years ago

You can use vcftools '--minGQ' option for genotype quality filtering

vcftools --vcf a.vcf --minGQ 90 --out b --recode

A b.recode.vcf file will be generated.

Please check man vcftool for details, https://vcftools.github.io/man_latest.html

ADD COMMENT

Login before adding your answer.

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