oaklib.utilities.obograph_utils

Utilities for the OBOGraph Datamodel

See Datamodels

Functions

ancestors_with_stats(graph, curies)

Given an OBO Graph, and a list of start/seed curies, calculate various statistics about each graph node.

as_digraph(graph[, reverse, ...])

Convert to a networkx DiGraph

as_graph(graph[, reverse, filter_reflexive, ...])

Convert to a networkx DiGraph

as_multi_digraph(graph[, reverse, ...])

Convert to a networkx MultiDiGraph

compress_all_graph_ids(graph, converter)

default_stylemap_path()

depth_first_ordering(graph[, predicates])

Return a depth-first ordering of the nodes in the graph.

draw_graph(graph[, seeds, configure, ...])

Generates an image from a graph using graph_to_image then open for display

edges_from_tree(tree[, pred])

Given a parent node and a list of children, return a list of edges

expand_all_graph_ids(graph, converter)

filter_by_predicates(graph, predicates[, ...])

Create a subgraph that has only edges whose predicates are in the predicate list

graph_as_dict(graph)

Serialize a graph to a dict.

graph_id_iterator(graph)

Iterate over the ids in a graph

graph_ids(graph)

Return a set of all ids in a graph

graph_info(graph)

graph_to_d3viz_objects(graph[, predicates, ...])

graph_to_image(graph[, seeds, configure, ...])

Renders a graph to png using obographviz.

graph_to_tree_display(graph[, predicates, ...])

Translate a graph to a textual tree representation

graph_to_tree_structure(graph[, predicates, ...])

Linearizes a graph to a list of trees.

index_graph_edges_by_object(graph)

Returns an index of lists of edges keyed by object id

index_graph_edges_by_predicate(graph)

Returns an index of lists of edges keyed by predicate id

index_graph_edges_by_subject(graph)

Returns an index of lists of edges keyed by subject id

index_graph_edges_by_subject_object(graph)

Returns an index of lists of edges keyed by subject and object

index_graph_nodes(graph)

Returns an index of all nodes key by node id

induce_graph_prefix_map(graph, converter)

load_obograph_document(path)

Load an OBOGraph document from a file

merge_graph_nodes(target, source)

Merge two nodes into a single node

merge_graphs(source, target[, replace])

Merge two graphs into a single graph

mutate_graph_ids(graph, func)

Iterate over the ids in a graph and modify them.

reflexive(edge)

remove_nodes_from_graph(graph, node_ids)

Remove the specified nodes from the graph, and cascade to any edges that reference these nodes

shortest_paths(graph, start_curies[, ...])

Finds all shortest paths from a set of start nodes to a set of end nodes

topological_sort(graph, predicates)

Returns a topological sort of the graph.

tree_node_to_d3viz_object(tree_node[, ...])

trim_graph(graph, seeds[, distance, ...])

Remove all nodes more than a specified distance from a set of seed nodes

Classes

TreeFormatEnum(value)

An enumeration.

TreeNode(*[, id, lbl, meta, children, ...])