Stability¶

pybel_tools.analysis.stability.
get_contradiction_summary
(graph)[source]¶ Yield triplets of (source node, target node, set of relations) for (source node, target node) pairs that have multiple, contradictory relations.
Parameters: graph (pybel.BELGraph) – A BEL graph Return type: iter[tuple]

pybel_tools.analysis.stability.
get_regulatory_pairs
(graph)[source]¶ Finds pairs of nodes that have mutual causal edges that are regulating each other such that
A > B
andB  A
.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: A set of pairs of nodes with mutual causal edges Return type: set

pybel_tools.analysis.stability.
get_chaotic_pairs
(graph)[source]¶ Finds pairs of nodes that have mutual causal edges that are increasing each other such that
A > B
andB > A
.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: A set of pairs of nodes with mutual causal edges Return type: set

pybel_tools.analysis.stability.
get_dampened_pairs
(graph)[source]¶ Finds pairs of nodes that have mutual causal edges that are decreasing each other such that
A  B
andB  A
.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: A set of pairs of nodes with mutual causal edges Return type: set

pybel_tools.analysis.stability.
get_correlation_graph
(graph)[source]¶ Extracts a graph of only correlative relationships
Parameters: graph (pybel.BELGraph) – A BEL Graph Return type: networkx.Graph

pybel_tools.analysis.stability.
get_correlation_triangles
(graph)[source]¶ Returns a set of all triangles pointed by the given node
Parameters: graph (networkx.Graph) – A nondirectional graph Return type: set[tuple]

pybel_tools.analysis.stability.
get_triangles
(graph)[source]¶ Gets a set of triples representing the 3cycles from a directional graph. Each 3cycle is returned once, with nodes in sorted order.
Parameters: graph (networkx.DiGraph) – A directional graph Return type: set[tuple]

pybel_tools.analysis.stability.
get_separate_unstable_correlation_triples
(graph)[source]¶ Yields all triples of nodes A, B, C such that
A positiveCorrelation B
,A positiveCorrelation C
, andB negativeCorrelation C
Parameters: graph (pybel.BELGraph) – A BEL graph Returns: An iterator over triples of unstable graphs, where the second two are negative Return type: iter[tuple]

pybel_tools.analysis.stability.
get_mutually_unstable_correlation_triples
(graph)[source]¶ Yields all triples of nodes A, B, C such that
A negativeCorrelation B
,B negativeCorrelation C
, andC negativeCorrelation A
.Parameters: graph (pybel.BELGraph) – A BEL graph Return type: iter[tuple]

pybel_tools.analysis.stability.
jens_transformation_alpha
(graph)[source]¶ Applies Jens’ transformation (Type 1) to the graph
 Induce a subgraph over causal + correlative edges
 Transform edges by the following rules:
 increases => increases
 decreases => backwards increases
 positive correlation => two way increases
 negative correlation => delete
The resulting graph can be used to search for 3cycles, which now symbolize unstable triplets where
A > B
,A  C
andB positiveCorrelation C
.Parameters: graph (pybel.BELGraph) – A BEL graph Return type: networkx.DiGraph

pybel_tools.analysis.stability.
jens_transformation_beta
(graph)[source]¶ Applies Jens’ Transformation (Type 2) to the graph
 Induce a subgraph over causal and correlative relations
 Transform edges with the following rules:
 increases => backwards decreases
 decreases => decreases
 positive correlation => delete
 negative correlation => two way decreases
The resulting graph can be used to search for 3cycles, which now symbolize stable triples where
A > B
,A  C
andB negativeCorrelation C
.Parameters: graph (pybel.BELGraph) – A BEL graph Return type: networkx.DiGraph

pybel_tools.analysis.stability.
get_jens_unstable
(graph)[source]¶ Yields triples of nodes where
A > B
,A  C
, andC positiveCorrelation A
. Calculated efficiently using the Jens Transformation.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: An iterable of triplets of nodes Return type: iter[tuple]

pybel_tools.analysis.stability.
get_increase_mismatch_triplets
(graph)[source]¶ Iterates over triples of nodes where
A > B
,A > C
, andC negativeCorrelation A
.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: An iterable of triplets of nodes Return type: iter[tuple]

pybel_tools.analysis.stability.
get_decrease_mismatch_triplets
(graph)[source]¶ Iterates over triplets of nodes where
A  B
,A  C
, andC negativeCorrelation A
.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: An iterable of triplets of nodes Return type: iter[tuple]

pybel_tools.analysis.stability.
get_chaotic_triplets
(graph)[source]¶ Iterates over triples of nodes that mutually increase each other, such as when
A > B
,B > C
, andC > A
.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: An iterable of triplets of nodes Return type: iter[tuple]

pybel_tools.analysis.stability.
get_dampened_triplets
(graph)[source]¶ Iterates over triples of nodes that mutually decreases each other, such as when
A  B
,B  C
, andC  A
.Parameters: graph (pybel.BELGraph) – A BEL graph Returns: An iterable of triplets of nodes Return type: iter[tuple]

pybel_tools.analysis.stability.
summarize_stability
(graph)[source]¶ Summarize the stability of the graph
Parameters: graph (pybel.BELGraph) – A BEL graph Return type: dict