Operations
This page outlines operations that can be done to BEL graphs.
- pybel.struct.left_full_join(g, h)[source]
Add all nodes and edges from
h
tog
, in-place forg
.- Parameters
g (pybel.BELGraph) – A BEL graph
h (pybel.BELGraph) – A BEL graph
Example usage:
>>> import pybel >>> g = pybel.from_bel_script('...') >>> h = pybel.from_bel_script('...') >>> left_full_join(g, h)
- Return type
- pybel.struct.left_outer_join(g, h)[source]
Only add components from the
h
that are touchingg
.Algorithm:
Identify all weakly connected components in
h
Add those that have an intersection with the
g
Example usage:
>>> import pybel >>> g = pybel.from_bel_script('...') >>> h = pybel.from_bel_script('...') >>> left_outer_join(g, h)
- Return type
- pybel.struct.union(graphs, use_tqdm=False)[source]
Take the union over a collection of graphs into a new graph.
Assumes iterator is longer than 2, but not infinite.
- Parameters
- Returns
A merged graph
- Return type
Example usage:
>>> import pybel >>> g = pybel.from_bel_script('...') >>> h = pybel.from_bel_script('...') >>> k = pybel.from_bel_script('...') >>> merged = union([g, h, k])