code: def _prep_vcf(in_file, region_bed, sample, new_sample, stats, work_dir, data):
      
      in_file = vcfutils.bgzip_and_index(in_file, data, remove_orig=False)
      out_file = os.path.join(work_dir, "%s-vprep.vcf.gz" % utils.splitext_plus(os.path.basename(in_file))[0])
      if not utils.file_uptodate(out_file, in_file):
          callable_bed = _prep_callable_bed(region_bed, work_dir, stats, data)
          with file_transaction(data, out_file) as tx_out_file:
              ann_remove = _get_anns_to_remove(in_file)
              ann_str = " | bcftools annotate -x {ann_remove}" if ann_remove else ""
              cmd = ("bcftools view -T {callable_bed} -f 'PASS,.' --min-ac '1:nref' -s {sample} {in_file} "
                     + ann_str +
                     r"| sed 's|\t{sample}|\t{new_sample}|' "
                     "| bgzip -c > {out_file}")
              do.run(cmd.format(**locals()), "Create SV validation VCF for %s" % new_sample)
      return vcfutils.bgzip_and_index(out_file, data["config"])
docs: Prepare VCF for SV validation:
  
      - Subset to passing variants
      - Subset to genotyped variants -- removes reference and no calls
      - Selects and names samples
      - Subset to callable regions
      - Remove larger annotations which slow down VCF processing