Skip to content
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

functions is not recognized #102

Open
himoto opened this issue Apr 29, 2023 · 6 comments
Open

functions is not recognized #102

himoto opened this issue Apr 29, 2023 · 6 comments

Comments

@himoto
Copy link

himoto commented Apr 29, 2023

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

  • Julia: v1.7
  • ReactionNetworkImporters.jl: v0.14
@himoto
Copy link
Author

himoto commented Apr 29, 2023

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

@isaacsas
Copy link
Member

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
Copy link
Member

Di you try importing via SBML using SBMLToolkit?

@himoto
Copy link
Author

himoto commented May 1, 2023

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
Copy link
Member

isaacsas commented May 1, 2023

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
Copy link
Author

himoto commented May 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants