This is a test version of Biostars. For the public version, visit https://www.biostars.org.
filter varaints from vcf sample based on their presence in N number of samples ?

Is there any command in vcftools / bcftools aur any other tool to separate variants based on their presence in N number of samples. E.g I have 20 samples in a merged vcf file. I want to separate variants present in a minimum of 15 samples.. ?

vcf snp alignment

1 answer

not tested.

 bcftools view -i 'N_PASS(GT!="mis" && GT!="RR")>=15 ' input.vcf.gz

Log in to answer this question.