index.html 13.7 KB
 Documenter.jl committed Feb 09, 2021 1   Documenter.jl committed Feb 09, 2021 2 Documentation · SBML.jl

SBML.jl — load systems biology models from SBML files

This package provides a straightforward way to load model- and simulation-relevant information from SBML files.

julia> using SBML 
Documenter.jl committed Feb 09, 2021  3      4      5      6      7      8      9      10      11      12      13      14      15      16      17      18      19      20      21      22      23      24      25      26      27      28  julia> mdl = readSBML("Ec_core_flux1.xml") Model(…)  julia> mdl.compartments 2-element Array{String,1}:  "Extra_organism"  "Cytosol"

There are several functions to help you with using the data in the usual COBRA-style workflows, such as getS:

julia> metabolites, reactions, S = getS(mdl) julia> metabolites 77-element Array{String,1}:  "M_succoa_c"  "M_ac_c"  "M_etoh_c"   ⋮  julia> S 77×77 Array{Float64,2}:  0.0   1.0  0.0  0.0  0.0  0.0  0.0  …  0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0     0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0     0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0   0.0  1.0  0.0  0.0  0.0  0.0     0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0     0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0  -1.0  0.0  0.0  0.0  0.0  0.0  …  0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0     0.0   0.0  1.0  -1.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0     0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0     0.0   0.0  0.0   0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0     0.0  -1.0  0.0   0.0  0.0  0.0  0.0 
Documenter.jl committed Feb 15, 2021  29                                                                                                                                                                                                    ⋮                         ⋮         ⋱  ⋮                          ⋮

Functions

Data structures

SBML.ModelType

Structure that collects the model-related data. Contains units, compartments, species and reactions. The contained dictionaries are indexed by identifiers of the corresponding objects.

source
SBML.ReactionType

Reaction with stoichiometry that assigns reactants and products their relative consumption/production rates (accessible in field stoichiometry), lower/upper bounds (in tuples lb and ub, with unit names), and objective coefficient (oc).

source
SBML.SpeciesType

source
SBML.UnitPartType

Part of a measurement unit definition that corresponds to the SBML definition of Unit. For example, the unit "per square megahour", Mh^(-2), is written as:

UnitPart("second",  # base SI unit, this says we are measuring time 
Documenter.jl committed Feb 09, 2021  30      31                                                                                                                                                                                                    -2,        # exponent, says "per square"          6,         # log-10 scale of the unit, says "mega" 
Documenter.jl committed Feb 15, 2021  32                                                                                                                                                                                                            1/3600)    # second-to-hour multiplier

Compound units (such as "volt-amperes" and "dozens of yards per ounce") are built from multiple UnitParts; see the definition of field units in Model.

source

Base functions

SBML.SBMLVersionMethod
function SBMLVersion()

Get the version of the used SBML library in Julia version format.

source

Read the SBML from a XML file in fn and return the contained Model.

source

Data helpers

SBML.getLBsMethod
function getLBs(m::Model)::Vector{Tuple{Float64,String}}

Extract a vector of lower bounds of reaction rates from the model. All bounds are accompanied with the unit of the corresponding value (this behavior is based on SBML specification).

source
SBML.getOCsMethod
function getOCs(m::Model)::Vector{Float64}

Extract the vector of objective coefficients of each reaction.

source
SBML.getSMethod
function getS(m::Model)::Tuple{Vector{String},Vector{String},Matrix{Float64}}

Extract the vector of species (aka metabolite) identifiers, vector of reaction identifiers, and the (dense) stoichiometry matrix from an existing Model. Returns a tuple with these values.

source
SBML.getUBsMethod
function getUBs(m::Model)::Vector{Tuple{Float64,String}}

Likewise to getLBs, extract the upper bounds.

source