Question: Filtering on the minor allele in VCFtools
0
gravatar for outlier95
3.0 years ago by
outlier9510
outlier9510 wrote:

Wondering how I can get the number of informative sites in a .vcf file using VCFtools. By informative I mean at least two samples share a variant. Any suggestions? Thanks.

vcftools snps • 1.4k views
ADD COMMENTlink modified 2.9 years ago by Adam990 • written 3.0 years ago by outlier9510

Not sure about VCFtools, but if you are up for trying something new, the Variant Effect Predictor gives you information on MAF for data in .vcf files. Look at the Filtering options available for the VEP including frequency i.e. MAF.

ADD REPLYlink written 2.9 years ago by Denise - Open Targets4.9k
0
gravatar for Pierre Lindenbaum
2.9 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum120k wrote:

using vcffilterjs: https://github.com/lindenb/jvarkit/wiki/VCFFilterJS add INFORMATIVE in the FILTER column for the variant having less than two samples having more than one genotype hom-ref or het. extract the FILTER column, count the number of line containing INFORMATIVE

cat input.vcf |\
java -jar dist/vcffilterjs.jar -F INFORMATIVE -e 'function accept(v) { var f=0,i;for(i=0;i<v.getNSamples();++i) {var g=v.getGenotype(i); f+=(g.isHomVar() || g.isHet()?1:0);} return f<2;}accept(variant);' |\
grep -v "^#" | cut -f 7 | grep -c INFORMATIVE

ADD COMMENTlink written 2.9 years ago by Pierre Lindenbaum120k
0
gravatar for Adam
2.9 years ago by
Adam990
United States
Adam990 wrote:
vcftools --gzvcf vcf_file --mac 2 --stdout --recode | fgrep -v '#' | wc -l
ADD COMMENTlink written 2.9 years ago by Adam990

MOD-EDIT: OP has opened a new question for this here: Identifying private and shared SNPs using VCFtools

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by outlier9510

If I remove singletons and private doubletons via --singletons and --positions using VCFtools, then take the difference in the number of SNPs before and after filtering, should that amount to the number of informative SNPs (per my definition)? Many thanks.

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by outlier9510
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: 1989 users visited in the last hour