finding unique mutations from a multi-sample VCF
2
0
Entering edit mode
7.7 years ago
firatuyulur ▴ 320

Hi all,

I have gone through many posts and couldnt find my answer. I have a vcf file of 4 samples. What I want to reach from it is the list of unique mutations among samples. Example, at position N their genotypes are as ; 0/1 0/0 0/0 0/0. In such case, this is a unique mutation for sample1 at position N. I have gathered an R script where it does what I want at the end but it is not a very useful way of doing such trivial thing. Any recommendation would be helpful.

SNP vcf • 2.5k views
ADD COMMENT
2
Entering edit mode
7.7 years ago
Floris Brenk ★ 1.0k

Why not filter on minor allele frequency using vcftools?

Using for example --max-maf you can set the maximum in this case you have 8 alleles so max allele frequency would be 0.125

http://vcftools.sourceforge.net/man_latest.html

ADD COMMENT
0
Entering edit mode
7.7 years ago

using vcfilterjs

 java -jar  dist/vcffilterjs.jar  -e 'function accept(v) { var i,n=0;for(i=0;i< v.getNSamples();++i) { var g=v.getGenotype(i); n+=(g.isHomVar() || g.isHet() ?1:0);} return n==1;} accept(variant);' input.vcf > output.vcf
ADD COMMENT

Login before adding your answer.

Traffic: 1926 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6