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 get_molecular_condition(lst: KQMLList) -> tra.MolecularCondition: try: condition_type = lst.gets('type') quantity_ref_lst = lst.get('quantity') quantity = get_molecular_quantity_ref(quantity_ref_lst) if condition_type == 'exact': value = get_molecular_quantity(lst.get('value')) elif condition_type == 'multiple': value = lst.gets('value') else: value = None return tra.MolecularCondition(condition_type, quantity, value) except Exception as e: raise tra.InvalidMolecularConditionError(e)