code: def make_het_matrix(fn):
      
      # TODO: parallelize?
      vcf_df = vcf_as_df(fn)
      variant_ids = vcf_df.apply(lambda x: df_variant_id(x), axis=1)
      vcf_reader = pyvcf.Reader(open(fn, 'r'))
      record = vcf_reader.next()
      hets = pd.DataFrame(0, index=variant_ids,
                          columns=[x.sample for x in record.samples])
      
      vcf_reader = pyvcf.Reader(open(fn, 'r'))
      for record in vcf_reader:
          h = record.get_hets()
          i = record_variant_id(record)
          hets.ix[i, [x.sample for x in h]] = 1
      
      return hets
docs: Make boolean matrix of samples by variants. One indicates that the sample is
      heterozygous for that variant.
  
      Parameters:
      -----------
      vcf : str
          Path to VCF file.