def tiles(bwpath, tile_ids, chromsizes_map={}, chromsizes=None):
    '\n    Generate tiles from a bigwig file.\n\n    Parameters\n    ----------\n    tileset: tilesets.models.Tileset object\n        The tileset that the tile ids should be retrieved from\n    tile_ids: [str,...]\n        A list of tile_ids (e.g. xyx.0.0) identifying the tiles\n        to be retrieved\n    chromsizes_map: {uid: []}\n        A set of chromsizes listings corresponding to the parameters of the\n        tile_ids. To be used if a chromsizes id is passed in with the tile id\n        with the `|cos:id` tag in the tile id\n    chromsizes: [[chrom, size],...]\n        A 2d array containing chromosome names and sizes. Overrides the\n        chromsizes in chromsizes_map\n\n    Returns\n    -------\n    tile_list: [(tile_id, tile_data),...]\n        A list of tile_id, tile_data tuples\n    '
    TILE_SIZE = 1024
    generated_tiles = []
    for tile_id in tile_ids:
        tile_option_parts = tile_id.split('|')[1:]
        tile_no_options = tile_id.split('|')[0]
        tile_id_parts = tile_no_options.split('.')
        tile_position = list(map(int, tile_id_parts[1:3]))
        return_value = (tile_id_parts[3] if (len(tile_id_parts) > 3) else 'mean')
        aggregation_mode = (return_value if (return_value in aggregation_modes) else 'mean')
        range_mode = (return_value if (return_value in range_modes) else None)
        tile_options = dict([o.split(':') for o in tile_option_parts])
        if chromsizes:
            chromnames = [c[0] for c in chromsizes]
            chromlengths = [int(c[1]) for c in chromsizes]
            chromsizes_to_use = pd.Series(chromlengths, index=chromnames)
        else:
            chromsizes_id = None
            if ('cos' in tile_options):
                chromsizes_id = tile_options['cos']
            if (chromsizes_id in chromsizes_map):
                chromsizes_to_use = chromsizes_map[chromsizes_id]
            else:
                chromsizes_to_use = None
        zoom_level = tile_position[0]
        tile_pos = tile_position[1]
        if (chromsizes_to_use is None):
            chromsizes_to_use = get_chromsizes(bwpath)
        max_depth = get_quadtree_depth(chromsizes_to_use)
        tile_size = (TILE_SIZE * (2 ** (max_depth - zoom_level)))
        start_pos = (tile_pos * tile_size)
        end_pos = (start_pos + tile_size)
        dense = get_bigwig_tile(bwpath, zoom_level, start_pos, end_pos, chromsizes_to_use, aggregation_mode=aggregation_mode, range_mode=range_mode)
        tile_value = hgfo.format_dense_tile(dense)
        generated_tiles += [(tile_id, tile_value)]
    return generated_tiles
Generate tiles from a bigwig file.

Parameters
----------
tileset: tilesets.models.Tileset object
    The tileset that the tile ids should be retrieved from
tile_ids: [str,...]
    A list of tile_ids (e.g. xyx.0.0) identifying the tiles
    to be retrieved
chromsizes_map: {uid: []}
    A set of chromsizes listings corresponding to the parameters of the
    tile_ids. To be used if a chromsizes id is passed in with the tile id
    with the `|cos:id` tag in the tile id
chromsizes: [[chrom, size],...]
    A 2d array containing chromosome names and sizes. Overrides the
    chromsizes in chromsizes_map

Returns
-------
tile_list: [(tile_id, tile_data),...]
    A list of tile_id, tile_data tuples
def tiles(bwpath, tile_ids, chromsizes_map={}, chromsizes=None):
    '\n    Generate tiles from a bigwig file.\n\n    Parameters\n    ----------\n    tileset: tilesets.models.Tileset object\n        The tileset that the tile ids should be retrieved from\n    tile_ids: [str,...]\n        A list of tile_ids (e.g. xyx.0.0) identifying the tiles\n        to be retrieved\n    chromsizes_map: {uid: []}\n        A set of chromsizes listings corresponding to the parameters of the\n        tile_ids. To be used if a chromsizes id is passed in with the tile id\n        with the `|cos:id` tag in the tile id\n    chromsizes: [[chrom, size],...]\n        A 2d array containing chromosome names and sizes. Overrides the\n        chromsizes in chromsizes_map\n\n    Returns\n    -------\n    tile_list: [(tile_id, tile_data),...]\n        A list of tile_id, tile_data tuples\n    '
    TILE_SIZE = 1024
    generated_tiles = []
    for tile_id in tile_ids:
        tile_option_parts = tile_id.split('|')[1:]
        tile_no_options = tile_id.split('|')[0]
        tile_id_parts = tile_no_options.split('.')
        tile_position = list(map(int, tile_id_parts[1:3]))
        return_value = (tile_id_parts[3] if (len(tile_id_parts) > 3) else 'mean')
        aggregation_mode = (return_value if (return_value in aggregation_modes) else 'mean')
        range_mode = (return_value if (return_value in range_modes) else None)
        tile_options = dict([o.split(':') for o in tile_option_parts])
        if chromsizes:
            chromnames = [c[0] for c in chromsizes]
            chromlengths = [int(c[1]) for c in chromsizes]
            chromsizes_to_use = pd.Series(chromlengths, index=chromnames)
        else:
            chromsizes_id = None
            if ('cos' in tile_options):
                chromsizes_id = tile_options['cos']
            if (chromsizes_id in chromsizes_map):
                chromsizes_to_use = chromsizes_map[chromsizes_id]
            else:
                chromsizes_to_use = None
        zoom_level = tile_position[0]
        tile_pos = tile_position[1]
        if (chromsizes_to_use is None):
            chromsizes_to_use = get_chromsizes(bwpath)
        max_depth = get_quadtree_depth(chromsizes_to_use)
        tile_size = (TILE_SIZE * (2 ** (max_depth - zoom_level)))
        start_pos = (tile_pos * tile_size)
        end_pos = (start_pos + tile_size)
        dense = get_bigwig_tile(bwpath, zoom_level, start_pos, end_pos, chromsizes_to_use, aggregation_mode=aggregation_mode, range_mode=range_mode)
        tile_value = hgfo.format_dense_tile(dense)
        generated_tiles += [(tile_id, tile_value)]
    return generated_tiles