Skip to content

SciML/SBMLToolkit.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SBMLToolkit

Join the chat at https://julialang.zulipchat.com #sciml-bridged Global Docs

codecov Build Status

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

SBMLToolkit.jl is a lightweight tool to import models specified in the Systems Biology Markup Language (SBML) into the Julia SciML ecosystem. There are multiple ways to specify the same model in SBML. Please help us improving SBMLToolkit.jl by creating a GitHub issue if you experience errors when converting your SBML model.

SBMLToolkit uses the SBML.jl wrapper of the libSBML library to lower dynamical SBML models into dynamical systems. If you would like to import BioNetGen models use the writeSBML() export function or import the .net file with ReactionNetworkImporters.jl. For constrained-based modeling, please have a look at COBREXA.jl. We also recommend trying SBMLImporter.jl (Pros: respects directionality of events, outputs concentrations instead of amounts. Cons: imports ODESystems, i.e. does not interface with Catalyst).

Installation

To install SBMLToolkit.jl, use the Julia package manager:

using Pkg
Pkg.add("SBMLToolkit")

Tutorial

SBML models can be simulated with the following steps (note that sol is in absolute quantities rather than concentrations):

using SBMLToolkit, ModelingToolkit, OrdinaryDiffEq

SBMLToolkit.checksupport_file("my_model.xml")
mdl = readSBML("my_model.xml", doc -> begin
    set_level_and_version(3, 2)(doc)
    convert_promotelocals_expandfuns(doc)
end)

rs = ReactionSystem(mdl)  # If you want to create a reaction system
odesys = convert(ODESystem, rs)  # Alternatively: ODESystem(mdl)

tspan = (0.0, 1.0)
prob = ODEProblem(odesys, [], tspan, [])
sol = solve(prob, Tsit5())

Alternatively, SBMLToolkit also provides more concise methods to import SBML.Models, Catalyst.ReactionSystems, and ModelingToolkit.ODESystems.

mdl = readSBML("my_model.xml", DefaultImporter())
rs = readSBML("my_model.xml", ReactionSystemImporter())
odesys = readSBML("my_model.xml", ODESystemImporter())

License

The package is released under the MIT license.

Development team

This package was developed by Paul F. Lang at the University of Oxford, UK and Anand Jain at the University of Chicago, USA.

Questions and comments

Please use GitHub issues, the #sciml-sysbio channel in the Julia Slack workspace or email Paul F. Lang with any questions or comments.