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
ScipyOdeSimulator
to run simulations, PySB must first pass the model through BioNetGen to generate the equations that then get passed to scipy and integrated.
Initial
species concentrations. Or there may be an error in how your rules are defined. Check the Initial
declarations first and if that isn't the problem post your code here and we should be able to hunt down the problem.
s='u' >> s='p'
can only happen if the b
site is unbound, then b=None
must be explicitly included in the rule even though it's not changed in the rule. We refer to conditions like this as "reaction context". The part of a rule that gets changed is called the "reaction center".
A(s='u', b=WILD)
is equivalent to A(s='u')
. The reason this syntax exists even though it's redundant is that components can, in principle, carry both states and bonds at the same time. For example, A(s='u', b=('x', 1))
specifies an A
molecule with an s
component in the 'u'
state and a b
component in the x
state that is bound to something with a bond number 1
. If one wants to write a rule that says b
must be in the x
state but it doesn't matter whether it's bound or not, the correct syntax would be A(s='u', b=('x', WILD))
. There's no other way to express this since A(s='u', b='x')
explicitly means b
is unbound and A(s='u')
says b
can be in any state, even though excluding it from the rule means it can be bound or unbound. Hope this helps.
pip install --upgrade pysb
conda upgrade -c alubbock pysb
Hello, a quick question regarding the way PySB finds BNG2.pl. I have a testing machine with 2 testing environments for PySB (using Jupyter): one using pip and the other one using conda. Under the conda one I installed BioNetGen (from alubbock) but under the pip one I have not installed bionetgen. Still, under the pip environment, it finds the BNG2.pl executable installed under ~/miniconda3/bin. I checked using PySB.pathfinder.get_path('bng'). Is it expected behaviour? I looked at the code of the pathfinder module: does it "scan" the user home for a conda environment to locate the BNG2.pl file? Thanks a lot in advance.
EDIT: Forget it - I found the answer. When opening a Jupyter notebook, it sources my ~/.bashrc file, which was modified by 'conda init' to add 'miniconda3/bin' in my PATH. When installing BioNetGen under conda, it puts the executable under miniconda3/bin and therefore is used also in the pip environment.
im using pysb to setup a polymerisation reactions including this molecule at the start (bngl notation):
PG(oh,oh)
and this seed definition:
PG(oh,oh) 10
In python I write:
Monomer('PG', ['oh', 'oh'])
and:
Initial(PG(oh=None, oh=None), 10)
This causes an error, because the 'oh' parameter is used twice in the 'Initial' function. What is the intended way to write this 'Initial' function?
Dear all,
I have a couple questions regarding to run bngl simulation with pysb, and also to use stochkit.
I am currently running stochastic simulation of gene regulatory network. I did it in bionetgen and for the same time range, my simulation actually ran pretty fast(each run takes less than 5s).
However, when I used pysb bnglsimulator or stochkitsimulator, simulation could not finish in more than half an hour (I killed the process). For bnglsimulator, background process "run_network.exe" has been running for quite a while. For stochkitsimulatior, it called three other processes: ssa.exe, ssa_direct_small.exe, ssa_direct_serial_small.exe. And it seems like only the last one was running.
I noticed that in pysb, it requires time range (example used linspace to generate number of time points), does that mean pysb simulator uses fixed time step simulator, or this is just the time point where output data is kept (at least that is what stochkit documentation says)?
Also, my laptop is on Windows, and I use anaconda python. I noticed that anaconda does not have windows compatible stochkit packages (do have stochkit-lite), but I can download stochkit from sourgeforge. To utilize this full version stochkit in windows, do I just copy the unzipped stochkit folder to where anaconda manages packages?
Further question about stochkit, I noticed there is cupSODA for runninng ODE on GPU, is there any equivalent version for running stochastic simulation?
Thank you
Best,
Junhao
BngSimulator(model, linspace(start, finish, points+1)).run(method = 'ode').dataframe
and BngSimulator(model, linspace(start, finish, points+1)).run(method = 'ssa', n_runs = n_runs).dataframe
(with start/finish the initial/final time points to report)
pysb.pathfinder.set_path('stochkit_ssa', path)
with the appropriate path (or alternatively, by setting the STOCHKITPATH
environment variable).
conda install -c alubbock pysb
M(x=None)
in PySB would be written as M(x)
in BNG