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.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
source (pybel.BELGraph) – A BEL graph
target (pybel.BELGraph) – A BEL graph
edge_predicates (
Union
[Callable
[[BELGraph
,BaseEntity
,BaseEntity
,str
],bool
],Iterable
[Callable
[[BELGraph
,BaseEntity
,BaseEntity
,str
],bool
]]]) – An edge predicate or list of edge predicates
- Returns
A BEL sub-graph induced over the edges passing the given filters
- Return type