how to filter a multi-VCF for sex-specific genotypes? I have a single VCF file of variants for a population that includes males &amp; females and I would like to pull out all variants that are sex-specific. For example, sites where all males are 0/1 and all females are 0/0. Is there a way to do this using bcftools or vcftools? I could enumerate each individual name, or ask for all individuals named *.M and *.F.

I first tried running smoove on the male and female populations separately then comparing the two VCFs, but I'm working with a draft genome with loads of contigs. As only contigs containing variants are output in each VCF, and these are different between the two files, vcftools couldn't handle the comparison. 

Someone here https://github.com/samtools/bcftools/issues/118 managed to get it working ike this: 

$bcftools view -f PASS -i 'GT~"0/0.*0/1.*0/1.*0/1.*0/1"' combined.vcf.gz


but the same syntax gives me no variants (yet I can see some that meet my criteria in IGV).
Found a great tool with SnpSift!

From the examples: I want to keep samples where the genotype for the first sample is homozygous variant and the genotype for the second sample is reference:

cat variants.vcf | java -jar SnpSift.jar filter "isHom( GEN[0] ) &amp; isVariant( GEN[0] ) &amp; isRef( GEN[1] )" &gt; filtered.vcf