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
Returns

A subgraph of the original BEL graph

Return type

pybel.BELGraph

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
Returns

A subgraph of the original BEL graph

Return type

pybel.BELGraph

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
Returns

A BEL graph induced around the neighborhoods of the given nodes

Return type

Optional[pybel.BELGraph]