code: def _split_regions(chrom, start, end):
      
      window_size = 1e5
      if end - start < window_size * 5:
          return [(chrom, start, end)]
      else:
          out = []
          for r in pybedtools.BedTool().window_maker(w=window_size,
                                                     b=pybedtools.BedTool("%s\t%s\t%s" % (chrom, start, end),
                                                                          from_string=True)):
              out.append((r.chrom, r.start, r.end))
          return out
docs: Split regions longer than 100kb into smaller sections.