Stability Analysis¶
-
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.
Return type: Iterable[Tuple[BaseEntity,BaseEntity,str]]
-
pybel_tools.analysis.stability.get_regulatory_pairs(graph)[source]¶ Find pairs of nodes that have mutual causal edges that are regulating each other such that
A -> BandB -| A.Return type: Set[Tuple[BaseEntity,BaseEntity]]Returns: A set of pairs of nodes with mutual causal edges
-
pybel_tools.analysis.stability.get_chaotic_pairs(graph)[source]¶ Find pairs of nodes that have mutual causal edges that are increasing each other such that
A -> BandB -> A.Return type: Set[Tuple[BaseEntity,BaseEntity]]Returns: A set of pairs of nodes with mutual causal edges
-
pybel_tools.analysis.stability.get_dampened_pairs(graph)[source]¶ Find pairs of nodes that have mutual causal edges that are decreasing each other such that
A -| BandB -| A.Return type: Set[Tuple[BaseEntity,BaseEntity]]Returns: A set of pairs of nodes with mutual causal edges
-
pybel_tools.analysis.stability.get_correlation_graph(graph)[source]¶ Extract an undirected graph of only correlative relationships.
Return type: Graph
-
pybel_tools.analysis.stability.get_correlation_triangles(graph)[source]¶ Return a set of all triangles pointed by the given node.
Return type: Set[Tuple[BaseEntity,BaseEntity,BaseEntity]]
-
pybel_tools.analysis.stability.get_triangles(graph)[source]¶ Get a set of triples representing the 3-cycles from a directional graph.
Each 3-cycle is returned once, with nodes in sorted order.
Return type: Set[Tuple[BaseEntity,BaseEntity,BaseEntity]]
-
pybel_tools.analysis.stability.get_separate_unstable_correlation_triples(graph)[source]¶ Yield all triples of nodes A, B, C such that
A pos B,A pos C, andB neg C.Return type: Iterable[Tuple[BaseEntity,BaseEntity,BaseEntity]]Returns: An iterator over triples of unstable graphs, where the second two are negative
-
pybel_tools.analysis.stability.get_mutually_unstable_correlation_triples(graph)[source]¶ Yield triples of nodes (A, B, C) such that
A neg B,B neg C, andC neg A.Return type: Iterable[Tuple[BaseEntity,BaseEntity,BaseEntity]]
-
pybel_tools.analysis.stability.jens_transformation_alpha(graph)[source]¶ Apply Jens’ transformation (Type 1) to the graph.
- Induce a sub-graph 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 3-cycles, which now symbolize unstable triplets where
A -> B,A -| CandB positiveCorrelation C.Return type: DiGraph
-
pybel_tools.analysis.stability.jens_transformation_beta(graph)[source]¶ Apply Jens’ Transformation (Type 2) to the graph.
- Induce a sub-graph 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 3-cycles, which now symbolize stable triples where
A -> B,A -| CandB negativeCorrelation C.Return type: DiGraph
-
pybel_tools.analysis.stability.get_jens_unstable(graph)[source]¶ Yield triples of nodes (A, B, C) where
A -> B,A -| C, andC positiveCorrelation A.Calculated efficiently using the Jens Transformation.
Return type: Iterable[Tuple[BaseEntity,BaseEntity,BaseEntity]]
-
pybel_tools.analysis.stability.get_increase_mismatch_triplets(graph)[source]¶ Yield triples of nodes (A, B, C) where
A -> B,A -> C, andC negativeCorrelation A.Return type: Iterable[Tuple[BaseEntity,BaseEntity,BaseEntity]]
-
pybel_tools.analysis.stability.get_decrease_mismatch_triplets(graph)[source]¶ Yield triples of nodes (A, B, C) where
A -| B,A -| C, andC negativeCorrelation A.Return type: Iterable[Tuple[BaseEntity,BaseEntity,BaseEntity]]
-
pybel_tools.analysis.stability.get_chaotic_triplets(graph)[source]¶ Yield triples of nodes (A, B, C) that mutually increase each other, such as when
A -> B,B -> C, andC -> A.Return type: Iterable[Tuple[BaseEntity,BaseEntity,BaseEntity]]