SBML
SBML-related import helpers from annnet.io.sbml and annnet.io.sbml_cobra.
Core SBML
annnet.io.sbml
Classes
Functions
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
|
COBRA SBML
annnet.io.sbml_cobra
SBML (Systems Biology Markup Language) → AnnNet adapter
Targets the provided AnnNet API.
Two entry points: - from_sbml(path, graph=None, slice="default", preserve_stoichiometry=True) - from_cobra_model(model, graph=None, slice="default", preserve_stoichiometry=True)
If AnnNet.set_edge_coeffs(edge_id, coeffs: dict[str, float]) is not available,
stoichiometric coefficients are stored under an edge attribute stoich (lossy but usable).
Classes
Functions
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]).