Question: How to set genotypes with low GQ to missing. in a vcf file.
0
gravatar for Apprentice
12 months ago by
Apprentice10
Apprentice10 wrote:

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 sequence genome • 474 views
ADD COMMENTlink modified 4 weeks ago by silvia.shuchang.liu10 • written 12 months ago by Apprentice10
1
gravatar for silvia.shuchang.liu
4 weeks ago by
silvia.shuchang.liu10 wrote:

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 COMMENTlink written 4 weeks ago by silvia.shuchang.liu10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 958 users visited in the last hour