import networkx as nx


def paga_degrees(adata):
    """Compute the degree of each node in the abstracted graph.

    Parameters
    ----------
    adata : AnnData
        Annotated data matrix.

    Returns
    -------
    degrees : list
        List of degrees for each node.
    """
    g = nx.Graph(adata.uns['paga']['confidence'])
    degrees = [d for _, d in g.degree(weight='weight')]
    return degrees