Causal analysis graphs (indra.assemblers.cag.assembler)

class indra.assemblers.cag.assembler.CAGAssembler(stmts=None)[source]

Assembles a causal analysis graph from INDRA Statements.

Parameters:stmts (Optional[list[indra.statement.Statements]]) – A list of INDRA Statements to be assembled. Currently supports Influence Statements.
statements

list[indra.statements.Statement] – A list of INDRA Statements to be assembled.

CAG

nx.MultiDiGraph – A networkx MultiDiGraph object representing the causal analysis graph.

add_statements(stmts)[source]

Add a list of Statements to the assembler.

export_to_cytoscapejs()[source]

Return CAG in format readable by CytoscapeJS.

Returns:A JSON-like dict representing the graph for use with CytoscapeJS.
Return type:dict
generate_jupyter_js(cyjs_style=None, cyjs_layout=None)[source]

Generate Javascript from a template to run in Jupyter notebooks.

Parameters:
Returns:

A Javascript string to be rendered in a Jupyter notebook cell.

Return type:

str

make_model(grounding_ontology='UN', grounding_threshold=None)[source]

Return a networkx MultiDiGraph representing a causal analysis graph.

Parameters:
  • grounding_ontology (Optional[str]) – The ontology from which the grounding should be taken (e.g. UN, FAO)
  • grounding_threshold (Optional[float]) – Minimum threshold score for Eidos grounding.
Returns:

The assembled CAG.

Return type:

nx.MultiDiGraph