code: def _sample_template(sample, out_dir):
      
      bam_fn = dd.get_work_bam(sample)
      genome = dd.get_genome_build(sample)
      if genome in supported:
          peaks = sample.get("peaks_files", []).get("main")
          if peaks:
              r_code = ("library(ChIPQC);\n"
                        "sample = ChIPQCsample(\"{bam_fn}\","
                        "\"{peaks}\", "
                        "annotation = \"{genome}\","
                        ");\n"
                        "ChIPQCreport(sample);\n")
              r_code_fn = os.path.join(out_dir, "chipqc.r")
              with open(r_code_fn, 'w') as inh:
                  inh.write(r_code.format(**locals()))
              return r_code_fn
docs: R code to get QC for one sample