def detect_regions(bam_in, bed_file, out_dir, prefix):
bed_file = _reorder_columns(bed_file)<EOL>counts_reads_cmd = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>with utils.chdir(out_dir):<EOL><INDENT>run(counts_reads_cmd.format(min_trimmed_read_len=min_trimmed_read_len, max_trimmed_read_len=max_trimmed_read_len, **locals()), "<STR_LIT>")<EOL>loci_file = _fix_score_column(op.join(out_dir, "<STR_LIT>"))<EOL>return loci_file<EOL><DEDENT>
Detect regions using first CoRaL module