Cytoscape JS networks (indra.assemblers.cyjs.assembler
)
- class indra.assemblers.cyjs.assembler.CyJSAssembler(stmts=None)[source]
This class assembles a CytoscapeJS graph from a set of INDRA Statements.
CytoscapeJS is a web-based network library for analysis and visualisation: http://js.cytoscape.org/
- Parameters
statements (Optional[list[indra.statements.Statement]]) – A list of INDRA Statements to be assembled.
- add_statements(stmts)[source]
Add INDRA Statements to the assembler’s list of statements.
- Parameters
stmts (list[indra.statements.Statement]) – A list of
indra.statements.Statement
to be added to the statement list of the assembler.
- make_model(*args, **kwargs)[source]
Assemble a Cytoscape JS network from INDRA Statements.
This method assembles a Cytoscape JS network from the set of INDRA Statements added to the assembler.
- print_cyjs_context()[source]
Return a list of node names and their respective context.
- Returns
cyjs_str_context – A json string of the context dictionary. e.g. - {‘CCLE’ : {‘bin_expression’ : {‘cell_line1’ : {‘gene1’:’val1’} }, ‘bin_expression’ : {‘cell_line’ : {‘gene1’:’val1’} } }}
- Return type
- print_cyjs_graph()[source]
Return the assembled Cytoscape JS network as a json string.
- Returns
cyjs_str – A json string representation of the Cytoscape JS network.
- Return type
- save_json(fname_prefix='model')[source]
Save the assembled Cytoscape JS network in a json file.
This method saves two files based on the file name prefix given. It saves one json file with the graph itself, and another json file with the context.
- Parameters
fname_prefix (Optional[str]) – The prefix of the files to save the Cytoscape JS network and context to. Default: model