def regions2dict(regions):
    """
    Convert a 2d array into a dict
    """
    reg_dict = {}
    for chrid, start, end in regions:
        if chrid not in reg_dict:
            reg_dict[chrid] = []
        reg_dict[chrid].append([start, end])
    return reg_dict
