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
- 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
- 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
- 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
- pybel.struct.mutation.expansion.expand_internal(universe, graph)[source]¶
Expand on edges between entities in the sub-graph that pass the given filters, in place.
- pybel.struct.mutation.expansion.expand_upstream_causal(universe, graph)[source]¶
Add the upstream causal relations to the given sub-graph.
- 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 sub-graph.
- 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