Question: bcftools DP filtering and recode as vcftools, but for polyploids?
gravatar for dfajar2
12 months ago by
dfajar290 wrote:

Hi, I use Freebayes as variant caller and I usually use vcftools to perform hard filtering of variants based on minimum depth values.

So for example, if any sample has a value of less than 8 reads (DP), the GT is not taken into account.

An example of the output (after using vcf-query) is:

SNP1  A   T  A/A  10/0   10
SNP2  T   G  T/G  20/40  60
SNP3  C   G  C/C  15/0   15
SNP4  T   G  G/G   0/9   9
SNP5  A   G  ./.   2/3    5

The command I use is vcftools --gzvcf input.vcf.gz --minDP 8 --recode --recode-INFO-all --out output which let me modify the GT call based on the DP value.

My main problem, is that vcftools doesn't support polyploids for this type of filtering. Is there a similar function in bcftools. If so, I cannot find it.


snp bcftools vcfools vcf • 544 views
ADD COMMENTlink modified 12 months ago • written 12 months ago by dfajar290
gravatar for finswimmer
12 months ago by
finswimmer14k wrote:

The bcftools plugin setGT might help you here:

bcftools +setGT input.vcf -- -t q -n . -i 'FORMAT/DP<8'

This would set any genotype to ./. for samples with DP<8

fin swimmer

ADD COMMENTlink written 12 months ago by finswimmer14k

Thanks!! I didn't knew about the plugins!!! It worked great.

ADD REPLYlink written 12 months ago by dfajar290

Glad finswimmer's solution worked for you, dfajar2. I've moved it to an answer. Please click on the green check mark to mark your question as resolved.


ADD REPLYlink written 12 months ago by Ram32k
Please log in to add an answer.


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