def get_bigwig_tile(bwpath, zoom_level, start_pos, end_pos, chromsizes=None, aggregation_mode='mean', range_mode=None):
    if (chromsizes is None):
        chromsizes = get_chromsizes(bwpath)
    resolutions = get_zoom_resolutions(chromsizes)
    binsize = resolutions[zoom_level]
    cids_starts_ends = list(abs2genomic(chromsizes, start_pos, end_pos))
    with ThreadPoolExecutor(max_workers=16) as e:
        arrays = list(e.map(fetch_data, [tuple(([bwpath, binsize, chromsizes, aggregation_mode, range_mode] + list(c))) for c in cids_starts_ends]))
    return np.concatenate(arrays)
def get_bigwig_tile(bwpath, zoom_level, start_pos, end_pos, chromsizes=None, aggregation_mode='mean', range_mode=None):
    if (chromsizes is None):
        chromsizes = get_chromsizes(bwpath)
    resolutions = get_zoom_resolutions(chromsizes)
    binsize = resolutions[zoom_level]
    cids_starts_ends = list(abs2genomic(chromsizes, start_pos, end_pos))
    with ThreadPoolExecutor(max_workers=16) as e:
        arrays = list(e.map(fetch_data, [tuple(([bwpath, binsize, chromsizes, aggregation_mode, range_mode] + list(c))) for c in cids_starts_ends]))
    return np.concatenate(arrays)