def test_create_basins_piechart(): try: primes = get_primes("n5s3") attractors = compute_attractors(primes, update="asynchronous") compute_basins(attractors) fname_image = get_tests_path_out(fname="basins_piechart") create_basins_piechart(attractors, fname_image=fname_image) except NameError: pass
def test_compute_json(): primes = get_primes("n5s3") fname = get_tests_path_out(fname="n5s3_attrs.json") attractors = compute_attractors(primes=primes, update="asynchronous", fname_json=fname, max_output=2) assert attractors
from pyboolnet.phenotypes import compute_phenotypes, compute_phenotype_diagram, create_phenotypes_piechart from pyboolnet.attractors import compute_attractors from pyboolnet.repository import get_primes if __name__ == "__main__": # compute the commitment diagram primes = get_primes("arellano_rootstem") print(sorted(primes)) attractors = compute_attractors(primes, "asynchronous") markers = ["WOX", "MGP"] phenotypes = compute_phenotypes(attractors, markers, fname_json="phenos.json") # inspect marker patterns for pheno in phenotypes["phenotypes"]: print(pheno["name"]) print(pheno["pattern"]) # draw diagram diagram = compute_phenotype_diagram(phenotypes, fname_image="phenos_diagram.pdf") # draw pie chart create_phenotypes_piechart(diagram, fname_image="phenos_piechart.pdf")
from pyboolnet.repository import get_primes from pyboolnet.state_transition_graphs import primes2stg from pyboolnet.attractors import compute_attractors_tarjan, compute_attractors, find_attractor_state_by_randomwalk_and_ctl if __name__ == "__main__": # attractor computation with Tarjan primes = get_primes("tournier_apoptosis") stg = primes2stg(primes, "asynchronous") steady, cyclic = compute_attractors_tarjan(stg) print(steady) print(cyclic) # random walk attractor detection state = find_attractor_state_by_randomwalk_and_ctl(primes, "asynchronous") print(state) # model checking based attractor detection attrs = compute_attractors(primes, "asynchronous", fname_json="attrs.json") print(attrs["is_complete"]) for x in attrs["attractors"]: print(x["is_steady"]) print(x["state"]["str"])
def test_compute_basins(): primes = get_primes("n5s3") attractors = compute_attractors(primes, update="asynchronous") compute_basins(attractors)
def attractors(primes): return compute_attractors(primes, update="asynchronous")
def attractors(): return compute_attractors(primes=get_primes("raf"), update="asynchronous")