def parse_read_id(read_id, tag=None):
    """
    Extract metadata from a read ID

    Parameters
    ----------
    read_id : str
        Read ID
    tag : str
        Tag to extract from metadata
    """
    split_info = read_id.split(':')
    tags = ['instrument', 'run', 'flowcell', 'lane', 'tile', 'x', 'y']
    meta = dict(zip(tags, split_info))
    if tag is not None and tag in tags:
        return meta[tag]
    else:
        return meta
