how to filter vcf file based on sample DP? vcf tools does not work
I have faced with a problem in filtering my vcf file, I am quite stuck. I have tried several options but none of them worked out. I want to do filtering at the "sample level" and keep only those with DP >=10. I have tried in VCFtools --minDP flag and --maxDP are not working!
I have tried all of these codes, non of them working
vcftools --vcf myfile.vcf --minDP 10 --recode --out out_1.vcf
bcftools filter --soft-filter 'FMT/%DP>10' my.file.vcf`
does anyone has any solution for this problem?
• 10,044 views
•
link
0 answers
No answers yet.
Log in to answer this question.
You can take a look to this thread: VCF filtering by depth
For other hand, SnpSift is a great tool for filtering VCF files. In your case the command would be:
cat variants.vcf | java -jar SnpSift.jar filter "( DP > 10)" > filtered.vcfCould you please explain what do you mean by saying " I want to do filtering at the "sample level" and keep only those with DP >=10." ?
Preferably with several lines of input and desired output as examples. So far I am not sure what do you want. Thank you
This is my input vcf file:
HanXRQChr00c0001 33657 . C A 22.0752 . AB=0.5;ABP=3.0103;AC=4;AF=0.00813008;AN=492;AO=5;CIGAR=1X;DP=796;DPB=796;DPRA=0.822335;EPP=3.44459;EPPR=8.11202;GTI=2;LEN=1;MEANALT=1;MQM=43.8;MQMR=47.6061;NS=246;NUMALT=1;ODDS=3.80224;PAIRED=1;PAIREDR=0.977128;PAO=0;PQA=0;PQR=0;PRO=0;QA=169;QR=29076;RO=787;RPL=3;RPP=3.44459;RPPR=105.787;RPR=2;RUN=1;SAF=5;SAP=13.8677;SAR=0;SRF=361;SRP=14.6678;SRR=426;TYPE=snp;technology.illumina=0 GT:DP:DPR:RO:QR:AO:QA:GL
and I want to create an out file for my population genetics analysis looks like this:
tscaffold94_798049_802097 951 NA 0 1 NA NA NA NA NA NA NA NA NA NA NA NA NA NA 0 NA NA 1 NA NA 0 NA NA NA 1 NA 1 NA NA 1 NA NA NA NA 0 NA NA 0 NA 1 NA 0 0 NA NA 1 NA 1 NA NA NA NA 1 NA NA NA NA 0 NA
I want to filter my vcf file only based on sample level DP , this is my genotype field GT:DP:DPR:RO:QR:AO:QA:GL. I am not sure if it is clear or not. Do you have any clue? Thanks a lot for taking time to respond.
Not clear to me, Maybe this is late night tired mind speaking. By any chance had iraun's suggestion helped you? If not we (or me at least) have to understand your need first and to do so we need more info. Thank you