2.1 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
using vcffilterjdk http://lindenb.github.io/jvarkit/VcfFilterJdk.html
an example with 3 populations
select.code:
final String POP1[]={"S1"};
final String POP2[]={"S2","S3"};
final String POP3[]={"S4","S5"};
final String ALL_POPS[][]={POP1,POP2,POP3};
for(String pop[]:ALL_POPS) {
if(Arrays.stream(pop).
map(SAMPLE->variant.getGenotype(SAMPLE)).
noneMatch(G->G.isHet() || G.isHomVar())) return false;
}
return true;
usage:
java -jar dist/vcffilterjdk.jar -f select.code input.vcf
Take a look at VCFtools
Usage guide
Many thanks for your reply,
I saw the page you shared. And the only thing I can find is the option --exclude-positions-overlap. Can you guide me more precisely?
In the first link you have different tools, as vcf-isec
See also : Obtain one vcf file of shared SNPs from input files with different samples using vcf-isec (vcftools)