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

SBML import #16

Closed SiFTW closed 2 years ago

SiFTW commented 4 years ago

Being able to import SBML would be highly enabling for me to switch Julia.

isaacsas commented 4 years ago

Direct SBML import would be great, but SBML is a beast. This has been an open DEBio issue for several years, but no one has had the time to invest in it yet unfortunately. I suspect this won't happen until there are dedicated funds to hire a programmer to implement it.

In the meantime you can either directly call the Python SBML API using PyCall, or you could try using Bionetgen to generate a .net file from your SBML model. Depending on the features you need it might work with ReactionNetworkImporters, and if it doesn't work out of the box I'd be happy to try to see if I can get them added in. Right now we have successfully loaded several (large) published Bionetgen-based models in DEBio through this approach.

ChrisRackauckas commented 4 years ago

It might be nice to handle it by using a PyCall to an SBML parser and then directly using the parsed version. That shouldn't be too bad.

VitaminBrad commented 4 years ago

I've done something like this, Chris... If the intention is to run scientific machine learning on the equations from an SBML file, this is my current solution:

I may be able to contribute this code, in a reliable generalized version, by the end of this year. Is there someone already working on something like this?

ChrisRackauckas commented 4 years ago

It would be nice to see that in order to use it as a starting point, even if it's just a work in progress. I know that @giordano was looking into doing this later, but hasn't started yet, so he could probably use whatever you make as a jumping point.

isaacsas commented 4 years ago

@VitaminBrad Would it be tough to generate a ModelingToolkit.ReactionSystem directly?

VitaminBrad commented 4 years ago

Hi @isaacsas If Julia treats these lines below as Expr, then it would be incredibly easy.

The work I'm currently doing is trying to get qualitative knowledge graphs into reaction networks and quantify them via UDEs & experimental data, so a general pipeline for this (e.g. from Biological Expresion Language (BEL) or other qualitative formalisms) would be really neat and important I think!

@ChrisRackauckas, @giordano It actually already appears to be up and running for a use case of 45 differential equations describing the aggregation of proteins. (https://www.ebi.ac.uk/biomodels/BIOMD0000000542#Overview) I don't think it would take much more to make it work on any SBML file (using PyCall and python-libsbml). I'm all for collaborating on it, though!!:smile_cat:

giordano commented 4 years ago

To elaborate a bit, I'm applying for a grant to work on some julia-related projects. One of them would be an SBML parser, ideally purely in Julia. I have a colleague who's involved in SBML that might be able to help out a bit (or at least give some guidance). Note that should I get the grant I'll be able to start working on this in April at the earliest.

Using the Python parser is another possibility, being able to call it seamlessly would anyway be useful for testing for a pure-Julia parser

SiFTW commented 4 years ago

To elaborate a bit, I'm applying for a grant

Happy to provide a letter of support emphasising how enabling this would be. Best of luck!

isaacsas commented 2 years ago

We’ve got https://github.com/SciML/SBMLToolkit.jl now for SBML.