I installed the tool and ran the command above but it showing some errors like "java.lang.RuntimeException: Cannot compile" and is not producing any output.
Hello all ,
I have a multi sample vcf file of 1000 individuals for one gene . Some of the samples do not have any variants in them like "0/0".I want to filter them out and keep only the samples with variants associated like "0/1" and "1/1".How can I do this .Kindly give a command and tool for the same .
1 answer
using http://lindenb.github.io/jvarkit/VcfFilterJdk.html
java -jar dist/vcffilterjdk.jar -e 'final Set<String> samples=new HashSet<>(Arrays.asList("S2","S3")); return samples.stream().map(S->variant.getGenotype(S)).allMatch(G->G.isHet() || G.isHomVar()) && variant.getGenotypes().stream().filter(G->!samples.contains(G.getSampleName())).noneMatch(G->G.isHet() || G.isHomVar());' in.vcf.gz
show me the command and the complet stack trace
git clone "https://github.com/lindenb/jvarkit.git"
cd jvarkit
./gradlew vcffilterjdk
java -jar dist/vcffilterjdk.jar -e 'final Set<String> samples=new HashSet<>(Arrays.asList("S2","S3")); return samples.stream().map(S->variant.getGenotype(S)).allMatch(G->G.isHet() || G.isHomVar()) && variant.getGenotypes().stream().filter(G->!samples.contains(G.getSampleName())).noneMatch(G->G.isHet() || G.isHomVar());' aqp1.1000g.vcf.gz
S2 and S3 should be your sample names...
I have vcf file wth 1000 samples and i need only those samples which contain variants like 0/1 ,1/0 and 1/1 and remove samples with 0/0 . so what should I write in place of s1 and s2
Ah, so your question was not clear to me ; You cannot remove samples from a VCF file for one variant and not for the other variants of the file.
Thank you . Now I have annotated multi sample vcf file using snpEff . How can I filter exonic variants in the separate file and intronic as well as other UTRs in separate file .which command can I use to separate out exonic variants .
this is unrelated to your original question.
Log in to answer this question.
you could use
bcftools viewfor that, check the doc here: http://samtools.github.io/bcftools/bcftools.html#viewThanks you .What command should I precisely use from that ?