This is a test version of Biostars. For the public version, visit https://www.biostars.org.
VCFTOOLS error while trying to filter for MAF

Hi,

Im trying to filter a vcf file I've got from genomAD (Exome VCF files) for MAF > 0.01, using vcftools but I get an error I cant figure out why.

I use this command:

vcftools --vcf gnomad.exomes.r2.0.2.sites.vcf --recode --maf 0.01 --out gnomad.exomes.r2.0.2.sites.filtered.MAF01.vcf

but I get the following error "" VCFtools - UNKNOWN (C) Adam Auton and Anthony Marcketta 2009

Parameters as interpreted: --vcf gnomad.exomes.r2.0.2.sites.vcf --maf 0.01 --out gnomad.exomes.r2.0.2.sites.filtered.MAF01.vcf --recode

After filtering, kept 0 out of 0 Individuals Outputting VCF file... Error: Require Genotypes in variant file to filter by frequency and/or call rate

"" I tried to check with HTSLIB if its identified as vcf file and yes!

$ htsfile gnomad.exomes.r2.0.2.sites.vcf

gnomad.exomes.r2.0.2.sites.vcf: VCF version 4.2 variant calling text

I tried with the bgzipped version of the file which I directly get from genomAD using --gzvcf tag in vcftools, but still the same problem...

There is a similar questoin from more than a year ago without any answers: vcftools flags --mac and --max-mac giving an empty output file

It would be great if someone gives me any clue of what can be the problem!

Many thanks,

Ati

snp

1 answer

Error: Require Genotypes in variant file to filter by frequency and/or call rate

there is NO genotype in your vcf file = there is NO SAMPLE

$ wget -q -O - "https://storage.googleapis.com/gnomad-public/release/2.0.2/vcf/genomes/gnomad.genomes.r2.0.2.sites.chr1.vcf.bgz" | gunzip -c | grep CHROM -m1 | tr "\t" "\n"
#CHROM
POS
ID
REF
ALT
QUAL
FILTER
INFO

what you want is filtering using the AF field in the INFO column . Not tested: you can try to use vcftools without 'recode' or use **bcftools** filter using an include expression

Log in to answer this question.