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_path('...') >>> h = pybel.from_path('...') >>> left_full_join(g, h)
- Return type
None
-
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_path('...') >>> h = pybel.from_path('...') >>> left_outer_join(g, h)
- Return type
None
-
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_path('...') >>> h = pybel.from_path('...') >>> k = pybel.from_path('...') >>> merged = union([g, h, k])