corneto.io.import_sbml_model#
- corneto.io.import_sbml_model(source, *, annotations=False, compression='auto', timeout=30.0)#
Read supported SBML and convert it to a CORNETO metabolic graph.
The native reader supports SBML Level 3 Version 1 Core and FBC Version 2, with optional Groups Version 1. It uses only the standard library to parse SBML and does not require COBRApy. Raw SBML identifiers are preserved; boundary and constant species remain available in graph metadata but are omitted from mass-balance vertices. If the document has an active FBC objective, its minimization-convention coefficient map is stored as
graph.get_graph_attributes()["fba_objective"]. Pass that mapping explicitly toMultiSampleFBA.build(..., objectives=...)to use it.- Parameters:
source (str | PathLike | BinaryIO) – SBML path, HTTP(S) URL, or binary readable stream. Caller-owned streams are read from their current position and remain open.
annotations (bool) – Include embedded RDF resource URIs in record metadata. Annotation URIs are not fetched.
compression (str | None) –
"auto"detects gzip, bz2, or xz by magic bytes;Nonedisables decompression, and an explicit codec forces it.timeout (float) – HTTP request timeout in seconds.
- Returns:
A CORNETO graph containing the parsed metabolic network.
- Raises:
ValueError – If the document uses unsupported dynamic semantics or contains invalid or unresolved model references.
- Return type: