-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support BioNetGen function blocks and more inline function types #4
Comments
Yes. |
Do you have an example that doesn’t currently work? |
I'm currently looking into this: https://github.com/labsyspharm/marm1-supplement/blob/master/resources/MARM1.bngl which may be way to complex but it does have both types. |
Could you upload the .net file it generates? That's what we'd want to be able to load here. |
There you go... just remove the .txt suffix. |
Thanks! This looks like we could probably support it in a fairly straightforward manner since the observables are never used in reactions or rate laws. The latter would be more complicated to support. The groups should already work (i.e. you should be able to index a solution object using the group names to get their values). |
Alright. I just discovered that if I do:
I can access the observables if I do |
Here is an example on how to index by the name of a variable (which should work for observables too) using Catalyst, OrdinaryDiffEq
rn = @reaction_network begin
α, S + I --> 2I
β, I --> R
end α β
p = [:α => .1/1000, :β => .01]
tspan = (0.0,250.0)
u0 = [:S => 999.0, :I => 1.0, :R => 0.0]
op = ODEProblem(rn, u0, tspan, p)
sol = solve(op, Tsit5())
@unpack S = rn
sol[S] # solution for the variable S
# or
t = [1.0, 1.5, 2.0]
@unpack I = rn
sol(t, idxs=[S,I]) # values of S and I at the times |
Currently function blocks are not supported. This would be great to add but note, this requires allowing observables within the functions.
The text was updated successfully, but these errors were encountered: