A package that creates a python implementation of an SBML model.
Project description
SBMLtoODEpy
Overview
The simpliest use of this package is to use the ParseAndGenerate function to quickly create a python implementation of an SBML model.
import sbmltoodepy
ParseAndCreateModel(inputFilePath, jsonFilePath = None, outputFilePath = None, className = "SBMLmodel")
The parameters are:
- inputFilePath: The file path of the SBML model.
- jsonFilePath: An optional file path that if provided is where the function will create a json file containing all of the model elements. If not provided, a json file will not be created.
- outputFilePath: An optional file path of where the python model implementation will be created. If not provided, the output path will be assumedtobe the same as the input, but with a .py extension.
- className: The name of the class defined by the file created by this function.
This creates a new python file containing a class implementing the SBML model. To run the model, instantiate the class and call the RunSimulation method with the desired timestep.
model = SBMLmodel()
model.RunSimulation(deltaT, absoluteTolerance = 1e-12, relativeTolerance = 1e-6)
Installation Instructions
SBMLtoODEpy can be downloaded using pip
pip install sbmltoodepy
To test the package, use the TestPackage function.
import sbmltoodepy
sbmltoodepy.utilities.TestPackage()
The function raises a warning about trying to set a constant species and 7 numbers.
1.279495335622681e-06
9.427471779552446e-10
1.330807667219949e-07
9.797580656559267e-08
4.0569605652344643e-07
2.661173190172687e-05
These are the average relative errors for species, parameters, and compartments between the models generated in this function and results calculated by COPASI for seven different models.
Acknowledgements
The following python packages were used in this project and are needed to generate and run python models:
Models from the following papers were used to develop and test the package and are included as examples:
The above models are additionally located in this projects github repository.
For more information on using this package, click here to see the tutorial.
For more information on SBML, including specifications and other software that supports SBML, click here for the SBML web site
For a good source of SBML models, the BioModels repository is a great place to search.
For this project's documentation, click here.
For this project's github repository, click here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.