#!/usr/bin/env python # coding: utf-8 # In[1]: import caspo_control import biolqm # Downloading of the model # In[2]: model = biolqm.load("http://ginsim.org/sites/default/files/Bladder_Model.zginml") # Conversion of the model from multivalued to Boolean # In[3]: inputs = { "GrowthInhibitors":1, "EGFR_stimulus":1, "FGFR3_stimulus":1 } target = {"Apoptosis_b1": 1, "RB1": 1} # In[4]: cc = caspo_control.load(model, inputs) # In[5]: s = cc.reprogramming_to_attractor(target, maxsize=2) s # In[6]: s.as_table() # In[7]: s.as_graph() # In[8]: s.aliases # In[9]: from colomoto_jupyter import tabulate # In[10]: test = biolqm.to_minibn(model, ensure_boolean=True) for n, v in inputs.items(): test[n] = v test["RB1"] = 1 test["TP53"] = 1 # In[11]: tabulate(biolqm.fixpoints(test.to_biolqm())) # In[ ]: