cascade.graph

Utilities for manipulating causal graphs

Functions

acyclify

Acyclify a directed graph by iteratively removing cycle-inducing edges with the lowest weights

annotate_explanation

Annotate counterfactual explanation to the causal graph

assemble_scaffolds

Assemble multiple scaffold graphs into a heterogeneous one given a specific node list

core_explanation_graph

Extract the core explanation graph from an annotated causal graph that explains the predicted change in a list of leaf nodes

demultiplex

Split one single graph into multiple graphs by demultiplexing an edge attribute

filter_edges

Filter graph by an edge attribute

map_edges

Map edge attribute by a function

marginalize

Marginalize a directed graph by keeping only a subset of observed nodes, optionally inferring indirect connections up to a maximal number of steps mediated by latent nodes.

multiplex

Combine multiple graphs into a single graph by multiplexing an edge attribute

multiplex_num

Get the number of multiplexed graphs according to an edge attribute

node_stats

Get node statistics of a graph

prep_cytoscape

Prepare a graph for visualization in Cytoscape