This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BCFTools view equivelent of GATK -T SelectVariants -sn sample_x --excludeNonVariants

What is the bcftools view equivalent parameter of GATK SelectVariants --excludeNonVariants?

https://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_variantutils_SelectVariants.php

GATK SelectVariants has the option with the --excludeNonVariants parameter to exclude variants that only have hom-ref genotype calls after sub setting to a set of samples.

I would like to know how to do the same with BCFTools view.

I don't see a similar switch specified in the BCFTools view documentation: https://samtools.github.io/bcftools/bcftools.html#view

bcftools gatk

2 answers

How about

bcftools view -c1 input.vcf

to select sites with at least one non-ref allele?

Thanks. This seems to work, at least I don't see any sole GT 0|0 records.

Try

bcftools filter --exclude 'TYPE="ref"' input.vcf

Tried that but it does not work. Still have records with sole genotype being GT 0|0.

Need to run BCFtools view btw, first. Tried adding the exclude command to the view command or in a bcftools filter command after sub setting the samples.

Log in to answer this question.