예제 #1
0
def bio3graph_reset_colours(input_dict):
    from triplet_extractor import graph_operations as gop
    from networkx import copy

    nwx = copy.deepcopy(input_dict['network'])
    gop.reset_edge_colors(nwx)
    return {'network': nwx}
예제 #2
0
def bio3graph_reset_colours(input_dict):
    from triplet_extractor import graph_operations as gop
    from networkx import copy

    nwx = copy.deepcopy(input_dict['network'])
    gop.reset_edge_colors(nwx)
    return {'network': nwx}
예제 #3
0
def bio3graph_colour_relations(input_dict):
    from triplet_extractor import graph_operations as gop
    from networkx import copy

    nwx = copy.deepcopy(input_dict['network'])
    rels = input_dict['relations']
    gop.colour_relations(nwx, rels)
    return {'network': nwx}
예제 #4
0
def bio3graph_colour_relations(input_dict):
    from triplet_extractor import graph_operations as gop
    from networkx import copy

    nwx = copy.deepcopy(input_dict['network'])
    rels = input_dict['relations']
    gop.colour_relations(nwx, rels)
    return {'network': nwx}
예제 #5
0
def bio3graph_remove_relations(input_dict):
    from networkx import copy

    nwx = copy.deepcopy(input_dict['network'])
    relations = input_dict['relations']
    for (fr, to, relType) in relations:
        if nwx.has_edge(fr, to, relType):
            nwx.remove_edge(fr, to, relType)
    return {'pruned_graph': nwx}
예제 #6
0
def bio3graph_remove_relations(input_dict):
    from networkx import copy

    nwx = copy.deepcopy(input_dict['network'])
    relations = input_dict['relations']
    for (fr, to, relType) in relations:
        if nwx.has_edge(fr, to, relType):
            nwx.remove_edge(fr, to, relType)
    return {'pruned_graph': nwx}