This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering of rare variants

Hello

I have exome datasets from 6 samples, in which four are affected and two are non-affected. I did joint call genotyping for all the six samples and annotated the vcf file. From this annotated vcf file, I have to look for rare variants shared by the four affected members.

First, I plan to filter all the rare variants which have allele frequency less than 1% (using Gnomad exome database in nonfinnish European population)

I don't how to proceed with next step, where look for rare variants shared by four affected individuals. So, should I check whether all the four individuals carry the alternate allele for a given variant?. Since, there is only one vcf file, how do I compare and see if the four affected individuals carry the alternate allele for a given variant?

Thanks

filtering rare variants

1 answer

using vcffilterjdk http://lindenb.github.io/jvarkit/VcfFilterJdk.html

java -jar dist/vcffilterjdk.jar  -e ' final Set<String> sns = new HashSet<>(Arrays.asList("S1","S2","S3","S4")); return variant.getGenotypes().stream().filter(G->sns.contains(G.getSampleName())).allMatch(G->G.isHet() || G.isHomVar()) && variant.getGenotypes().stream().filter(G->!sns.contains(G.getSampleName())).allMatch(G->G.isNoCall() || G.isHomRef());' in.vcf

Log in to answer this question.