psamm.datasource.sbml – SBML model parser¶
Parser for SBML model files.
-
class
psamm.datasource.sbml.CompartmentEntry(reader, root, filemark=None)¶ Compartment entry in the SBML file
-
properties¶ All compartment properties as a dict.
-
-
class
psamm.datasource.sbml.FluxBoundEntry(reader, namespace, root)¶ Flux bound defined with FBC V1.
Flux bounds defined with FBC V2 are instead encoded as
upper_fluxandlower_fluxproperties on the ReactionEntry objects.-
id¶ Return ID of flux bound.
-
name¶ Return name of flux bound.
-
operation¶ Return the operation of the flux bound.
Returns one of LESS_EQUAL, GREATER_EQUAL or EQUAL.
-
reaction¶ Return reaction ID that the flux bound pertains to.
-
value¶ Return the flux bound value.
-
-
class
psamm.datasource.sbml.ObjectiveEntry(reader, namespace, root)¶ Flux objective defined with FBC
-
exception
psamm.datasource.sbml.ParseError¶ Error parsing SBML file
-
class
psamm.datasource.sbml.ReactionEntry(reader, root, filemark=None)¶ Reaction entry in SBML file
-
id¶ Reaction ID
-
kinetic_law_reaction_parameters¶ Iterator over the values of kinetic law reaction parameters
-
name¶ Reaction name
-
properties¶ All reaction properties as a dict
-
reversible¶ Whether the reaction is reversible
-
-
class
psamm.datasource.sbml.SBMLReader(file, strict=False, ignore_boundary=False, context=None)¶ Reader of SBML model files
The constructor takes a file-like object which will be parsed as XML and then as SBML according to the specification. If the
strictparameter is set to False, the parser will revert to a more lenient parsing which is required for many older models. This tries to mimic the inconsistencies employed by COBRA when parsing models.If
ignore_boundaryisTrue, the species that are marked as boundary conditions will simply be dropped from the species list and from the reaction equations, and any boundary compartment will be dropped too.-
compartments¶ Iterator over
CompartmentEntryentries.
-
create_model()¶ Create model from reader.
Returns: psamm.datasource.native.NativeModel.
-
flux_bounds¶ Iterator over
FluxBoundEntry
-
get_compartment(compartment_id)¶ Return
CompartmentEntrycorresponding to id.
-
get_objective(objective_id)¶ Return
ObjectiveEntrycorresponding to objective_id
-
get_reaction(reaction_id)¶ Return
ReactionEntrycorresponding to reaction_id
-
get_species(species_id)¶ Return
SpeciesEntrycorresponding to species_id
-
id¶ Model ID
-
name¶ Model name
-
objectives¶ Iterator over
ObjectiveEntry
-
reactions¶ Iterator over
ReactionEntries
-
species¶ Iterator over
SpeciesEntriesThis will not yield boundary condition species if those are ignored.
-
-
class
psamm.datasource.sbml.SBMLWriter(cobra_flux_bounds=False)¶ Writer of SBML files
-
write_model(file, model, pretty=False)¶ Write a given model to file
-
-
class
psamm.datasource.sbml.SpeciesEntry(reader, root, filemark=None)¶ Species entry in the SBML file
-
boundary¶ Whether this compound is a boundary condition
-
charge¶ Species charge
-
compartment¶ Species compartment
-
formula¶ Species formula
-
name¶ Species name
-
properties¶ All species properties as a dict
-