I have a VCF file and I want to generate a new VCF file with the variants which have only FILTER as "PASS" left
I tried
1) grep 4751snpf.vcf > 4751PASS.vcf | grep “FILTER=PASS”
2) grep 4751snpf.vcf > 4751PASS.vcf | grep “PASS”
They both failed. Here is the VCF file looks like:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT MO_4751
chr10 3124905 . A C 7797.30 PASS ABHet=0.588;ABHom=0.995;
AC=1;AF=0.500;AN=2;BaseQRankSum=-4.919;DP=8;Dels=0.00;FS=7.563;HaplotypeScore=0.
4537;InbreedingCoeff=-0.5755;MQ=55.56;MQ0=1;MQRankSum=-4.937;OND=3.265e-03;QD=12
.97;ReadPosRankSum=5.683 GT:AD:DP:GQ:PL 0/1:7,1:8:9:9,0,228
chr10 3176529 . G T 6361.10 PASS ABHet=0.651;ABHom=0.864;
AC=1;AF=0.500;AN=2;BaseQRankSum=-9.379;DP=14;Dels=0.01;FS=0.292;HaplotypeScore=5
.7125;InbreedingCoeff=-0.7938;MQ=55.81;MQ0=0;MQRankSum=-7.360;OND=0.035;QD=8.60;
ReadPosRankSum=-2.204 GT:AD:DP:GQ:PL 0/1:9,5:14:99:109,0,266
chr10 3257558 . A C 349.31 LowCoverage ABHet=0.543;ABHo
m=1.00;AC=1;AF=0.500;AN=2;BaseQRankSum=-1.917;DP=3;Dels=0.00;FS=1.412;HaplotypeS
core=0.4039;InbreedingCoeff=0.0676;MQ=54.44;MQ0=0;MQRankSum=-2.510;QD=15.88;Read
PosRankSum=-1.127 GT:AD:DP:GQ:PL 0/1:2,1:3:26:26,0,63
chr10 3505793 . A C 406.07 LowCoverage ABHet=0.556;ABHo
m=0.885;AC=1;AF=0.500;AN=2;BaseQRankSum=-0.055;DP=2;Dels=0.00;FS=136.819;Haploty
peScore=0.2675;InbreedingCoeff=-0.1981;MQ=48.36;MQ0=0;MQRankSum=-3.192;OND=0.090
;QD=7.66;ReadPosRankSum=-1.637 GT:AD:DP:GQ:PL 0/1:1,1:2:21:21,0,27
Just found that vcftool has --remove-filtered-all. Has anyone tried it?