Expansion¶
Mutations that expand the graph.

pybel.struct.mutation.expansion.
expand_node_predecessors
(universe, graph, node)[source]¶ Expand around the predecessors of the given node in the result graph.
 Parameters
universe (
BELGraph
) – The graph containing the stuff to addgraph (
BELGraph
) – The graph to add stuff tonode (
BaseEntity
) – A BEL node

pybel.struct.mutation.expansion.
expand_node_successors
(universe, graph, node)[source]¶ Expand around the successors of the given node in the result graph.
 Parameters
universe (
BELGraph
) – The graph containing the stuff to addgraph (
BELGraph
) – The graph to add stuff tonode (
BaseEntity
) – A BEL node
 Return type
None

pybel.struct.mutation.expansion.
expand_node_neighborhood
(universe, graph, node)[source]¶ Expand around the neighborhoods of the given node in the result graph.
Note: expands complexes’ members
 Parameters
universe (
BELGraph
) – The graph containing the stuff to addgraph (
BELGraph
) – The graph to add stuff tonode (
BaseEntity
) – A BEL node
 Return type
None

pybel.struct.mutation.expansion.
expand_nodes_neighborhoods
(universe, graph, nodes)[source]¶ Expand around the neighborhoods of the given node in the result graph.
 Parameters
universe (
BELGraph
) – The graph containing the stuff to addgraph (
BELGraph
) – The graph to add stuff tonodes (
Iterable
[BaseEntity
]) – Nodes from the query graph
 Return type
None

pybel.struct.mutation.expansion.
expand_all_node_neighborhoods
(universe, graph, filter_pathologies=False)[source]¶ Expand the neighborhoods of all nodes in the given graph.
 Parameters
universe (pybel.BELGraph) – The graph containing the stuff to add
graph (pybel.BELGraph) – The graph to add stuff to
filter_pathologies (
bool
) – Should expansion take place around pathologies?
 Return type
None

pybel.struct.mutation.expansion.
expand_internal
(universe, graph)[source]¶ Expand on edges between entities in the subgraph that pass the given filters, in place.
 Parameters
universe (
BELGraph
) – The full graphgraph (
BELGraph
) – A subgraph to find the upstream information
 Return type
None

pybel.struct.mutation.expansion.
expand_upstream_causal
(universe, graph)[source]¶ Add the upstream causal relations to the given subgraph.
 Parameters
universe (pybel.BELGraph) – A BEL graph representing the universe of all knowledge
graph (pybel.BELGraph) – The target BEL graph to enrich with upstream causal controllers of contained nodes

pybel.struct.mutation.expansion.
expand_downstream_causal
(universe, graph)[source]¶ Add the downstream causal relations to the given subgraph.
 Parameters
universe (pybel.BELGraph) – A BEL graph representing the universe of all knowledge
graph (pybel.BELGraph) – The target BEL graph to enrich with upstream causal controllers of contained nodes