yaml2sbml is a small package to convert an ODE model specified in a yaml file into an SBML for ODE simulation and into PEtab for parameter fitting. These file formats can be used with other packages.
-
format_documentation.md provides a documentation of the format of the input yaml.
-
Examples can be found in the
examples
folder.
To install go to the main folder and do:
pip install .
- Python 3.6+
- python-libsbml>=5.18.0
- PyYAML>=5.3
- pandas >= 1.0.1
- PEtab >= 0.1.4
requirements.txt
If you don't have Python 3.6 or higher in your system, the best way to get it is either using pyenv or conda.
With conda you can create a virtual environment with a specific python version. To do so start by installing miniconda if you don't have any sort of conda installed yet, and then create a virtual environment using a specific version of python:
conda create -n <virtual_env_name> python=3.7
To activate the virtual environment do
source activate <virtual_env_ńame>
To install packages use either pip or conda:
conda/pip install <package_name>
You can either call yaml2sbml
via its command line interface or within your python code:
To convert an ODE model encoded in a yaml file to SBML using the terminal, go to the yaml2sbml
folder and run:
yaml2sbml <yaml_input_file> <sbml_output_file>
For instance, using the yaml file in the examples folder:
yaml2sbml ../examples/ode_input1.yaml ../examples/sbml_out.xml
If you want to generate PEtab parameter, observable and condition tables, additionally to the SBML file using the terminal, go to the yaml2sbml
folderand run:
yaml2petab <yaml_input_file> <petab_output_directory> <model_name>
For instance, again using the yaml file in the examples folder:
yaml2petab ../examples/ode_input1.yaml ../examples/ example_model.xml
Alternatively you can call yaml2sbml
within your python code via
import yaml2sbml
yaml2sbml.yaml2sbml(yaml_file, sbml_file)
Here all inputs ar given as strings.
To generate PEtab files call yaml2petab
via
import yaml2sbml
yaml2sbml.yaml2petab(yaml_file,
output_dir,
model_name)
Here yaml_file, output_dir
and model_name
are strings.
- Compartments are not supported.
- Units are not supported, all quantities are dimensionless.
- Specification of PEtab data tables are not in the scope of this tool.