def test_bound_condition(): bc = BoundCondition(Agent('RAF1'), True) st = Phosphorylation(Agent('BRAF', bound_conditions=[bc]), Agent('MAP2K1')) sa = SBGNAssembler([st]) sbgn_xml = sa.make_model() et = _parse_sbgn(sbgn_xml) _test_numelements(et, 4, 3)
def call_biopax(): global stmts sa = SBGNAssembler() sa.add_statements(stmts) sbgn_content = sa.make_model() print 'BIOPAX CALLED' socket.emit('BioPAXRequest', sbgn_content, 'partialBiopax')
def test_activeform(): erk = Agent('MAPK1', mods=[ModCondition('phosphorylation')]) st = ActiveForm(erk, 'kinase', True) sa = SBGNAssembler([st]) sbgn_xml = sa.make_model() et = _parse_sbgn(sbgn_xml) _test_numelements(et, 3, 2)
def test_activeform(): erkact = Agent('MAPK1', activity=ActivityCondition('kinase', True)) erkelk = Phosphorylation(erkact, Agent('ELK1')) erkp = Agent('MAPK1', mods=[ModCondition('phosphorylation')]) st = ActiveForm(erkp, 'kinase', True) sa = SBGNAssembler([st, erkelk]) sbgn_xml = sa.make_model() et = _parse_sbgn(sbgn_xml) _test_numelements(et, 4, 3)
def test_complex(): egfr1 = Agent('EGFR', bound_conditions=[BoundCondition(Agent('EGF'), True)]) egfr2 = Agent('EGFR', bound_conditions=[BoundCondition(Agent('EGF'), True)]) st = Complex([egfr1, egfr2]) sa = SBGNAssembler([st]) sbgn_xml = sa.make_model() et = _parse_sbgn(sbgn_xml) _test_numelements(et, 4, 3)
def update_layout(): sa = SBGNAssembler() sa.add_statements(stmts) sbgn_content = sa.make_model() #params = {'room': room_id, 'userId': user_id, # 'graph': sbgn_content, 'type': 'sbgn'} #socket.emit('agentMergeGraphRequest', params) params = {'room': room_id, 'userId': user_id} socket.emit('agentNewFileRequest', params) sbgn_params = {'graph': sbgn_content, 'type': 'sbgn'} sbgn_params.update(params) #socket.emit('agentLoadFileRequest', sbgn_params) #socket.emit('agentRunLayoutRequest', sbgn_params) socket.emit('agentMergeGraphRequest', sbgn_params)
def test_increaseamount(): st = IncreaseAmount(Agent(''), Agent('MAP2K1')) sa = SBGNAssembler([st]) sbgn_xml = sa.make_model() et = _parse_sbgn(sbgn_xml) _test_numelements(et, 4, 3)
def test_inhibition(): st = Inhibition(Agent('BRAF'), Agent('MAP2K1')) sa = SBGNAssembler([st]) sbgn_xml = sa.make_model() et = _parse_sbgn(sbgn_xml) _test_numelements(et, 4, 3)
def test_remove_modification(): st = Deacetylation(Agent('BRAF'), Agent('MAP2K1')) sa = SBGNAssembler([st]) sbgn_xml = sa.make_model() et = _parse_sbgn(sbgn_xml) _test_numelements(et, 4, 3)