sbmlutils.converters.odefac
¶
Convert SBML models to ODE systems for various programming languages.
This allows easy integration with existing workflows by rendering respective code templates.
Currently supported code generation: - python: scipy - R: desolve - R: dmod
The following SBML core constructs are currently NOT supported: - ConversionFactors - FunctionDefinitions - InitialAssignments - Events
Module Contents¶
Classes¶
SBML to ODE converter. |
Attributes¶
- class sbmlutils.converters.odefac.SBML2ODE(doc)[source]¶
SBML to ODE converter.
Writes out python or R ODE files which can be solved with standard integrators like scipy odeint or R desolve.
- Parameters:
doc (libsbml.SBMLDocument) –
- classmethod from_file(sbml_file)[source]¶
Create converter from SBML file.
- Parameters:
sbml_file (pathlib.Path) –
- Return type:
- _add_reaction_formula(model, rid, species_ref, sign)[source]¶
Add part of reaction formula to ODEs for species.
- Parameters:
model (libsbml.Model) –
rid (str) –
species_ref (libsbml.SpeciesReference) –
sign (str) –
- Return type:
None
- static dependency_graph(y, filtered_ids)[source]¶
Create dependency graph from given dictionary.
- Parameters:
y (Dict[str, Union[libsbml.ASTNode, str]]) – { variable: astnode } dictionary
filtered_ids (Set[str]) – ids which are defined elsewhere and not part of dependency tree
- Returns:
- Return type:
Dict[str, Set]
- _ordered_yids()[source]¶
Get the order of the vids from the assignment rules.
- Parameters:
model –
- Return type:
List[str]
:param filtered_ids :return:
- to_python(py_file)[source]¶
Write ODEs to python.
- Parameters:
py_file (pathlib.Path) –
- Return type:
None
- to_markdown(md_file)[source]¶
Write ODEs to markdown.
- Parameters:
md_file (pathlib.Path) –
- Return type:
None