VCFtools alternative to --minDP flags not working?
2
0
Entering edit mode
8.0 years ago
beausoleilmo ▴ 600

Since my VCFtools --minDP flag and --maxDP are not working, is there a way to manually code the filtering?

vcftools --vcf output.vcf --recode --recode-INFO-all --minDP 20 --maxDP 25 --out output.reference3

  84681 #CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  JP3048_for      JP3162_for      JP3171_for      JP3402_for      JP343_for       JP3539_for      JP3
  84682 scaffold440     420     .       T       G       999     .       DP=72;VDB=7.55993e-06;SGB=11.7312;RPB=0.0732065;MQB=0.00151772;MQSB=0.0740741;BQB=0.72433;MQ0F=0;AF1=0.1202
  84683 scaffold440     451     .       C       A       11.216  .       DP=71;VDB=0.0249187;SGB=-0.0412595;RPB=0.910489;MQB=0.70327;BQB=0.638446;MQ0F=0;AF1=0.0946915;AC1=10;DP4=35
  84684 scaffold440     452     .       C       A       10.3236 .       DP=71;VDB=0.02;SGB=-0.018177;RPB=1;MQB=0.162162;BQB=0.986486;MQ0F=0;AF1=0.0848011;AC1=9;DP4=37,0,2,0;MQ=42;
  84685 scaffold440     460     .       A       G       999     .       DP=71;VDB=3.01279e-43;SGB=10.0134;MQSB=0.0392157;MQ0F=0;AF1=1;AC1=112;DP4=0,0,51,2;MQ=43;FQ=-28.9555    GT:
  84686 Scaffold1210    18      .       C       T       17.1031 .       DP=5;VDB=0.0221621;SGB=0.913122;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0;AF1=0.62274;AC1=70;DP4=1,0,0,3;MQ=31;FQ=16.
  84687 Scaffold1210    23      .       A       G       17.1031 .       DP=5;VDB=0.0221621;SGB=0.913122;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0;AF1=0.62274;AC1=70;DP4=1,0,0,3;MQ=31;FQ=16.
  84688 Scaffold1210    30      .       A       G       17.1031 .       DP=5;VDB=0.0221621;SGB=0.913122;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0;AF1=0.62274;AC1=70;DP4=1,0,0,3;MQ=31;FQ=16.
  84689 scaffold420     41      .       T       G       14.1975 .       DP=2;SGB=-0.0045042;MQ0F=0;AF1=1;AC1=112;DP4=0,0,0,1;MQ=44;FQ=-22.7628  GT:PL:DP:SP:GQ  0/1:0,0,0:0:0:3 0/1
  84690 scaffold420     264     .       T       A       85.015  .       DP=4;VDB=0.0162466;SGB=-0.0739942;MQSB=0.5;MQ0F=0;AF1=1;AC1=112;DP4=0,0,2,2;MQ=31;FQ=-24.6007   GT:PL:DP:SP
  84691 scaffold420     265     .       C       A       85.015  .       DP=4;VDB=0.0162466;SGB=-0.0739942;MQSB=0.5;MQ0F=0;AF1=1;AC1=112;DP4=0,0,2,2;MQ=31;FQ=-24.6007   GT:PL:DP:SP
  84692 scaffold420     281     .       A       G       36.0512 .       DP=4;VDB=0.0138351;SGB=-0.0739942;MQSB=0.5;MQ0F=0;AF1=1;AC1=112;DP4=0,0,2,2;MQ=31;FQ=-24.5943   GT:PL:DP:SP
  84693 scaffold420     316     .       G       A       24.3268 .       DP=4;VDB=0.0389723;SGB=-0.0412595;RPB=1;MQB=1;MQSB=0.5;BQB=1;MQ0F=0;AF1=0.749149;AC1=84;DP4=1,0,1,2;MQ=31;F
  84694 scaffold420     465     .       C       T       5.65075 .       DP=3;SGB=-0.0045042;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0;AF1=0.333337;AC1=37;DP4=1,1,0,1;MQ=48;FQ=6.99776;PV4=1,
  84695 scaffold420     562     .       A       C       49.0208 .       DP=3;VDB=0.06;SGB=-0.018177;MQ0F=0;AF1=1;AC1=112;DP4=0,0,2,0;MQ=43;FQ=-23.6676  GT:PL:DP:SP:GQ  1/1:0,0,0:0
  84696 scaffold420     650     .       C       T       4.15723 .       DP=2;SGB=-0.0045042;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0.5;AF1=1;AC1=112;DP4=1,0,0,1;MQ=24;FQ=-22.0062;PV4=1,1,1
VCF Read Depth • 2.9k views
ADD COMMENT
0
Entering edit mode
8.0 years ago

GATK SelectVariants might be an alternative.

ADD COMMENT
0
Entering edit mode
8.0 years ago
igor 13k

You can also try samtools/bcftools:

bcftools query --include '%DP>20' file.vcf
ADD COMMENT
0
Entering edit mode

I've tried this, but it wasn't working...

Instead I used this:

bcftools filter --soft-filter LowQual --exclude 'INFO/DP<100 && %QUAL<20' output.vcf  > output.flts.vcf

But it's doing half of the job (both conditions are met independently but the & logical operator should match the 2 conditions referring to this):

  84684 #CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  JP3048_for      JP3162_for      JP3171_for      JP3402_for      JP343_for       JP3539_for      JP3
  84685 scaffold440     420     .       T       G       999     PASS    DP=72;VDB=7.55993e-06;SGB=11.7312;RPB=0.0732065;MQB=0.00151772;MQSB=0.0740741;BQB=0.72433;MQ0F=0;AF1=0.1202
  84686 scaffold440     451     .       C       A       11.216  LowQual DP=71;VDB=0.0249187;SGB=-0.0412595;RPB=0.910489;MQB=0.70327;BQB=0.638446;MQ0F=0;AF1=0.0946915;AC1=10;DP4=35
  84687 scaffold440     452     .       C       A       10.3236 LowQual DP=71;VDB=0.02;SGB=-0.018177;RPB=1;MQB=0.162162;BQB=0.986486;MQ0F=0;AF1=0.0848011;AC1=9;DP4=37,0,2,0;MQ=42;
  84688 scaffold440     460     .       A       G       999     PASS    DP=71;VDB=3.01279e-43;SGB=10.0134;MQSB=0.0392157;MQ0F=0;AF1=1;AC1=112;DP4=0,0,51,2;MQ=43;FQ=-28.9555    GT:
  84689 Scaffold1210    18      .       C       T       17.1031 LowQual DP=5;VDB=0.0221621;SGB=0.913122;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0;AF1=0.62274;AC1=70;DP4=1,0,0,3;MQ=31;FQ=16.
  84690 Scaffold1210    23      .       A       G       17.1031 LowQual DP=5;VDB=0.0221621;SGB=0.913122;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0;AF1=0.62274;AC1=70;DP4=1,0,0,3;MQ=31;FQ=16.
  84691 Scaffold1210    30      .       A       G       17.1031 LowQual DP=5;VDB=0.0221621;SGB=0.913122;RPB=1;MQB=1;MQSB=1;BQB=1;MQ0F=0;AF1=0.62274;AC1=70;DP4=1,0,0,3;MQ=31;FQ=16.
  84692 scaffold420     41      .       T       G       14.1975 LowQual DP=2;SGB=-0.0045042;MQ0F=0;AF1=1;AC1=112;DP4=0,0,0,1;MQ=44;FQ=-22.7628  GT:PL:DP:SP:GQ  0/1:0,0,0:0:0:3 0/1
  84693 scaffold420     264     .       T       A       85.015  PASS    DP=4;VDB=0.0162466;SGB=-0.0739942;MQSB=0.5;MQ0F=0;AF1=1;AC1=112;DP4=0,0,2,2;MQ=31;FQ=-24.6007   GT:PL:DP:SP
  84694 scaffold420     265     .       C       A       85.015  PASS    DP=4;VDB=0.0162466;SGB=-0.0739942;MQSB=0.5;MQ0F=0;AF1=1;AC1=112;DP4=0,0,2,2;MQ=31;FQ=-24.6007   GT:PL:DP:SP
  84695 scaffold420     281     .       A       G       36.0512 PASS    DP=4;VDB=0.0138351;SGB=-0.0739942;MQSB=0.5;MQ0F=0;AF1=1;AC1=112;DP4=0,0,2,2;MQ=31;FQ=-24.5943   GT:PL:DP:SP
ADD REPLY
0
Entering edit mode

It may be worth trying an older version of vcftools, if that's a possibility. I just checked on version '0.1.12a' with --minDP 1, and it worked fine.

ADD REPLY
0
Entering edit mode

I think you should be using one &. Per documentation:

FMT/DP>10  & FMT/GQ>10 .. both conditions must be satisfied within one sample
FMT/DP>10 && FMT/GQ>10 .. the conditions can be satisfied in different samples
ADD REPLY

Login before adding your answer.

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