def annotate_graph(g, annots):
    """
    Add node annotations to graph from annots
    nodes without a value recieve None type.

    :param g: networkx graph
    :type: networkx.Graph
    :param annots: dictionary with node annotations
    :type: dictionary

    :returns g: graph with node annotations
    """

    labels = {'binding_ion': 'ion',
            'binding_small-molecule': 'ligand'}

    for node in g.nodes():
        for label, typ in labels.items():
            try:
                annot = annots[node][typ]
            except KeyError:
                annot = None
            g.nodes[node][label] = annot

    return g