Question: filter multi-sample vcf with SnpSift filter
2
gravatar for guillaume.rbt
4.0 years ago by
guillaume.rbt460
France
guillaume.rbt460 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 • 2.9k views
ADD COMMENTlink modified 4.0 years ago by RamRS19k • written 4.0 years ago by guillaume.rbt460
3
gravatar for Pierre Lindenbaum
4.0 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum115k 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.0 years ago by Pierre Lindenbaum115k

good idea, thanks! 

ADD REPLYlink written 4.0 years ago by guillaume.rbt460
1
gravatar for RamRS
4.0 years ago by
RamRS19k
Houston, TX
RamRS19k wrote:

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

ADD COMMENTlink modified 4.0 years ago • written 4.0 years ago by RamRS19k
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: 1249 users visited in the last hour