I have a VCF file and I want to remove sites that are not polymorphic sites i.e. sites where all individuals are REF/REF or ALT/ALT. Is there a quick way to do this using bcftools or vcftools?

Thanks.
Now I hopefully understand your goal. This will remove side where all samples are either hom ref or hom alt:

    $ bcftools view -e 'COUNT(GT="AA")=N_SAMPLES || COUNT(GT="RR")=N_SAMPLES' input.vcf

Have a look at the [manual][1] to explore more ways to filter `vcf` files using `bcftools`.

I've deleted my old answer, because it hasn't answer your question.


  [1]: http://www.htslib.org/doc/bcftools.html#expressions