CAG Assembler (indra_world.assemblers.cag)

Assemble simple graphs of assembled INDRA Statements that can be embedded into websites or notebooks.

Assembler (indra_world.assemblers.cag.assembler)

class indra_world.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

A list of INDRA Statements to be assembled.

Type:

list[indra.statements.Statement]

CAG

A networkx MultiDiGraph object representing the causal analysis graph.

Type:

nx.MultiDiGraph

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