Question: filter multi-sample vcf with SnpSift filter
2
gravatar for guillaume.rbt
5.9 years ago by
guillaume.rbt830
France
guillaume.rbt830 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.8k views
ADD COMMENTlink modified 5.9 years ago by RamRS30k • written 5.9 years ago by guillaume.rbt830
3
gravatar for Pierre Lindenbaum
5.9 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum131k 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 5.9 years ago by Pierre Lindenbaum131k

good idea, thanks! 

ADD REPLYlink written 5.9 years ago by guillaume.rbt830
1
gravatar for RamRS
5.9 years ago by
RamRS30k
Baylor College of Medicine, Houston, TX
RamRS30k wrote:

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

ADD COMMENTlink modified 12 months ago • written 5.9 years ago by RamRS30k
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: 717 users visited in the last hour