def test_missing_monomer_condition(): stmts = [Activation(Agent('BRAF'), Agent('KRAS'))] model = tra_module.assemble_model(stmts) entity = Agent('HRAS') quantity = tra.MolecularQuantityReference('total', entity) condition = tra.MolecularCondition('multiple', quantity, 10) tra.apply_condition(model, condition)
def test_assemble_model_chemical_agents(): stmts = [ Activation(Agent('BRAF'), Agent('KRAS')), Inhibition(Agent('DRUG', db_refs={'CHEBI': '123'}), Agent('BRAF')) ] model = tra_module.assemble_model(stmts) assert model.parameters['DRUG_0'].value == 10000.0
def test_assemble_model_targeted_agents(): stmts = [ Activation(Agent('BRAF'), Agent('KRAS')), Inhibition(Agent('DRUG'), Agent('BRAF')) ] model = tra_module.assemble_model(stmts) assert model.parameters['BRAF_0'].value == 50.0 assert model.parameters['BRAF_0_mod'].value == 50.0
def test_assemble_model_no_upstream_active(): stmts = [ Phosphorylation( Agent('MEK', activity=ActivityCondition('activity', True)), Agent('ERK')) ] model = tra_module.assemble_model(stmts) assert model.parameters['MEK_0'].value == 50.0 assert model.parameters['MEK_0_mod'].value == 50.0
def test_seq_hyp_test(): stmts = [Activation(Agent('BRAF'), Agent('KRAS'))] model = tra_module.assemble_model(stmts) entity = Agent('KRAS', activity=ActivityCondition('activity', True)) quantity = tra.MolecularQuantityReference('total', entity) quant = tra.MolecularQuantity('qualitative', 'high') pattern = tra.TemporalPattern('sometime_value', [entity], None, value=quant) t = tra.TRA() from bioagents.tra.model_checker import HypothesisTester ht = HypothesisTester(alpha=0.1, beta=0.1, delta=0.05, prob=0.8) res = t.check_property(model, pattern, conditions=None, max_time=20000, num_times=100, hypothesis_tester=ht) sat_rate, num_sim, kpat, pat_obj, fig_path = res assert sat_rate == 1.0 assert num_sim == 18
def test_missing_monomer_site(): stmts = [Activation(Agent('BRAF'), Agent('KRAS'))] model = tra_module.assemble_model(stmts) mc = ModCondition('phosphorylation', None, None, True) agent = Agent('KRAS', mods=[mc]) tra.get_create_observable(model, agent)
def test_missing_monomer(): stmts = [Activation(Agent('BRAF'), Agent('KRAS'))] model = tra_module.assemble_model(stmts) agent = Agent('RAS') tra.get_create_observable(model, agent)