bcftools DP filtering and recode as vcftools, but for polyploids?
1
0
Entering edit mode
4.7 years ago
dfajar2 ▴ 140

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:

SNP  REF ALT GT   RO/AO  DP
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.

Thanks

bcftools vcfools snp vcf • 3.2k views
ADD COMMENT
3
Entering edit mode
4.7 years ago

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 COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

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