code: def _create_subset_file(in_file, het_region_bed, work_dir, data):
      
      cnv_regions = shared.get_base_cnv_regions(data, work_dir)
      region_bed = bedutils.intersect_two(het_region_bed, cnv_regions, work_dir, data)
      out_file = os.path.join(work_dir, "%s-origsubset.bcf" % utils.splitext_plus(os.path.basename(in_file))[0])
      if not utils.file_uptodate(out_file, in_file):
          with file_transaction(data, out_file) as tx_out_file:
              regions = ("-R %s" % region_bed) if utils.file_exists(region_bed) else ""
              cmd = "bcftools view {regions} -o {tx_out_file} -O b {in_file}"
              do.run(cmd.format(**locals()), "Extract regions for BubbleTree frequency determination")
      return out_file
docs: Subset the VCF to a set of pre-calculated smaller regions.