Grouping¶
Functions for grouping BEL graphs into sub-graphs.
-
pybel.struct.grouping.
get_subgraphs_by_annotation
(graph, annotation, sentinel=None)[source]¶ Stratify the given graph into sub-graphs based on the values for edges’ annotations.
- Parameters
graph (pybel.BELGraph) – A BEL graph
annotation (str) – The annotation to group by
sentinel (Optional[str]) – The value to stick unannotated edges into. If none, does not keep undefined.
- Return type