Question: filter multi-sample vcf with SnpSift filter
gravatar for guillaume.rbt
6.1 years ago by
guillaume.rbt830 wrote:


I am currently trying to filter a multi-sample vcf file obtained with samtools mpileup. I would like to keep the positions with all samples depths > 4.

I found a way with SnpSift filter, but I have to specify each sample one by one:

cat test.vcf | java -jar SnpSift.jar filter "(GEN[0].DP>4) & (GEN[1].DP>4) & ... & (GEN[66].DP>4)" > filtered.vcf

(i've got 66 samples ... ) 

Does anyone know how to apply this filtering option to all samples without specifying each samples one by one? (GEN[*] does not seem to work)

Moreover i would like to apply others genotype calling filters on subsets of my samples, is there a way to apply a filter to a specific subset?   




snp next-gen • 4.0k views
ADD COMMENTlink modified 6.1 years ago by _r_am32k • written 6.1 years ago by guillaume.rbt830
gravatar for Pierre Lindenbaum
6.1 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum133k wrote:

how about generating the script ?


cat test.vcf | java -jar SnpSift.jar filter  `seq 1 66 | awk '{ printf("%s (GEN[%d].DP>4) ",(NR==1?"":" & "), $1);}'`


see also my tool : to filter with javascript.

ADD COMMENTlink written 6.1 years ago by Pierre Lindenbaum133k

good idea, thanks! 

ADD REPLYlink written 6.1 years ago by guillaume.rbt830
gravatar for _r_am
6.1 years ago by
Baylor College of Medicine, Houston, TX
_r_am32k wrote:

The -minDP option in vcftools might help. Reference link here

ADD COMMENTlink modified 15 months ago • written 6.1 years ago by _r_am32k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 967 users visited in the last hour