code: def detect_regions(bam_in, bed_file, out_dir, prefix):
      
      bed_file = _reorder_columns(bed_file)
      counts_reads_cmd = ("coverageBed -s -counts -b {bam_in} "
                          "-a {bed_file} | sort -k4,4 "
                          "> {out_dir}/loci.cov")
      # with tx_tmpdir() as temp_dir:
      with utils.chdir(out_dir):
          run(counts_reads_cmd.format(min_trimmed_read_len=min_trimmed_read_len, max_trimmed_read_len=max_trimmed_read_len, **locals()), "Run counts_reads")
          loci_file = _fix_score_column(op.join(out_dir, "loci.cov"))
          return loci_file
docs: Detect regions using first CoRaL module