what program can do filter vcf file with below creteria? which program give me mean and SD of read depth?
i) SNPs and indels with overall quality less than 20; (ii) variants with very low or very high read depth. First we calculated the mean and standard deviation read depth for all the variants. We then set the minimum acceptable coverage as 10% of the mean and the maximum acceptable coverage as the mean read depth plus three times the standard deviation; (iii) variants with less than one forward or reverse alternative allele read; (iv) variants within 5 bp of each other; (v) SNPs within 5 bp of an indel; (vi) indels within 10 bp of each other.
2 answers
You could check out VCFtools at http://vcftools.sourceforge.net/. Otherwise, you might have to write your own script.
Convert to BED with BEDOPS vcf2bed and then do set operations with bedops and bedmap etc. on the output.
$ vcf2bed --insertions in.vcf > insertions.bed
$ vcf2bed --deletions in.vcf > deletions.bed
$ vcf2bed --snvs in.vcf > snvs.bed
http://bedops.readthedocs.io/en/latest/content/reference/file-management/conversion/vcf2bed.html
http://bedops.readthedocs.io/en/latest/content/reference/set-operations/bedops.html
http://bedops.readthedocs.io/en/latest/content/reference/set-operations/closest-features.html
http://bedops.readthedocs.io/en/latest/content/reference/statistics/bedmap.html
Log in to answer this question.
what have you tried ?
i am trying to filter my vcf file (resulted from WGS) with mentioned creteria. what is your suggestion Pierre?
i can filter vcf file with criteria such as DP, QUAL, MQ, PL using SnpSift. But writing script for mentioned criteria is hard to me.