Example #1
0
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)
Example #2
0
def get_molecular_quantity_ref(lst: KQMLList) -> tra.MolecularQuantityReference:
    try:
        quant_type = lst.gets('type')
        entity_lst = lst.get('entity')
        entity = get_molecular_entity(entity_lst)
        return tra.MolecularQuantityReference(quant_type, entity)
    except Exception as e:
        raise tra.InvalidMolecularQuantityRefError(e)
Example #3
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