SciML / ReactionNetworkImporters.jl

Julia Catalyst.jl importers for various reaction network file formats like BioNetGen and stoichiometry matrices
https://docs.sciml.ai/ReactionNetworkImporters/stable/
MIT License
26 stars 8 forks source link

`functions` is not recognized #102

Open himoto opened 1 year ago

himoto commented 1 year ago

Hi, thanks for developing and maintaining the amazing tool!

Reproduce:

I am testing a simple Michaelis-Menten model provided in BioNetGen. I installed this file locally and renamed it "mm.net".

When running the following code,

using ReactionNetworkImporters
using Sundials

fname = "mm.net"
prnbng = loadrxnetwork(BNGNetwork(), fname);
rn = prnbng.rn;
tf = 1000.0
oprob = ODEProblem(rn, Float64[], (0.0, tf), Float64[])
sol = solve(oprob,CVODE_BDF(), saveat = tf / 1000.0)

Although michment is defined at line 11 (begin functions ~ end functions section), I got the following message.

UndefVarError: michment not defined

I would like to know whether the functions definition is supported in this package.

Version info

himoto commented 1 year ago

I noticed this is already discussed #4. I am sorry..

isaacsas commented 1 year ago

Yeah, the main issue is I’ve never found documentation on how the function block is supposed to work. That would make it a lot easier to understand what is needed here.

isaacsas commented 1 year ago

Di you try importing via SBML using SBMLToolkit?

himoto commented 1 year ago

Hi @isaacsas, thank you for your reply. Yes, and if I import the model via SBML using SBMLToolkit.jl, it works fine. However, it seems that SBMLToolkit.jl dose not support enegy-based BioNetGen specification, e.g., https://github.com/himoto/rosa_webinar_20Jan2021/blob/main/toy_example_RAF_RAFi.sbml. I found that I could import eBNG models via .net file using ReactionNetworkImporters.jl and that's why I hope funcitons is supported in this package.

isaacsas commented 1 year ago

Got it. Unfortunately, I have never found documentation for the net file function block, which makes understanding how it is supposed to work a bit difficult. I'd like to add support for this at some point, but I'm not sure I'll have time myself to work on it in the near term. If you'd like to give it a shot to add such support via a PR, the code for loading / parsing net files is relatively short:

https://github.com/SciML/ReactionNetworkImporters.jl/blob/master/src/parsing_routines_bngnetworkfiles.jl

himoto commented 1 year ago

Thank you very much @isaacsas, I will look into the net file function block.