This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering no-calls from VCF file

Hi Everyone,

I want to remove all sites with more than 5% of no-call (./.) among all the samples in my VCF file, could you please guide me how I can do that variant filtration?

Thanks!

ngs vcftools

1 answer

using vcffilterjs https://github.com/lindenb/jvarkit/wiki/VCFFilterJS

 java -jar dist/vcffilterjs.jar -e 'var n=0.0;for(var i=0;i< variant.getNSamples();i++ ) { if(variant.getGenotype(i).isNoCall()) n++;} n/ variant.getNSamples() < 0.05'  input.vcf

Thanks @Pierre.. That worked perfectly fine for me..

However i am curious and interested to use VCFFILTERJS more, Could you please indicate any guideline for writing java scripts expressions particularly for VCFFILTER -e. I have seen some examples but i wanna know about basic functions like: variant.getNSamples() or variant.getGenotype().isNoCall() , etc.

Log in to answer this question.