Skip to content

alex-treebeard/yaml2sbml

 
 

Repository files navigation

yaml2sbml

Codacy Badge CI codecov

Table of contents

Introduction

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.

Installation

To install go to the main folder and do:

pip install .

Requirements

  • Python 3.6+
  • python-libsbml>=5.18.0
  • PyYAML>=5.3
  • pandas >= 1.0.1
  • PEtab >= 0.1.4

Requirements files

  • requirements.txt

How to get Python 3.6+

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>

Usage

You can either call yaml2sbml via its command line interface or within your python code:

Command line interface

yaml2sbml command

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

yaml2PEtab command

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

Python

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.

Known issues and limitations

  • 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.

About

Little tool to convert an ODE model specified in .yaml format to .sbml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • Shell 1.7%