SBML
Read and write SBML models. A reaction becomes a directed
hyperedge: the reactants are on one side, the products on the other, and the
stoichiometric coefficients are kept on the edge. A boundary reaction becomes a
one-sided edge with the is_boundary edge attribute.
from_sbml reads the file with
python-libsbml. from_sbml_cobra and
from_cobra_model read through COBRApy,
from a file or from a COBRApy model object.
annnet.io.sbml.from_sbml
Read an SBML file into an AnnNet hypergraph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the .xml / .sbml file. |
required |
graph
|
AnnNet | None
|
Optional existing AnnNet to merge into. |
None
|
slice
|
str
|
AnnNet slice name for default placement. Compartment-specific species will additionally appear in their compartment slice. |
'default'
|
preserve_stoichiometry
|
bool
|
Write signed stoichiometric coefficients into the incidence matrix via set_edge_coeffs (reactants negative, products positive, modifiers -1). Default True. |
True
|
annnet.io.sbml.to_sbml
Write the graph as an SBML Level 3 document.
from_sbml_cobra
Read SBML using COBRApy if available.
annnet.io.sbml_cobra.from_cobra_model
Convert a COBRApy model to AnnNet. Requires cobra.util.array.create_stoichiometric_matrix.
Edge attributes added: name, default_lb, default_ub, gpr (Gene-Protein-Reaction rule [GPR]).