⋮ ⋮ ⋱ ⋮ ⋮ </code></pre><h1id="Function-reference"><aclass="docs-heading-anchor"href="#Function-reference">Function reference</a><aid="Function-reference-1"></a><aclass="docs-heading-anchor-permalink"href="#Function-reference"title="Permalink"></a></h1><h2id="Data-structures"><aclass="docs-heading-anchor"href="#Data-structures">Data structures</a><aid="Data-structures-1"></a><aclass="docs-heading-anchor-permalink"href="#Data-structures"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Maybe"href="#SBML.Maybe"><code>SBML.Maybe</code></a> — <spanclass="docstring-category">Type</span></header><section><div><pre><codeclass="language-julia">Maybe{X}</code></pre><p>Type shortcut for "<code>X</code> or nothing" or "nullable <code>X</code>" in javaspeak. Name got inspired by our functional friends.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L2-L7">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Compartment"href="#SBML.Compartment"><code>SBML.Compartment</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>SBML Compartment with sizing information.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L109-L111">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.FunctionDefinition"href="#SBML.FunctionDefinition"><code>SBML.FunctionDefinition</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Custom function definition.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L173-L175">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GPAAnd"href="#SBML.GPAAnd"><code>SBML.GPAAnd</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Boolean binary "and" in the association expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L44-L46">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GPAOr"href="#SBML.GPAOr"><code>SBML.GPAOr</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Boolean binary "or" in the association expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L51-L53">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GPARef"href="#SBML.GPARef"><code>SBML.GPARef</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Gene product reference in the association expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L37-L39">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GeneProduct"href="#SBML.GeneProduct"><code>SBML.GeneProduct</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Gene product metadata.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L162-L164">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GeneProductAssociation"href="#SBML.GeneProductAssociation"><code>SBML.GeneProductAssociation</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Abstract type for all kinds of gene product associations</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L32-L34">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Math"href="#SBML.Math"><code>SBML.Math</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A simplified representation of MathML-specified math AST</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L58-L60">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathApply"href="#SBML.MathApply"><code>SBML.MathApply</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Function application ("call by name", no tricks allowed) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L93-L95">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathConst"href="#SBML.MathConst"><code>SBML.MathConst</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A constant identified by name (usually something like <code>pi</code>, <code>e</code> or <code>true</code>) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L77-L80">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathIdent"href="#SBML.MathIdent"><code>SBML.MathIdent</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>An identifier (usually a variable name) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L70-L72">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathLambda"href="#SBML.MathLambda"><code>SBML.MathLambda</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Function definition (aka "lambda") in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L101-L103">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathTime"href="#SBML.MathTime"><code>SBML.MathTime</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A special value representing the current time of the simulation, with a special name.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L85-L88">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathVal"href="#SBML.MathVal"><code>SBML.MathVal</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A literal value (usually a numeric constant) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L63-L65">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Model"href="#SBML.Model"><code>SBML.Model</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Structure that collects the model-related data. Contains <code>parameters</code>, <code>units</code>, <code>compartments</code>, <code>species</code> and <code>reactions</code> and <code>gene_products</code>, and additional <code>notes</code> and <code>annotation</code> (also present internally in some of the data fields). The contained dictionaries are indexed by identifiers of the corresponding objects.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L184-L190">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Reaction"href="#SBML.Reaction"><code>SBML.Reaction</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Reaction with stoichiometry that assigns reactants and products their relative consumption/production rates (accessible in field <code>stoichiometry</code>), lower/upper bounds (in tuples <code>lb</code> and <code>ub</code>, with unit names), and objective coefficient (<code>oc</code>). Also may contains <code>notes</code> and <code>annotation</code>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L123-L128">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Species"href="#SBML.Species"><code>SBML.Species</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Species metadata – contains a human-readable <code>name</code>, a <code>compartment</code> identifier, <code>formula</code>, <code>charge</code>, and additional <code>notes</code> and <code>annotation</code>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L143-L146">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.UnitPart"href="#SBML.UnitPart"><code>SBML.UnitPart</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Part of a measurement unit definition that corresponds to the SBML definition of <code>Unit</code>. For example, the unit "per square megahour", Mh^(-2), is written as:</p><pre><codeclass="nohighlight">SBML.UnitPart("second", # base SI unit, this says we are measuring time
⋮ ⋮ ⋱ ⋮ ⋮ </code></pre><h1id="Function-reference"><aclass="docs-heading-anchor"href="#Function-reference">Function reference</a><aid="Function-reference-1"></a><aclass="docs-heading-anchor-permalink"href="#Function-reference"title="Permalink"></a></h1><h2id="Data-structures"><aclass="docs-heading-anchor"href="#Data-structures">Data structures</a><aid="Data-structures-1"></a><aclass="docs-heading-anchor-permalink"href="#Data-structures"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Maybe"href="#SBML.Maybe"><code>SBML.Maybe</code></a> — <spanclass="docstring-category">Type</span></header><section><div><pre><codeclass="language-julia">Maybe{X}</code></pre><p>Type shortcut for "<code>X</code> or nothing" or "nullable <code>X</code>" in javaspeak. Name got inspired by our functional friends.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L2-L7">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Compartment"href="#SBML.Compartment"><code>SBML.Compartment</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>SBML Compartment with sizing information.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L109-L111">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.FunctionDefinition"href="#SBML.FunctionDefinition"><code>SBML.FunctionDefinition</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Custom function definition.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L173-L175">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GPAAnd"href="#SBML.GPAAnd"><code>SBML.GPAAnd</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Boolean binary "and" in the association expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L44-L46">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GPAOr"href="#SBML.GPAOr"><code>SBML.GPAOr</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Boolean binary "or" in the association expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L51-L53">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GPARef"href="#SBML.GPARef"><code>SBML.GPARef</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Gene product reference in the association expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L37-L39">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GeneProduct"href="#SBML.GeneProduct"><code>SBML.GeneProduct</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Gene product metadata.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L162-L164">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.GeneProductAssociation"href="#SBML.GeneProductAssociation"><code>SBML.GeneProductAssociation</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Abstract type for all kinds of gene product associations</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L32-L34">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Math"href="#SBML.Math"><code>SBML.Math</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A simplified representation of MathML-specified math AST</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L58-L60">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathApply"href="#SBML.MathApply"><code>SBML.MathApply</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Function application ("call by name", no tricks allowed) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L93-L95">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathConst"href="#SBML.MathConst"><code>SBML.MathConst</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A constant identified by name (usually something like <code>pi</code>, <code>e</code> or <code>true</code>) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L77-L80">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathIdent"href="#SBML.MathIdent"><code>SBML.MathIdent</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>An identifier (usually a variable name) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L70-L72">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathLambda"href="#SBML.MathLambda"><code>SBML.MathLambda</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Function definition (aka "lambda") in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L101-L103">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathTime"href="#SBML.MathTime"><code>SBML.MathTime</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A special value representing the current time of the simulation, with a special name.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L85-L88">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.MathVal"href="#SBML.MathVal"><code>SBML.MathVal</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>A literal value (usually a numeric constant) in mathematical expression</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L63-L65">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Model"href="#SBML.Model"><code>SBML.Model</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Structure that collects the model-related data. Contains <code>parameters</code>, <code>units</code>, <code>compartments</code>, <code>species</code> and <code>reactions</code> and <code>gene_products</code>, and additional <code>notes</code> and <code>annotation</code> (also present internally in some of the data fields). The contained dictionaries are indexed by identifiers of the corresponding objects.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L184-L190">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Reaction"href="#SBML.Reaction"><code>SBML.Reaction</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Reaction with stoichiometry that assigns reactants and products their relative consumption/production rates (accessible in field <code>stoichiometry</code>), lower/upper bounds (in tuples <code>lb</code> and <code>ub</code>, with unit names), and objective coefficient (<code>oc</code>). Also may contains <code>notes</code> and <code>annotation</code>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L123-L128">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.Species"href="#SBML.Species"><code>SBML.Species</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Species metadata – contains a human-readable <code>name</code>, a <code>compartment</code> identifier, <code>formula</code>, <code>charge</code>, and additional <code>notes</code> and <code>annotation</code>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L143-L146">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.UnitPart"href="#SBML.UnitPart"><code>SBML.UnitPart</code></a> — <spanclass="docstring-category">Type</span></header><section><div><p>Part of a measurement unit definition that corresponds to the SBML definition of <code>Unit</code>. For example, the unit "per square megahour", Mh^(-2), is written as:</p><pre><codeclass="nohighlight">SBML.UnitPart("second", # base SI unit, this says we are measuring time
-2, # exponent, says "per square"
6, # log-10 scale of the unit, says "mega"
1/3600) # second-to-hour multiplier</code></pre><p>Compound units (such as "volt-amperes" and "dozens of yards per ounce") are built from multiple <code>UnitPart</code>s; see the definition of field <code>units</code> in <ahref="#SBML.Model"><code>SBML.Model</code></a>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/structs.jl#L10-L22">source</a></section></article><h2id="Base-functions"><aclass="docs-heading-anchor"href="#Base-functions">Base functions</a><aid="Base-functions-1"></a><aclass="docs-heading-anchor-permalink"href="#Base-functions"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.SBMLVersion-Tuple{}"href="#SBML.SBMLVersion-Tuple{}"><code>SBML.SBMLVersion</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">function SBMLVersion()</code></pre><p>Get the version of the used SBML library in Julia version format.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/version.jl#L2-L6">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.extractModel-Tuple{Ptr{Nothing}}"href="#SBML.extractModel-Tuple{Ptr{Nothing}}"><code>SBML.extractModel</code></a> — <spanclass="docstring-category">Method</span></header><section><div><p>" function extractModel(mdl::VPtr)::SBML.Model</p><p>Take the <code>SBMLModel_t</code> pointer and extract all information required to make a valid <ahref="#SBML.Model"><code>SBML.Model</code></a> structure.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L156-L162">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getAssociation-Tuple{Ptr{Nothing}}"href="#SBML.getAssociation-Tuple{Ptr{Nothing}}"><code>SBML.getAssociation</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">function getAssociation(x::VPtr)::GeneProductAssociation</code></pre><p>Convert a pointer to SBML <code>FbcAssociation_t</code> to the <code>GeneProductAssociation</code> tree structure.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L126-L131">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_bool-Tuple{Ptr{Nothing},Any,Any}"href="#SBML.get_optional_bool-Tuple{Ptr{Nothing},Any,Any}"><code>SBML.get_optional_bool</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_bool(x::VPtr, is_sym, get_sym)::Maybe{Bool}</code></pre><p>Helper for getting out boolean flags.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L38-L42">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_double-Tuple{Ptr{Nothing},Any,Any}"href="#SBML.get_optional_double-Tuple{Ptr{Nothing},Any,Any}"><code>SBML.get_optional_double</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_double(x::VPtr, is_sym, get_sym)::Maybe{Float64}</code></pre><p>Helper for getting out C doubles aka Float64s.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L64-L68">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_int-Tuple{Ptr{Nothing},Any,Any}"href="#SBML.get_optional_int-Tuple{Ptr{Nothing},Any,Any}"><code>SBML.get_optional_int</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_int(x::VPtr, is_sym, get_sym)::Maybe{UInt}</code></pre><p>Helper for getting out unsigned integers.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L51-L55">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_string-Tuple{Ptr{Nothing},Any}"href="#SBML.get_optional_string-Tuple{Ptr{Nothing},Any}"><code>SBML.get_optional_string</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_string(x::VPtr, fn_sym)::Maybe{String}</code></pre><p>Like <ahref="#SBML.get_string-Tuple{Ptr{Nothing},Any}"><code>get_string</code></a>, but returns <code>nothing</code> instead of throwing an exception.</p><p>This is used to get notes and annotations and several other things (see <code>get_notes</code>, <code>get_annotations</code>)</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L20-L28">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_string-Tuple{Ptr{Nothing},Any}"href="#SBML.get_string-Tuple{Ptr{Nothing},Any}"><code>SBML.get_string</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_string(x::VPtr, fn_sym)::Maybe{String}</code></pre><p>C-call the SBML function <code>fn_sym</code> with a single parameter <code>x</code>, interpret the result as a string and return it, or throw exception in case the pointer is NULL.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L4-L10">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.readSBML"href="#SBML.readSBML"><code>SBML.readSBML</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia">function readSBML(fn::String, sbml_conversion = model->nothing)::SBML.Model</code></pre><p>Read the SBML from a XML file in <code>fn</code> and return the contained <code>SBML.Model</code>.</p><p>The <code>sbml_conversion</code> is a function that does an in-place modification of the single parameter, which is the C pointer to the loaded SBML document (C type <code>SBMLDocument*</code>). Several functions for doing that are prepared, including <ahref="#SBML.set_level_and_version-Tuple{Any,Any}"><code>set_level_and_version</code></a>, <ahref="#SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"><code>libsbml_convert</code></a>, and <ahref="#SBML.convert_simplify_math"><code>convert_simplify_math</code></a>.</p><p><strong>Example</strong></p><pre><codeclass="nohighlight">m = readSBML("my_model.xml", doc -> begin
1/3600) # second-to-hour multiplier</code></pre><p>Compound units (such as "volt-amperes" and "dozens of yards per ounce") are built from multiple <code>UnitPart</code>s; see the definition of field <code>units</code> in <ahref="#SBML.Model"><code>SBML.Model</code></a>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/structs.jl#L10-L22">source</a></section></article><h2id="Base-functions"><aclass="docs-heading-anchor"href="#Base-functions">Base functions</a><aid="Base-functions-1"></a><aclass="docs-heading-anchor-permalink"href="#Base-functions"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.SBMLVersion-Tuple{}"href="#SBML.SBMLVersion-Tuple{}"><code>SBML.SBMLVersion</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">function SBMLVersion()</code></pre><p>Get the version of the used SBML library in Julia version format.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/version.jl#L2-L6">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.extractModel-Tuple{Ptr{Nothing}}"href="#SBML.extractModel-Tuple{Ptr{Nothing}}"><code>SBML.extractModel</code></a> — <spanclass="docstring-category">Method</span></header><section><div><p>" function extractModel(mdl::VPtr)::SBML.Model</p><p>Take the <code>SBMLModel_t</code> pointer and extract all information required to make a valid <ahref="#SBML.Model"><code>SBML.Model</code></a> structure.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L156-L162">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getAssociation-Tuple{Ptr{Nothing}}"href="#SBML.getAssociation-Tuple{Ptr{Nothing}}"><code>SBML.getAssociation</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">function getAssociation(x::VPtr)::GeneProductAssociation</code></pre><p>Convert a pointer to SBML <code>FbcAssociation_t</code> to the <code>GeneProductAssociation</code> tree structure.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L126-L131">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_bool-Tuple{Ptr{Nothing},Any,Any}"href="#SBML.get_optional_bool-Tuple{Ptr{Nothing},Any,Any}"><code>SBML.get_optional_bool</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_bool(x::VPtr, is_sym, get_sym)::Maybe{Bool}</code></pre><p>Helper for getting out boolean flags.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L38-L42">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_double-Tuple{Ptr{Nothing},Any,Any}"href="#SBML.get_optional_double-Tuple{Ptr{Nothing},Any,Any}"><code>SBML.get_optional_double</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_double(x::VPtr, is_sym, get_sym)::Maybe{Float64}</code></pre><p>Helper for getting out C doubles aka Float64s.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L64-L68">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_int-Tuple{Ptr{Nothing},Any,Any}"href="#SBML.get_optional_int-Tuple{Ptr{Nothing},Any,Any}"><code>SBML.get_optional_int</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_int(x::VPtr, is_sym, get_sym)::Maybe{UInt}</code></pre><p>Helper for getting out unsigned integers.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L51-L55">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_optional_string-Tuple{Ptr{Nothing},Any}"href="#SBML.get_optional_string-Tuple{Ptr{Nothing},Any}"><code>SBML.get_optional_string</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_optional_string(x::VPtr, fn_sym)::Maybe{String}</code></pre><p>Like <ahref="#SBML.get_string-Tuple{Ptr{Nothing},Any}"><code>get_string</code></a>, but returns <code>nothing</code> instead of throwing an exception.</p><p>This is used to get notes and annotations and several other things (see <code>get_notes</code>, <code>get_annotations</code>)</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L20-L28">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.get_string-Tuple{Ptr{Nothing},Any}"href="#SBML.get_string-Tuple{Ptr{Nothing},Any}"><code>SBML.get_string</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">get_string(x::VPtr, fn_sym)::Maybe{String}</code></pre><p>C-call the SBML function <code>fn_sym</code> with a single parameter <code>x</code>, interpret the result as a string and return it, or throw exception in case the pointer is NULL.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L4-L10">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.readSBML"href="#SBML.readSBML"><code>SBML.readSBML</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia">function readSBML(fn::String, sbml_conversion = model->nothing)::SBML.Model</code></pre><p>Read the SBML from a XML file in <code>fn</code> and return the contained <code>SBML.Model</code>.</p><p>The <code>sbml_conversion</code> is a function that does an in-place modification of the single parameter, which is the C pointer to the loaded SBML document (C type <code>SBMLDocument*</code>). Several functions for doing that are prepared, including <ahref="#SBML.set_level_and_version-Tuple{Any,Any}"><code>set_level_and_version</code></a>, <ahref="#SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"><code>libsbml_convert</code></a>, and <ahref="#SBML.convert_simplify_math"><code>convert_simplify_math</code></a>.</p><p><strong>Example</strong></p><pre><codeclass="nohighlight">m = readSBML("my_model.xml", doc -> begin
set_level_and_version(3, 1)(doc)
convert_simplify_math(doc)
end)</code></pre></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/readsbml.jl#L77-L95">source</a></section></article><h2id="libsbml-representation-converters"><aclass="docs-heading-anchor"href="#libsbml-representation-converters"><code>libsbml</code> representation converters</a><aid="libsbml-representation-converters-1"></a><aclass="docs-heading-anchor-permalink"href="#libsbml-representation-converters"title="Permalink"></a></h2><p>The converters are intended to be used as parameters of <ahref="#SBML.readSBML"><code>readSBML</code></a>.</p><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.convert_simplify_math"href="#SBML.convert_simplify_math"><code>SBML.convert_simplify_math</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia">convert_simplify_math</code></pre><p>Shortcut for <ahref="#SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"><code>libsbml_convert</code></a> that expands functions, local parameters, and initial assignments in the SBML document.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/converters.jl#L64-L69">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"href="#SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"><code>SBML.libsbml_convert</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">libsbml_convert(conversion_options::Vector{Pair{String, Dict{String, String}}})</code></pre><p>A converter that runs the SBML conversion routine, with specified conversion options. The argument is a vector of pairs to allow specifying the order of conversions.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/converters.jl#L20-L26">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.libsbml_convert-Tuple{String}"href="#SBML.libsbml_convert-Tuple{String}"><code>SBML.libsbml_convert</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">libsbml_convert(converter::String; kwargs...)</code></pre><p>Quickly construct a single run of a <code>libsbml</code> converter from keyword arguments.</p><p><strong>Example</strong></p><pre><codeclass="nohighlight">readSBML("example.xml", libsbml_convert("stripPackage", package="layout"))</code></pre></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/converters.jl#L50-L59">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.set_level_and_version-Tuple{Any,Any}"href="#SBML.set_level_and_version-Tuple{Any,Any}"><code>SBML.set_level_and_version</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">set_level_and_version(level, version)</code></pre><p>A converter to pass into <ahref="#SBML.readSBML"><code>readSBML</code></a> that enforces certain SBML level and version.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/converters.jl#L2-L7">source</a></section></article><h2id="Data-helpers"><aclass="docs-heading-anchor"href="#Data-helpers">Data helpers</a><aid="Data-helpers-1"></a><aclass="docs-heading-anchor-permalink"href="#Data-helpers"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.extensive_kinetic_math-Tuple{SBML.Model,SBML.Math}"href="#SBML.extensive_kinetic_math-Tuple{SBML.Model,SBML.Math}"><code>SBML.extensive_kinetic_math</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">extensive_kinetic_math(m::SBML.Model, formula::SBML.Math)</code></pre><p>Convert a SBML math <code>formula</code> to "extensive" kinetic laws, where the references to species that are marked as not having only substance units are converted from amounts to concentrations.</p><p>Handling of units in the conversion process is ignored in this version.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/utils.jl#L105-L113">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getLBs-Tuple{SBML.Model}"href="#SBML.getLBs-Tuple{SBML.Model}"><code>SBML.getLBs</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">getLBs(m::SBML.Model)::Vector{Tuple{Float64,String}}</code></pre><p>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).</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/utils.jl#L27-L33">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getOCs-Tuple{SBML.Model}"href="#SBML.getOCs-Tuple{SBML.Model}"><code>SBML.getOCs</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">getOCs(m::SBML.Model)::Vector{Float64}</code></pre><p>Extract the vector of objective coefficients of each reaction.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/utils.jl#L45-L49">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getS-Tuple{SBML.Model}"href="#SBML.getS-Tuple{SBML.Model}"><code>SBML.getS</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">function getS(m::SBML.Model; zeros=spzeros)::Tuple{Vector{String},Vector{String},AbstractMatrix{Float64}}</code></pre><p>Extract the vector of species (aka metabolite) identifiers, vector of reaction identifiers, and the (dense) stoichiometry matrix from an existing <code>SBML.Model</code>. Returns a tuple with these values.</p><p>The matrix is sparse by default (initially constructed by <code>SparseArrays.spzeros</code>). You can fill in a custom empty matrix constructed to argument <code>zeros</code>; e.g. running with <code>zeros=zeros</code> will produce a dense matrix.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/utils.jl#L1-L11">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getUBs-Tuple{SBML.Model}"href="#SBML.getUBs-Tuple{SBML.Model}"><code>SBML.getUBs</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">getUBs(m::SBML.Model)::Vector{Tuple{Float64,String}}</code></pre><p>Likewise to <ahref="#SBML.getLBs-Tuple{SBML.Model}"><code>getLBs</code></a>, extract the upper bounds.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/utils.jl#L37-L41">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.initial_amounts-Tuple{SBML.Model}"href="#SBML.initial_amounts-Tuple{SBML.Model}"><code>SBML.initial_amounts</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">initial_amounts(m::SBML.Model; convert_concentrations = false)</code></pre><p>Return initial amounts for each species as a generator of pairs <code>species_name => initial_amount</code>; the amount is set to <code>nothing</code> if not available. If <code>convert_concentrations</code> is true and there is information about initial concentration available together with compartment size, the result is computed from the species' initial concentration.</p><p>In the current version, units of the measurements are completely ignored.</p><p><strong>Example</strong></p><pre><codeclass="nohighlight"># get the initial amounts as dictionary
end)</code></pre></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/readsbml.jl#L77-L95">source</a></section></article><h2id="libsbml-representation-converters"><aclass="docs-heading-anchor"href="#libsbml-representation-converters"><code>libsbml</code> representation converters</a><aid="libsbml-representation-converters-1"></a><aclass="docs-heading-anchor-permalink"href="#libsbml-representation-converters"title="Permalink"></a></h2><p>The converters are intended to be used as parameters of <ahref="#SBML.readSBML"><code>readSBML</code></a>.</p><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.convert_simplify_math"href="#SBML.convert_simplify_math"><code>SBML.convert_simplify_math</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia">convert_simplify_math</code></pre><p>Shortcut for <ahref="#SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"><code>libsbml_convert</code></a> that expands functions, local parameters, and initial assignments in the SBML document.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/converters.jl#L64-L69">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"href="#SBML.libsbml_convert-Tuple{AbstractArray{var"#s50",1} where var"#s50"<:(Pair{String,var"#s49"} where var"#s49"<:AbstractDict{String,String})}"><code>SBML.libsbml_convert</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">libsbml_convert(conversion_options::Vector{Pair{String, Dict{String, String}}})</code></pre><p>A converter that runs the SBML conversion routine, with specified conversion options. The argument is a vector of pairs to allow specifying the order of conversions.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/converters.jl#L20-L26">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.libsbml_convert-Tuple{String}"href="#SBML.libsbml_convert-Tuple{String}"><code>SBML.libsbml_convert</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">libsbml_convert(converter::String; kwargs...)</code></pre><p>Quickly construct a single run of a <code>libsbml</code> converter from keyword arguments.</p><p><strong>Example</strong></p><pre><codeclass="nohighlight">readSBML("example.xml", libsbml_convert("stripPackage", package="layout"))</code></pre></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/converters.jl#L50-L59">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.set_level_and_version-Tuple{Any,Any}"href="#SBML.set_level_and_version-Tuple{Any,Any}"><code>SBML.set_level_and_version</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">set_level_and_version(level, version)</code></pre><p>A converter to pass into <ahref="#SBML.readSBML"><code>readSBML</code></a> that enforces certain SBML level and version.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/converters.jl#L2-L7">source</a></section></article><h2id="Data-helpers"><aclass="docs-heading-anchor"href="#Data-helpers">Data helpers</a><aid="Data-helpers-1"></a><aclass="docs-heading-anchor-permalink"href="#Data-helpers"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.extensive_kinetic_math-Tuple{SBML.Model,SBML.Math}"href="#SBML.extensive_kinetic_math-Tuple{SBML.Model,SBML.Math}"><code>SBML.extensive_kinetic_math</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">extensive_kinetic_math(m::SBML.Model, formula::SBML.Math)</code></pre><p>Convert a SBML math <code>formula</code> to "extensive" kinetic laws, where the references to species that are marked as not having only substance units are converted from amounts to concentrations.</p><p>Handling of units in the conversion process is ignored in this version.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/utils.jl#L105-L113">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getLBs-Tuple{SBML.Model}"href="#SBML.getLBs-Tuple{SBML.Model}"><code>SBML.getLBs</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">getLBs(m::SBML.Model)::Vector{Tuple{Float64,String}}</code></pre><p>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).</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/utils.jl#L27-L33">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getOCs-Tuple{SBML.Model}"href="#SBML.getOCs-Tuple{SBML.Model}"><code>SBML.getOCs</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">getOCs(m::SBML.Model)::Vector{Float64}</code></pre><p>Extract the vector of objective coefficients of each reaction.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/utils.jl#L45-L49">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getS-Tuple{SBML.Model}"href="#SBML.getS-Tuple{SBML.Model}"><code>SBML.getS</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">function getS(m::SBML.Model; zeros=spzeros)::Tuple{Vector{String},Vector{String},AbstractMatrix{Float64}}</code></pre><p>Extract the vector of species (aka metabolite) identifiers, vector of reaction identifiers, and the (dense) stoichiometry matrix from an existing <code>SBML.Model</code>. Returns a tuple with these values.</p><p>The matrix is sparse by default (initially constructed by <code>SparseArrays.spzeros</code>). You can fill in a custom empty matrix constructed to argument <code>zeros</code>; e.g. running with <code>zeros=zeros</code> will produce a dense matrix.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/utils.jl#L1-L11">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.getUBs-Tuple{SBML.Model}"href="#SBML.getUBs-Tuple{SBML.Model}"><code>SBML.getUBs</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">getUBs(m::SBML.Model)::Vector{Tuple{Float64,String}}</code></pre><p>Likewise to <ahref="#SBML.getLBs-Tuple{SBML.Model}"><code>getLBs</code></a>, extract the upper bounds.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/utils.jl#L37-L41">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.initial_amounts-Tuple{SBML.Model}"href="#SBML.initial_amounts-Tuple{SBML.Model}"><code>SBML.initial_amounts</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">initial_amounts(m::SBML.Model; convert_concentrations = false)</code></pre><p>Return initial amounts for each species as a generator of pairs <code>species_name => initial_amount</code>; the amount is set to <code>nothing</code> if not available. If <code>convert_concentrations</code> is true and there is information about initial concentration available together with compartment size, the result is computed from the species' initial concentration.</p><p>In the current version, units of the measurements are completely ignored.</p><p><strong>Example</strong></p><pre><codeclass="nohighlight"># get the initial amounts as dictionary
Dict(k => v for (k,v) in initial_amounts(model) if !isnothing(v))</code></pre></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/utils.jl#L52-L71">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.initial_concentrations-Tuple{SBML.Model}"href="#SBML.initial_concentrations-Tuple{SBML.Model}"><code>SBML.initial_concentrations</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">initial_concentrations(m::SBML.Model; convert_amounts = false)</code></pre><p>Return initial concentrations of the species in the model. Refer to work-alike <ahref="#SBML.initial_amounts-Tuple{SBML.Model}"><code>initial_amounts</code></a> for details.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/utils.jl#L85-L90">source</a></section></article><h2id="Math-and-Symbolics.jl-compatibility"><aclass="docs-heading-anchor"href="#Math-and-Symbolics.jl-compatibility">Math and <code>Symbolics.jl</code> compatibility</a><aid="Math-and-Symbolics.jl-compatibility-1"></a><aclass="docs-heading-anchor-permalink"href="#Math-and-Symbolics.jl-compatibility"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.default_symbolics_mapping"href="#SBML.default_symbolics_mapping"><code>SBML.default_symbolics_mapping</code></a> — <spanclass="docstring-category">Constant</span></header><section><div><pre><codeclass="language-julia">default_symbolics_mapping :: Dict{String,Any}</code></pre><p>Default mapping of SBML function names to Julia functions, represented as a dictionary from Strings (SBML names) to anything <code>eval</code>uable as Julia&Symbolics functions, such as symbols and expressions.</p><p>The default mapping only contains the basic SBML functions that are unambiguously represented in Julia; it is supposed to be extended by the user if more functions need to be supported.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/symbolics.jl#L2-L12">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="Base.convert-Tuple{Type{Symbolics.Num},SBML.Math}"href="#Base.convert-Tuple{Type{Symbolics.Num},SBML.Math}"><code>Base.convert</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">Base.convert(
Dict(k => v for (k,v) in initial_amounts(model) if !isnothing(v))</code></pre></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/utils.jl#L52-L71">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.initial_concentrations-Tuple{SBML.Model}"href="#SBML.initial_concentrations-Tuple{SBML.Model}"><code>SBML.initial_concentrations</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">initial_concentrations(m::SBML.Model; convert_amounts = false)</code></pre><p>Return initial concentrations of the species in the model. Refer to work-alike <ahref="#SBML.initial_amounts-Tuple{SBML.Model}"><code>initial_amounts</code></a> for details.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/utils.jl#L85-L90">source</a></section></article><h2id="Math-and-Symbolics.jl-compatibility"><aclass="docs-heading-anchor"href="#Math-and-Symbolics.jl-compatibility">Math and <code>Symbolics.jl</code> compatibility</a><aid="Math-and-Symbolics.jl-compatibility-1"></a><aclass="docs-heading-anchor-permalink"href="#Math-and-Symbolics.jl-compatibility"title="Permalink"></a></h2><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.default_symbolics_constants"href="#SBML.default_symbolics_constants"><code>SBML.default_symbolics_constants</code></a> — <spanclass="docstring-category">Constant</span></header><section><div><pre><codeclass="language-julia">const default_symbolics_constants::Dict{String, Any}</code></pre><p>A dictionary of default constants filled in place of SBML Math constants in the symbolics conversion.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/symbolics.jl#L69-L74">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.default_symbolics_mapping"href="#SBML.default_symbolics_mapping"><code>SBML.default_symbolics_mapping</code></a> — <spanclass="docstring-category">Constant</span></header><section><div><pre><codeclass="language-julia">default_symbolics_mapping :: Dict{String,Any}</code></pre><p>Default mapping of SBML function names to Julia functions, represented as a dictionary from Strings (SBML names) to anything <code>eval</code>uable as Julia&Symbolics functions, such as symbols and expressions.</p><p>The default mapping only contains the basic SBML functions that are unambiguously represented in Julia; it is supposed to be extended by the user if more functions need to be supported.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/symbolics.jl#L2-L12">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="Base.convert-Tuple{Type{Symbolics.Num},SBML.Math}"href="#Base.convert-Tuple{Type{Symbolics.Num},SBML.Math}"><code>Base.convert</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">Base.convert(
)</code></pre><p>Convert SBML.<ahref="#SBML.Math"><code>Math</code></a> to <code>Num</code> type from Symbolics package. The conversion of functions can be customized by supplying a custom mapping; if nothing is supplied, <ahref="#SBML.default_symbolics_mapping"><code>default_symbolics_mapping</code></a> that translates basic functions to their Julia equivalents is assumed.</p><p>Translation of <ahref="#SBML.MathLambda"><code>MathLambda</code></a> is not supported by Symbolics.</p><p><ahref="#SBML.MathTime"><code>MathTime</code></a> is handled specially, the function from the argument <code>convert_time</code> is called to possibly specify any desired behavior. By default, it just creates a variable with the same name as the time variable name stored in SBML.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/symbolics.jl#L69-L88">source</a></section></article><h3id="Internal-math-helpers"><aclass="docs-heading-anchor"href="#Internal-math-helpers">Internal math helpers</a><aid="Internal-math-helpers-1"></a><aclass="docs-heading-anchor-permalink"href="#Internal-math-helpers"title="Permalink"></a></h3><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.ast_is-Tuple{Ptr{Nothing},Symbol}"href="#SBML.ast_is-Tuple{Ptr{Nothing},Symbol}"><code>SBML.ast_is</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">ast_is(ast::VPtr, what::Symbol)::Bool</code></pre><p>Helper for quickly recognizing kinds of ASTs</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/math.jl#L2-L6">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.parse_math-Tuple{Ptr{Nothing}}"href="#SBML.parse_math-Tuple{Ptr{Nothing}}"><code>SBML.parse_math</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">parse_math(ast::VPtr)::Math</code></pre><p>This attempts to parse out a decent Julia-esque (<ahref="#SBML.Math"><code>Math</code></a> AST from a pointer to <code>ASTNode_t</code>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/math.jl#L19-L24">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.parse_math_children-Tuple{Ptr{Nothing}}"href="#SBML.parse_math_children-Tuple{Ptr{Nothing}}"><code>SBML.parse_math_children</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">parse_math_children(ast::VPtr)::Vector{Math}</code></pre><p>Recursively parse all children of an AST node.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/f2410e40d3b3f32c7ad69cfe05e79831595e7ff3/src/math.jl#L9-L13">source</a></section></article></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.3 on <spanclass="colophon-date"title="Thursday 1 July 2021 05:33">Thursday 1 July 2021</span>. Using Julia version 1.5.4.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></html>
)</code></pre><p>Convert SBML.<ahref="#SBML.Math"><code>Math</code></a> to <code>Num</code> type from Symbolics package. The conversion of functions can be customized by supplying a custom mapping; if nothing is supplied, <ahref="#SBML.default_symbolics_mapping"><code>default_symbolics_mapping</code></a> that translates basic functions to their Julia equivalents is assumed.</p><p>Translation of <ahref="#SBML.MathLambda"><code>MathLambda</code></a> is not supported by Symbolics.</p><p><ahref="#SBML.MathTime"><code>MathTime</code></a> is handled specially, the function from the argument <code>convert_time</code> is called to possibly specify any desired behavior. By default, it just creates a variable with the same name as the time variable name stored in SBML.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/symbolics.jl#L78-L98">source</a></section></article><h3id="Internal-math-helpers"><aclass="docs-heading-anchor"href="#Internal-math-helpers">Internal math helpers</a><aid="Internal-math-helpers-1"></a><aclass="docs-heading-anchor-permalink"href="#Internal-math-helpers"title="Permalink"></a></h3><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.ast_is-Tuple{Ptr{Nothing},Symbol}"href="#SBML.ast_is-Tuple{Ptr{Nothing},Symbol}"><code>SBML.ast_is</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">ast_is(ast::VPtr, what::Symbol)::Bool</code></pre><p>Helper for quickly recognizing kinds of ASTs</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/math.jl#L2-L6">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.parse_math-Tuple{Ptr{Nothing}}"href="#SBML.parse_math-Tuple{Ptr{Nothing}}"><code>SBML.parse_math</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">parse_math(ast::VPtr)::Math</code></pre><p>This attempts to parse out a decent Julia-esque (<ahref="#SBML.Math"><code>Math</code></a> AST from a pointer to <code>ASTNode_t</code>.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/math.jl#L19-L24">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="SBML.parse_math_children-Tuple{Ptr{Nothing}}"href="#SBML.parse_math_children-Tuple{Ptr{Nothing}}"><code>SBML.parse_math_children</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia">parse_math_children(ast::VPtr)::Vector{Math}</code></pre><p>Recursively parse all children of an AST node.</p></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/LCSB-BioCore/SBML.jl/blob/e31a69714bcd28b4f8dd76fc460364815f74fb06/src/math.jl#L9-L13">source</a></section></article></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.3 on <spanclass="colophon-date"title="Thursday 1 July 2021 12:23">Thursday 1 July 2021</span>. Using Julia version 1.5.4.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></html>
<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Search · SBML.jl</title><script data-outdated-warnersrc="../assets/warner.js"></script><linkrel="canonical"href="https://lcsb-biocore.github.io/DistributedData.jl/stable/search/"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.039/juliamono-regular.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"data-theme-primary-dark/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><aclass="docs-logo"href="../"><imgsrc="../assets/logo.svg"alt="SBML.jl logo"/></a><divclass="docs-package-name"><spanclass="docs-autofit"><ahref="../">SBML.jl</a></span></div><formclass="docs-search"action><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Documentation</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><liclass="is-active"><ahref>Search</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Search</a></li></ul></nav><divclass="docs-right"><aclass="docs-settings-button fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><article><pid="documenter-search-info">Loading search...</p><ulid="documenter-search-results"></ul></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.3 on <spanclass="colophon-date"title="Thursday 1 July 2021 05:33">Thursday 1 July 2021</span>. Using Julia version 1.5.4.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body><script src="../search_index.js"></script><script src="../assets/search.js"></script></html>
<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Search · SBML.jl</title><script data-outdated-warnersrc="../assets/warner.js"></script><linkrel="canonical"href="https://lcsb-biocore.github.io/DistributedData.jl/stable/search/"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.039/juliamono-regular.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"data-theme-primary-dark/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><aclass="docs-logo"href="../"><imgsrc="../assets/logo.svg"alt="SBML.jl logo"/></a><divclass="docs-package-name"><spanclass="docs-autofit"><ahref="../">SBML.jl</a></span></div><formclass="docs-search"action><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Documentation</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><liclass="is-active"><ahref>Search</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Search</a></li></ul></nav><divclass="docs-right"><aclass="docs-settings-button fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><article><pid="documenter-search-info">Loading search...</p><ulid="documenter-search-results"></ul></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.3 on <spanclass="colophon-date"title="Thursday 1 July 2021 12:23">Thursday 1 July 2021</span>. Using Julia version 1.5.4.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body><script src="../search_index.js"></script><script src="../assets/search.js"></script></html>
[{"location":"#SBML.jl-—-load-systems-biology-models-from-SBML-files","page":"Documentation","title":"SBML.jl — load systems biology models from SBML files","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"This package provides a straightforward way to load model- and simulation-relevant information from SBML files.","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"The library provides a single function readSBML to load a SBML.Model:","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"julia> using SBML\njulia> mdl = readSBML(\"Ec_core_flux1.xml\")\nSBML.Model(…)\n\njulia> mdl.compartments\n2-element Array{String,1}:\n\"Extra_organism\"\n\"Cytosol\"","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"There are several functions to help you with using the data in the usual COBRA-style workflows, such as getS:","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"julia> metabolites, reactions, S = getS(mdl)\njulia> metabolites\n77-element Array{String,1}:\n\"M_succoa_c\"\n\"M_ac_c\"\n\"M_etoh_c\"\n ⋮\n\njulia> S\n77×77 SparseArrays.SparseMatrixCSC{Float64,Int64} with 308 stored entries:\n [60, 1] = -1.0\n [68, 1] = 1.0\n [1 , 2] = 1.0\n [6 , 2] = -1.0\n ⋮\n [23, 76] = 1.0\n [56, 76] = -1.0\n [30, 77] = -1.0\n [48, 77] = 1.0\n\njulia> Matrix(S)\n77×77 Array{Float64,2}:\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n ⋮ ⋮ ⋱ ⋮ ⋮ ","category":"page"},{"location":"#Function-reference","page":"Documentation","title":"Function reference","text":"","category":"section"},{"location":"#Data-structures","page":"Documentation","title":"Data structures","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"structs.jl\"]","category":"page"},{"location":"#SBML.Maybe","page":"Documentation","title":"SBML.Maybe","text":"Maybe{X}\n\nType shortcut for \"X or nothing\" or \"nullable X\" in javaspeak. Name got inspired by our functional friends.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Compartment","page":"Documentation","title":"SBML.Compartment","text":"SBML Compartment with sizing information.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.FunctionDefinition","page":"Documentation","title":"SBML.FunctionDefinition","text":"Custom function definition.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GPAAnd","page":"Documentation","title":"SBML.GPAAnd","text":"Boolean binary \"and\" in the association expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GPAOr","page":"Documentation","title":"SBML.GPAOr","text":"Boolean binary \"or\" in the association expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GPARef","page":"Documentation","title":"SBML.GPARef","text":"Gene product reference in the association expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GeneProduct","page":"Documentation","title":"SBML.GeneProduct","text":"Gene product metadata.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GeneProductAssociation","page":"Documentation","title":"SBML.GeneProductAssociation","text":"Abstract type for all kinds of gene product associations\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Math","page":"Documentation","title":"SBML.Math","text":"A simplified representation of MathML-specified math AST\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathApply","page":"Documentation","title":"SBML.MathApply","text":"Function application (\"call by name\", no tricks allowed) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathConst","page":"Documentation","title":"SBML.MathConst","text":"A constant identified by name (usually something like pi, e or true) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathIdent","page":"Documentation","title":"SBML.MathIdent","text":"An identifier (usually a variable name) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathLambda","page":"Documentation","title":"SBML.MathLambda","text":"Function definition (aka \"lambda\") in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathTime","page":"Documentation","title":"SBML.MathTime","text":"A special value representing the current time of the simulation, with a special name.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathVal","page":"Documentation","title":"SBML.MathVal","text":"A literal value (usually a numeric constant) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Model","page":"Documentation","title":"SBML.Model","text":"Structure that collects the model-related data. Contains parameters, units, compartments, species and reactions and gene_products, and additional notes and annotation (also present internally in some of the data fields). The contained dictionaries are indexed by identifiers of the corresponding objects.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Reaction","page":"Documentation","title":"SBML.Reaction","text":"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). Also may contains notes and annotation.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Species","page":"Documentation","title":"SBML.Species","text":"Species metadata – contains a human-readable name, a compartment identifier, formula, charge, and additional notes and annotation.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.UnitPart","page":"Documentation","title":"SBML.UnitPart","text":"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:\n\nSBML.UnitPart(\"second\", # base SI unit, this says we are measuring time\n -2, # exponent, says \"per square\"\n 6, # log-10 scale of the unit, says \"mega\"\n 1/3600) # second-to-hour multiplier\n\nCompound units (such as \"volt-amperes\" and \"dozens of yards per ounce\") are built from multiple UnitParts; see the definition of field units in SBML.Model.\n\n\n\n\n\n","category":"type"},{"location":"#Base-functions","page":"Documentation","title":"Base functions","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"version.jl\", \"readsbml.jl\"]","category":"page"},{"location":"#SBML.SBMLVersion-Tuple{}","page":"Documentation","title":"SBML.SBMLVersion","text":"function SBMLVersion()\n\nGet the version of the used SBML library in Julia version format.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.extractModel-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.extractModel","text":"\" function extractModel(mdl::VPtr)::SBML.Model\n\nTake the SBMLModel_t pointer and extract all information required to make a valid SBML.Model structure.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getAssociation-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.getAssociation","text":"function getAssociation(x::VPtr)::GeneProductAssociation\n\nConvert a pointer to SBML FbcAssociation_t to the GeneProductAssociation tree structure.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_bool-Tuple{Ptr{Nothing},Any,Any}","page":"Documentation","title":"SBML.get_optional_bool","text":"get_optional_bool(x::VPtr, is_sym, get_sym)::Maybe{Bool}\n\nHelper for getting out boolean flags.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_double-Tuple{Ptr{Nothing},Any,Any}","page":"Documentation","title":"SBML.get_optional_double","text":"get_optional_double(x::VPtr, is_sym, get_sym)::Maybe{Float64}\n\nHelper for getting out C doubles aka Float64s.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_int-Tuple{Ptr{Nothing},Any,Any}","page":"Documentation","title":"SBML.get_optional_int","text":"get_optional_int(x::VPtr, is_sym, get_sym)::Maybe{UInt}\n\nHelper for getting out unsigned integers.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_string-Tuple{Ptr{Nothing},Any}","page":"Documentation","title":"SBML.get_optional_string","text":"get_optional_string(x::VPtr, fn_sym)::Maybe{String}\n\nLike get_string, but returns nothing instead of throwing an exception.\n\nThis is used to get notes and annotations and several other things (see get_notes, get_annotations)\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_string-Tuple{Ptr{Nothing},Any}","page":"Documentation","title":"SBML.get_string","text":"get_string(x::VPtr, fn_sym)::Maybe{String}\n\nC-call the SBML function fn_sym with a single parameter x, interpret the result as a string and return it, or throw exception in case the pointer is NULL.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.readSBML","page":"Documentation","title":"SBML.readSBML","text":"function readSBML(fn::String, sbml_conversion = model->nothing)::SBML.Model\n\nRead the SBML from a XML file in fn and return the contained SBML.Model.\n\nThe sbml_conversion is a function that does an in-place modification of the single parameter, which is the C pointer to the loaded SBML document (C type SBMLDocument*). Several functions for doing that are prepared, including set_level_and_version, libsbml_convert, and convert_simplify_math.\n\nExample\n\nm = readSBML(\"my_model.xml\", doc -> begin\n set_level_and_version(3, 1)(doc)\n convert_simplify_math(doc)\nend)\n\n\n\n\n\n","category":"function"},{"location":"#libsbml-representation-converters","page":"Documentation","title":"libsbml representation converters","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"The converters are intended to be used as parameters of readSBML.","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"converters.jl\"]","category":"page"},{"location":"#SBML.convert_simplify_math","page":"Documentation","title":"SBML.convert_simplify_math","text":"convert_simplify_math\n\nShortcut for libsbml_convert that expands functions, local parameters, and initial assignments in the SBML document.\n\n\n\n\n\n","category":"function"},{"location":"#SBML.libsbml_convert-Tuple{AbstractArray{var\"#s50\",1} where var\"#s50\"<:(Pair{String,var\"#s49\"} where var\"#s49\"<:AbstractDict{String,String})}","page":"Documentation","title":"SBML.libsbml_convert","text":"libsbml_convert(conversion_options::Vector{Pair{String, Dict{String, String}}})\n\nA converter that runs the SBML conversion routine, with specified conversion options. The argument is a vector of pairs to allow specifying the order of conversions.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.libsbml_convert-Tuple{String}","page":"Documentation","title":"SBML.libsbml_convert","text":"libsbml_convert(converter::String; kwargs...)\n\nQuickly construct a single run of a libsbml converter from keyword arguments.\n\nExample\n\nreadSBML(\"example.xml\", libsbml_convert(\"stripPackage\", package=\"layout\"))\n\n\n\n\n\n","category":"method"},{"location":"#SBML.set_level_and_version-Tuple{Any,Any}","page":"Documentation","title":"SBML.set_level_and_version","text":"set_level_and_version(level, version)\n\nA converter to pass into readSBML that enforces certain SBML level and version.\n\n\n\n\n\n","category":"method"},{"location":"#Data-helpers","page":"Documentation","title":"Data helpers","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"utils.jl\"]","category":"page"},{"location":"#SBML.extensive_kinetic_math-Tuple{SBML.Model,SBML.Math}","page":"Documentation","title":"SBML.extensive_kinetic_math","text":"extensive_kinetic_math(m::SBML.Model, formula::SBML.Math)\n\nConvert a SBML math formula to \"extensive\" kinetic laws, where the references to species that are marked as not having only substance units are converted from amounts to concentrations.\n\nHandling of units in the conversion process is ignored in this version.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getLBs-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getLBs","text":"getLBs(m::SBML.Model)::Vector{Tuple{Float64,String}}\n\nExtract 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).\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getOCs-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getOCs","text":"getOCs(m::SBML.Model)::Vector{Float64}\n\nExtract the vector of objective coefficients of each reaction.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getS-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getS","text":"function getS(m::SBML.Model; zeros=spzeros)::Tuple{Vector{String},Vector{String},AbstractMatrix{Float64}}\n\nExtract the vector of species (aka metabolite) identifiers, vector of reaction identifiers, and the (dense) stoichiometry matrix from an existing SBML.Model. Returns a tuple with these values.\n\nThe matrix is sparse by default (initially constructed by SparseArrays.spzeros). You can fill in a custom empty matrix constructed to argument zeros; e.g. running with zeros=zeros will produce a dense matrix.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getUBs-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getUBs","text":"getUBs(m::SBML.Model)::Vector{Tuple{Float64,String}}\n\nLikewise to getLBs, extract the upper bounds.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.initial_amounts-Tuple{SBML.Model}","page":"Documentation","title":"SBML.initial_amounts","text":"initial_amounts(m::SBML.Model; convert_concentrations = false)\n\nReturn initial amounts for each species as a generator of pairs species_name => initial_amount; the amount is set to nothing if not available. If convert_concentrations is true and there is information about initial concentration available together with compartment size, the result is computed from the species' initial concentration.\n\nIn the current version, units of the measurements are completely ignored.\n\nExample\n\n# get the initial amounts as dictionary\nDict(initial_amounts(model, convert_concentrations = true))\n\n# remove the empty entries\nDict(k => v for (k,v) in initial_amounts(model) if !isnothing(v))\n\n\n\n\n\n","category":"method"},{"location":"#SBML.initial_concentrations-Tuple{SBML.Model}","page":"Documentation","title":"SBML.initial_concentrations","text":"initial_concentrations(m::SBML.Model; convert_amounts = false)\n\nReturn initial concentrations of the species in the model. Refer to work-alike initial_amounts for details.\n\n\n\n\n\n","category":"method"},{"location":"#Math-and-Symbolics.jl-compatibility","page":"Documentation","title":"Math and Symbolics.jl compatibility","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"symbolics.jl\"]","category":"page"},{"location":"#SBML.default_symbolics_mapping","page":"Documentation","title":"SBML.default_symbolics_mapping","text":"default_symbolics_mapping :: Dict{String,Any}\n\nDefault mapping of SBML function names to Julia functions, represented as a dictionary from Strings (SBML names) to anything evaluable as Julia&Symbolics functions, such as symbols and expressions.\n\nThe default mapping only contains the basic SBML functions that are unambiguously represented in Julia; it is supposed to be extended by the user if more functions need to be supported.\n\n\n\n\n\n","category":"constant"},{"location":"#Base.convert-Tuple{Type{Symbolics.Num},SBML.Math}","page":"Documentation","title":"Base.convert","text":"Base.convert(\n ::Type{Num},\n x::SBML.Math;\n mapping = default_symbolics_mapping,\n convert_time = (x::SBML.MathTime) -> Num(Variable(Symbol(x.id))).val,\n)\n\nConvert SBML.Math to Num type from Symbolics package. The conversion of functions can be customized by supplying a custom mapping; if nothing is supplied, default_symbolics_mapping that translates basic functions to their Julia equivalents is assumed.\n\nTranslation of MathLambda is not supported by Symbolics.\n\nMathTime is handled specially, the function from the argument convert_time is called to possibly specify any desired behavior. By default, it just creates a variable with the same name as the time variable name stored in SBML.\n\n\n\n\n\n","category":"method"},{"location":"#Internal-math-helpers","page":"Documentation","title":"Internal math helpers","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"math.jl\"]","category":"page"},{"location":"#SBML.ast_is-Tuple{Ptr{Nothing},Symbol}","page":"Documentation","title":"SBML.ast_is","text":"ast_is(ast::VPtr, what::Symbol)::Bool\n\nHelper for quickly recognizing kinds of ASTs\n\n\n\n\n\n","category":"method"},{"location":"#SBML.parse_math-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.parse_math","text":"parse_math(ast::VPtr)::Math\n\nThis attempts to parse out a decent Julia-esque (Math AST from a pointer to ASTNode_t.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.parse_math_children-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.parse_math_children","text":"parse_math_children(ast::VPtr)::Vector{Math}\n\nRecursively parse all children of an AST node.\n\n\n\n\n\n","category":"method"}]
[{"location":"#SBML.jl-—-load-systems-biology-models-from-SBML-files","page":"Documentation","title":"SBML.jl — load systems biology models from SBML files","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"This package provides a straightforward way to load model- and simulation-relevant information from SBML files.","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"The library provides a single function readSBML to load a SBML.Model:","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"julia> using SBML\njulia> mdl = readSBML(\"Ec_core_flux1.xml\")\nSBML.Model(…)\n\njulia> mdl.compartments\n2-element Array{String,1}:\n\"Extra_organism\"\n\"Cytosol\"","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"There are several functions to help you with using the data in the usual COBRA-style workflows, such as getS:","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"julia> metabolites, reactions, S = getS(mdl)\njulia> metabolites\n77-element Array{String,1}:\n\"M_succoa_c\"\n\"M_ac_c\"\n\"M_etoh_c\"\n ⋮\n\njulia> S\n77×77 SparseArrays.SparseMatrixCSC{Float64,Int64} with 308 stored entries:\n [60, 1] = -1.0\n [68, 1] = 1.0\n [1 , 2] = 1.0\n [6 , 2] = -1.0\n ⋮\n [23, 76] = 1.0\n [56, 76] = -1.0\n [30, 77] = -1.0\n [48, 77] = 1.0\n\njulia> Matrix(S)\n77×77 Array{Float64,2}:\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n 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\n ⋮ ⋮ ⋱ ⋮ ⋮ ","category":"page"},{"location":"#Function-reference","page":"Documentation","title":"Function reference","text":"","category":"section"},{"location":"#Data-structures","page":"Documentation","title":"Data structures","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"structs.jl\"]","category":"page"},{"location":"#SBML.Maybe","page":"Documentation","title":"SBML.Maybe","text":"Maybe{X}\n\nType shortcut for \"X or nothing\" or \"nullable X\" in javaspeak. Name got inspired by our functional friends.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Compartment","page":"Documentation","title":"SBML.Compartment","text":"SBML Compartment with sizing information.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.FunctionDefinition","page":"Documentation","title":"SBML.FunctionDefinition","text":"Custom function definition.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GPAAnd","page":"Documentation","title":"SBML.GPAAnd","text":"Boolean binary \"and\" in the association expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GPAOr","page":"Documentation","title":"SBML.GPAOr","text":"Boolean binary \"or\" in the association expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GPARef","page":"Documentation","title":"SBML.GPARef","text":"Gene product reference in the association expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GeneProduct","page":"Documentation","title":"SBML.GeneProduct","text":"Gene product metadata.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.GeneProductAssociation","page":"Documentation","title":"SBML.GeneProductAssociation","text":"Abstract type for all kinds of gene product associations\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Math","page":"Documentation","title":"SBML.Math","text":"A simplified representation of MathML-specified math AST\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathApply","page":"Documentation","title":"SBML.MathApply","text":"Function application (\"call by name\", no tricks allowed) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathConst","page":"Documentation","title":"SBML.MathConst","text":"A constant identified by name (usually something like pi, e or true) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathIdent","page":"Documentation","title":"SBML.MathIdent","text":"An identifier (usually a variable name) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathLambda","page":"Documentation","title":"SBML.MathLambda","text":"Function definition (aka \"lambda\") in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathTime","page":"Documentation","title":"SBML.MathTime","text":"A special value representing the current time of the simulation, with a special name.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.MathVal","page":"Documentation","title":"SBML.MathVal","text":"A literal value (usually a numeric constant) in mathematical expression\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Model","page":"Documentation","title":"SBML.Model","text":"Structure that collects the model-related data. Contains parameters, units, compartments, species and reactions and gene_products, and additional notes and annotation (also present internally in some of the data fields). The contained dictionaries are indexed by identifiers of the corresponding objects.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Reaction","page":"Documentation","title":"SBML.Reaction","text":"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). Also may contains notes and annotation.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.Species","page":"Documentation","title":"SBML.Species","text":"Species metadata – contains a human-readable name, a compartment identifier, formula, charge, and additional notes and annotation.\n\n\n\n\n\n","category":"type"},{"location":"#SBML.UnitPart","page":"Documentation","title":"SBML.UnitPart","text":"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:\n\nSBML.UnitPart(\"second\", # base SI unit, this says we are measuring time\n -2, # exponent, says \"per square\"\n 6, # log-10 scale of the unit, says \"mega\"\n 1/3600) # second-to-hour multiplier\n\nCompound units (such as \"volt-amperes\" and \"dozens of yards per ounce\") are built from multiple UnitParts; see the definition of field units in SBML.Model.\n\n\n\n\n\n","category":"type"},{"location":"#Base-functions","page":"Documentation","title":"Base functions","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"version.jl\", \"readsbml.jl\"]","category":"page"},{"location":"#SBML.SBMLVersion-Tuple{}","page":"Documentation","title":"SBML.SBMLVersion","text":"function SBMLVersion()\n\nGet the version of the used SBML library in Julia version format.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.extractModel-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.extractModel","text":"\" function extractModel(mdl::VPtr)::SBML.Model\n\nTake the SBMLModel_t pointer and extract all information required to make a valid SBML.Model structure.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getAssociation-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.getAssociation","text":"function getAssociation(x::VPtr)::GeneProductAssociation\n\nConvert a pointer to SBML FbcAssociation_t to the GeneProductAssociation tree structure.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_bool-Tuple{Ptr{Nothing},Any,Any}","page":"Documentation","title":"SBML.get_optional_bool","text":"get_optional_bool(x::VPtr, is_sym, get_sym)::Maybe{Bool}\n\nHelper for getting out boolean flags.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_double-Tuple{Ptr{Nothing},Any,Any}","page":"Documentation","title":"SBML.get_optional_double","text":"get_optional_double(x::VPtr, is_sym, get_sym)::Maybe{Float64}\n\nHelper for getting out C doubles aka Float64s.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_int-Tuple{Ptr{Nothing},Any,Any}","page":"Documentation","title":"SBML.get_optional_int","text":"get_optional_int(x::VPtr, is_sym, get_sym)::Maybe{UInt}\n\nHelper for getting out unsigned integers.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_optional_string-Tuple{Ptr{Nothing},Any}","page":"Documentation","title":"SBML.get_optional_string","text":"get_optional_string(x::VPtr, fn_sym)::Maybe{String}\n\nLike get_string, but returns nothing instead of throwing an exception.\n\nThis is used to get notes and annotations and several other things (see get_notes, get_annotations)\n\n\n\n\n\n","category":"method"},{"location":"#SBML.get_string-Tuple{Ptr{Nothing},Any}","page":"Documentation","title":"SBML.get_string","text":"get_string(x::VPtr, fn_sym)::Maybe{String}\n\nC-call the SBML function fn_sym with a single parameter x, interpret the result as a string and return it, or throw exception in case the pointer is NULL.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.readSBML","page":"Documentation","title":"SBML.readSBML","text":"function readSBML(fn::String, sbml_conversion = model->nothing)::SBML.Model\n\nRead the SBML from a XML file in fn and return the contained SBML.Model.\n\nThe sbml_conversion is a function that does an in-place modification of the single parameter, which is the C pointer to the loaded SBML document (C type SBMLDocument*). Several functions for doing that are prepared, including set_level_and_version, libsbml_convert, and convert_simplify_math.\n\nExample\n\nm = readSBML(\"my_model.xml\", doc -> begin\n set_level_and_version(3, 1)(doc)\n convert_simplify_math(doc)\nend)\n\n\n\n\n\n","category":"function"},{"location":"#libsbml-representation-converters","page":"Documentation","title":"libsbml representation converters","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"The converters are intended to be used as parameters of readSBML.","category":"page"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"converters.jl\"]","category":"page"},{"location":"#SBML.convert_simplify_math","page":"Documentation","title":"SBML.convert_simplify_math","text":"convert_simplify_math\n\nShortcut for libsbml_convert that expands functions, local parameters, and initial assignments in the SBML document.\n\n\n\n\n\n","category":"function"},{"location":"#SBML.libsbml_convert-Tuple{AbstractArray{var\"#s50\",1} where var\"#s50\"<:(Pair{String,var\"#s49\"} where var\"#s49\"<:AbstractDict{String,String})}","page":"Documentation","title":"SBML.libsbml_convert","text":"libsbml_convert(conversion_options::Vector{Pair{String, Dict{String, String}}})\n\nA converter that runs the SBML conversion routine, with specified conversion options. The argument is a vector of pairs to allow specifying the order of conversions.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.libsbml_convert-Tuple{String}","page":"Documentation","title":"SBML.libsbml_convert","text":"libsbml_convert(converter::String; kwargs...)\n\nQuickly construct a single run of a libsbml converter from keyword arguments.\n\nExample\n\nreadSBML(\"example.xml\", libsbml_convert(\"stripPackage\", package=\"layout\"))\n\n\n\n\n\n","category":"method"},{"location":"#SBML.set_level_and_version-Tuple{Any,Any}","page":"Documentation","title":"SBML.set_level_and_version","text":"set_level_and_version(level, version)\n\nA converter to pass into readSBML that enforces certain SBML level and version.\n\n\n\n\n\n","category":"method"},{"location":"#Data-helpers","page":"Documentation","title":"Data helpers","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"utils.jl\"]","category":"page"},{"location":"#SBML.extensive_kinetic_math-Tuple{SBML.Model,SBML.Math}","page":"Documentation","title":"SBML.extensive_kinetic_math","text":"extensive_kinetic_math(m::SBML.Model, formula::SBML.Math)\n\nConvert a SBML math formula to \"extensive\" kinetic laws, where the references to species that are marked as not having only substance units are converted from amounts to concentrations.\n\nHandling of units in the conversion process is ignored in this version.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getLBs-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getLBs","text":"getLBs(m::SBML.Model)::Vector{Tuple{Float64,String}}\n\nExtract 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).\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getOCs-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getOCs","text":"getOCs(m::SBML.Model)::Vector{Float64}\n\nExtract the vector of objective coefficients of each reaction.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getS-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getS","text":"function getS(m::SBML.Model; zeros=spzeros)::Tuple{Vector{String},Vector{String},AbstractMatrix{Float64}}\n\nExtract the vector of species (aka metabolite) identifiers, vector of reaction identifiers, and the (dense) stoichiometry matrix from an existing SBML.Model. Returns a tuple with these values.\n\nThe matrix is sparse by default (initially constructed by SparseArrays.spzeros). You can fill in a custom empty matrix constructed to argument zeros; e.g. running with zeros=zeros will produce a dense matrix.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.getUBs-Tuple{SBML.Model}","page":"Documentation","title":"SBML.getUBs","text":"getUBs(m::SBML.Model)::Vector{Tuple{Float64,String}}\n\nLikewise to getLBs, extract the upper bounds.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.initial_amounts-Tuple{SBML.Model}","page":"Documentation","title":"SBML.initial_amounts","text":"initial_amounts(m::SBML.Model; convert_concentrations = false)\n\nReturn initial amounts for each species as a generator of pairs species_name => initial_amount; the amount is set to nothing if not available. If convert_concentrations is true and there is information about initial concentration available together with compartment size, the result is computed from the species' initial concentration.\n\nIn the current version, units of the measurements are completely ignored.\n\nExample\n\n# get the initial amounts as dictionary\nDict(initial_amounts(model, convert_concentrations = true))\n\n# remove the empty entries\nDict(k => v for (k,v) in initial_amounts(model) if !isnothing(v))\n\n\n\n\n\n","category":"method"},{"location":"#SBML.initial_concentrations-Tuple{SBML.Model}","page":"Documentation","title":"SBML.initial_concentrations","text":"initial_concentrations(m::SBML.Model; convert_amounts = false)\n\nReturn initial concentrations of the species in the model. Refer to work-alike initial_amounts for details.\n\n\n\n\n\n","category":"method"},{"location":"#Math-and-Symbolics.jl-compatibility","page":"Documentation","title":"Math and Symbolics.jl compatibility","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"symbolics.jl\"]","category":"page"},{"location":"#SBML.default_symbolics_constants","page":"Documentation","title":"SBML.default_symbolics_constants","text":"const default_symbolics_constants::Dict{String, Any}\n\nA dictionary of default constants filled in place of SBML Math constants in the symbolics conversion.\n\n\n\n\n\n","category":"constant"},{"location":"#SBML.default_symbolics_mapping","page":"Documentation","title":"SBML.default_symbolics_mapping","text":"default_symbolics_mapping :: Dict{String,Any}\n\nDefault mapping of SBML function names to Julia functions, represented as a dictionary from Strings (SBML names) to anything evaluable as Julia&Symbolics functions, such as symbols and expressions.\n\nThe default mapping only contains the basic SBML functions that are unambiguously represented in Julia; it is supposed to be extended by the user if more functions need to be supported.\n\n\n\n\n\n","category":"constant"},{"location":"#Base.convert-Tuple{Type{Symbolics.Num},SBML.Math}","page":"Documentation","title":"Base.convert","text":"Base.convert(\n ::Type{Num},\n x::SBML.Math;\n mapping = default_symbolics_mapping,\n convert_time = (x::SBML.MathTime) -> Num(Variable(Symbol(x.id))).val,\n convert_const = (x::SBML.MathConst) -> Num(default_symbolics_constants[x.id]),\n)\n\nConvert SBML.Math to Num type from Symbolics package. The conversion of functions can be customized by supplying a custom mapping; if nothing is supplied, default_symbolics_mapping that translates basic functions to their Julia equivalents is assumed.\n\nTranslation of MathLambda is not supported by Symbolics.\n\nMathTime is handled specially, the function from the argument convert_time is called to possibly specify any desired behavior. By default, it just creates a variable with the same name as the time variable name stored in SBML.\n\n\n\n\n\n","category":"method"},{"location":"#Internal-math-helpers","page":"Documentation","title":"Internal math helpers","text":"","category":"section"},{"location":"","page":"Documentation","title":"Documentation","text":"Modules = [SBML]\nPages = [\"math.jl\"]","category":"page"},{"location":"#SBML.ast_is-Tuple{Ptr{Nothing},Symbol}","page":"Documentation","title":"SBML.ast_is","text":"ast_is(ast::VPtr, what::Symbol)::Bool\n\nHelper for quickly recognizing kinds of ASTs\n\n\n\n\n\n","category":"method"},{"location":"#SBML.parse_math-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.parse_math","text":"parse_math(ast::VPtr)::Math\n\nThis attempts to parse out a decent Julia-esque (Math AST from a pointer to ASTNode_t.\n\n\n\n\n\n","category":"method"},{"location":"#SBML.parse_math_children-Tuple{Ptr{Nothing}}","page":"Documentation","title":"SBML.parse_math_children","text":"parse_math_children(ast::VPtr)::Vector{Math}\n\nRecursively parse all children of an AST node.\n\n\n\n\n\n","category":"method"}]