Induction and Expansion
Functions for building graphs that use both expansion and induction procedures.
- pybel.struct.mutation.induction_expansion.get_multi_causal_upstream(graph, nbunch)[source]
Get the union of all the 2-level deep causal upstream subgraphs from the nbunch.
- Parameters
graph (pybel.BELGraph) – A BEL graph
nbunch (
Union
[BaseEntity
,Iterable
[BaseEntity
]]) – A BEL node or list of BEL nodes
- Returns
A subgraph of the original BEL graph
- Return type
- pybel.struct.mutation.induction_expansion.get_multi_causal_downstream(graph, nbunch)[source]
Get the union of all of the 2-level deep causal downstream subgraphs from the nbunch.
- Parameters
graph (pybel.BELGraph) – A BEL graph
nbunch (
Union
[BaseEntity
,Iterable
[BaseEntity
]]) – A BEL node or list of BEL nodes
- Returns
A subgraph of the original BEL graph
- Return type
- pybel.struct.mutation.induction_expansion.get_subgraph_by_second_neighbors(graph, nodes, filter_pathologies=False)[source]
Get a graph around the neighborhoods of the given nodes and expand to the neighborhood of those nodes.
Returns none if none of the nodes are in the graph.
- Parameters
graph (pybel.BELGraph) – A BEL graph
nodes (
Iterable
[BaseEntity
]) – An iterable of BEL nodesfilter_pathologies (
bool
) – Should expansion take place around pathologies?
- Returns
A BEL graph induced around the neighborhoods of the given nodes
- Return type
Optional[pybel.BELGraph]