docs: def merge_overlaps(work_dir, bed_fpath, distance=None):
      """Merge bed file intervals to avoid overlapping regions.
      Overlapping regions (1:1-100, 1:90-100) cause issues with callers like FreeBayes
      that don't collapse BEDs prior to using them.
      """
      output_fpath = intermediate_fname(work_dir, bed_fpath, 'merged')
      if isfile(output_fpath) and verify_file(output_fpath, cmp_f=bed_fpath):
          return output_fpath
  
      with file_transaction(work_dir, output_fpath) as tx:
          kwargs = dict(d=distance) if distance else dict()
          BedTool(bed_fpath).merge(**kwargs).saveas(tx)
      return output_fpath