def get_dgs(align_dg_dict):
    """
    Function that creates inverse dictionary of align_dg_dict
    align_dg_dict: dict. Dictionary of alignments and clustering DG assignments
    Returns dg_align_dict: dict, k=dg_id, v=[alignids]
    align_dg_dict comes from get_spectral(graph) or get_cliques(graph)
    """
    dgs_list = set(align_dg_dict.values()) #list of all duplex groups
    dg_align_dict = {}
    for dg in dgs_list:
        dg_align_list =[x for (x,y) in align_dg_dict.items() if y == dg]
        dg_align_dict[dg] = dg_align_list
    return dg_align_dict
    #test case: