Mutations

General-use induction functions.

pybel.struct.mutation.utils.remove_isolated_nodes(graph)[source]

Remove isolated nodes from the network, in place.

Parameters

graph (pybel.BELGraph) – A BEL graph

pybel.struct.mutation.utils.remove_isolated_nodes_op(graph)[source]

Build a new graph excluding the isolated nodes.

Parameters

graph (pybel.BELGraph) – A BEL graph

Return type

pybel.BELGraph

pybel.struct.mutation.utils.expand_by_edge_filter(source, target, edge_predicates)[source]

Expand a target graph by edges in the source matching the given predicates.

Parameters
Returns

A BEL sub-graph induced over the edges passing the given filters

Return type

pybel.BELGraph