def test_print_cyjs_graph(): cja = CyJSAssembler() cja.add_statements([st_act, st_act2]) cja.make_model() cyjs_str = cja.print_cyjs_graph() # assert output is not empty assert (len(cyjs_str) > len('{\n "edges": [],\n "nodes": []\n}'))
def assemble_cyjs(): """Assemble INDRA Statements and return Cytoscape JS network.""" response = request.body.read().decode('utf-8') body = json.loads(response) stmts_json = body.get('statements') stmts = stmts_from_json(stmts_json) cja = CyJSAssembler() cja.add_statements(stmts) cja.make_model(grouping=True) model_str = cja.print_cyjs_graph() return model_str