This is the code I'm trying to run
from pysb import *
from pysb.simulator import ScipyOdeSimulator
Model()
Monomer('A')
Parameter('k', 3.0)
Rule('synthesize_A', None >> A(), k)
t = [0, 10, 20, 30, 40, 50, 60]
simulator = ScipyOdeSimulator(model)
simresult = simulator.run()
print(simresult.species)
from pysb import *
from pysb.simulator import ScipyOdeSimulator
Model()
Monomer('A')
Parameter('k', 3.0)
Rule('synthesize_A', None >> A(), k)
t = [0, 10, 20, 30, 40, 50, 60]
simulator = ScipyOdeSimulator(model, t)
simresult = simulator.run()
print(simresult.species)
from pysb.pathfinder import set_path
and then set_path('bng', path_to_BNG2.pl)
I did though succesfully add the .pl to the path and only after doing so it gave me the error you see.
I'll check after installing pearl
Hi I tried it but it results on an error
from pysb import *
from pysb.pathfinder import set_path
from pysb.simulator import ScipyOdeSimulator
set_path('bng', 'C:\Program Files\BNG')
Model()
Monomer('A',['a'])
Observable('A_total', A())
Parameter('Hcoeff',1.0)
Expression('kf_A', A_total*Hcoeff)
Rule('bindA', A(a=None) + A(a=None) >> A(a=1) % A(a=1), kf_A)
Parameter('A0',20)
Initial(A(a=None),A0)
simres = ScipyOdeSimulator(model, tspan=[0,20]).run()
This is the error I get:
AttributeError: 'str' object has no attribute 'args'
Is there some problem with my code?
Expression
. It seems there is a problem when converting the model into ODEs. The solution, if you could read the conversation history, was export the model into kappa, edit by hand because the observable must be before the parameter that use the observable, and simulate the model using the command line (KaSim).
A
, binding site b
, and phosphorylation site s
, is Rule('r1', A(s='u') >> A(s='p'), kf)
. The left hand side of the rule, A(s='u')
, determines what's matched by the rule. Note that no binding site is included in that rule, so the phosphorylation will apply regardless if A
is bound or not. If you want the phosphorylation reaction to only apply to A
units which are in complex, but you don't care what the binding partner is, you can use the ANY
keyword to specify "any bond, but not unbound", i.e. Rule('r2', A(b=ANY, s='u') >> A(b=ANY, s='p'), kf)
. For a worked example including the ANY
keyword, see the egfr_simple model: https://github.com/pysb/pysb/blob/master/pysb/examples/bngwiki_egfr_simple.py