Question: filter multi-sample vcf with SnpSift filter
2
gravatar for guillaume.rbt
4.7 years ago by
guillaume.rbt620
France
guillaume.rbt620 wrote:

Hi,

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?   

 

Thanks

 

snp next-gen • 3.2k views
ADD COMMENTlink modified 4.7 years ago by RamRS23k • written 4.7 years ago by guillaume.rbt620
3
gravatar for Pierre Lindenbaum
4.7 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum122k 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 : https://github.com/lindenb/jvarkit/wiki/VCFFilterJS to filter with javascript.

ADD COMMENTlink written 4.7 years ago by Pierre Lindenbaum122k

good idea, thanks! 

ADD REPLYlink written 4.7 years ago by guillaume.rbt620
1
gravatar for RamRS
4.7 years ago by
RamRS23k
Houston, TX
RamRS23k wrote:

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

ADD COMMENTlink modified 4.7 years ago • written 4.7 years ago by RamRS23k
Please log in to add an answer.

Help
Access

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