def chr_dict(d):
    """
    Input dictionary generated by file2dict to make a new dict:
    chromosome as key name, positions as value list.
    """
    new_dict = {}
    for k in d:
        chromosome, pos = tuple(k.split('_'))
        if chromosome in new_dict:
            new_dict[chromosome].append(int(pos))
        else:
            new_dict[chromosome] = [int(pos)]
    return new_dict