def METHOD_NAME(species, ref, start, stop, strand):
    transcript_count = 0
    regions = list(range(start, stop, max_region))
    if not regions or regions[-1] < stop:
        regions.append(stop)
    for end in regions[1:]:
        bedlines = get_transcripts_bed(species, ref, start, end,
                                       strand=strand, params=biotypes)
        if args.debug:
            print("%s\t%s\tstart: %d\tend: %d\tcDNA transcripts:%d" %
                  (species, ref, start, end, len(bedlines)),
                  file=sys.stderr)
        # start, end, seq
        for i, bedline in enumerate(bedlines):
            if args.debug:
                print("%s\n" % (bedline), file=sys.stderr)
            if not args.ucsc_chrom_names:
                bedline = re.sub('^[^\t]+', ref, bedline)
            try:
                if out_wtr:
                    out_wtr.write(bedline.replace(',\t', '\t')
                                  if args.extended_bed
                                  else str(bed_from_line(bedline)))
                    out_wtr.write("\n")
                    out_wtr.flush()
            except Exception as e:
                print("BED error (%s) : %s\n" % (e, bedline),
                      file=sys.stderr)
        start = end + 1
    return transcript_count