"((((CXCL10_CXCR3_intToMb and not(CCL11_CXCR3_intToMb)))or((CXCL10_CXCR3_intToMb and not(CXCL13_CXCR3_intToMb))))or(CXCL9_11_CXCR3_active_intToMb))or(CXCL4_CXCR3_intToMb)":({'CCL11_CXCR3_intToMb','CXCL13_CXCR3_intToMb'},[['CXCL10_CXCR3_intToMb','CCL11_CXCR3_intToMb'],['CXCL10_CXCR3_intToMb','CXCL13_CXCR3_intToMb'],['CXCL9_11_CXCR3_active_intToMb'],['CXCL4_CXCR3_intToMb']]),
"((((A and not(B)))or((A and not(C))))or(D))or(E)":({'B','C'},[['A','B'],['A','C'],['D'],['E']]),
"((A and B and C)) and (not((D and E and F and G)))":({'E','D','G','F'},[['A','B','C','D','E','F','G']]),
}
returnconditions
deftest_rec_tree(feed_conditions):
fromsolution_reprimportrec,Reporter
# Error Reporter
err=Reporter()
tvi=TableVisitor(err)
symb_tab=tvi.tab_symb
forcondition,solutioninfeed_conditions.items():
inhibitors_nodes,paths=solution
# Get tree object from condition string
cond_sexpr=compile_cond(condition,symb_tab,err)
# Get all possible paths from the condition
found_inhibitors=set()
found_paths=rec(cond_sexpr,found_inhibitors)
# print(found_inhibitors)
# print(found_paths)
assertfound_paths==paths
assertfound_inhibitors==inhibitors_nodes
deftest_parse_condition():
fromsolution_reprimportparse_condition
condition="((((((STAT4__dimer___JUN_Cbp_active_nucl)or(JUN_FOSNFAT1_c_4_active_nucl))or((STAT5__dimer___active_active_nucl and Elf1)))or(IL2_IL2R_active_intToMb))or(JUN_FOSNFAT1_c_4_active_nucl))or(NFAT1_FOXP3))or(JUN_FOSNFAT1_c_4_active_nucl)"