code: def _input_to_bed(theta_input, work_dir, get_coords, headers):
      
      theta_bed = os.path.join(work_dir, "%s.bed" % os.path.splitext(os.path.basename(theta_input))[0])
      with open(theta_input) as in_handle:
          with open(theta_bed, "w") as out_handle:
              for line in in_handle:
                  if not line.startswith(headers):
                      chrom, start, end = get_coords(line)
                      out_handle.write("\t".join([chrom, start, end]) + "\n")
      return theta_bed
docs: Convert input file to a BED file for comparisons