Biostar Beta. Not for public use.
Keep variants with 0% missing in VCF
2
Entering edit mode
13 months ago
United Kingdom

I want to know if there is a way to keep sites with 0% missing a VCF file.

On vcftools I can do:

vcftools --vcf input_file.vcf --max-missing 1.0 --out output_noMissing

Is there a way to do this with BCFTOOLS as it is much faster?

vcf bcftools • 313 views
ADD COMMENTlink
4
Entering edit mode
14 months ago
France/Nantes/Institut du Thorax - INSE…

not tested:

 bcftools view -g  ^miss input.vcf
ADD COMMENTlink
4
Entering edit mode
4 months ago
Germany
$  bcftools view -e 'GT[*]="mis"' input.vcf

This will exclude (-e) sites where any genotype (GT[*]) is missing (="mis").

ADD COMMENTlink
3
Entering edit mode
13 months ago
Republic of Ireland

Another solution:

bcftools filter --include 'AN=2*N_SAMPLES' [VCF/BCF]

[courtesy finswimmer for N_SAMPLES part]

Pierre's, finswimmer's, and this solution all produce the exact same output (tested with diff)

ADD COMMENTlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1