SBML distrib

The following examples demonstrate the creation of SBML models with SBML distrib information.

[1]:
%load_ext autoreload
%autoreload 2
[2]:
from notebook_utils import print_xml
from sbmlutils.factory import *
from sbmlutils.validation import validate_doc

Assigning a distribution to a parameter

Here we create a parameter

\[p_1 = 0.0\]

and assign the initial value from a normal distribution with mean=0 and standard deviation=1

\[p_1 = \sigma(0,1)\]
[3]:
class U(Units):
    """UnitDefinitions."""
    hr = UnitDefinition("hr")
    m2 = UnitDefinition("m2", "meter^2")
    mM = UnitDefinition("mM", "mmole/liter")

# model definition
model = Model(
    'distrib_assignment',
    packages= [Package.DISTRIB_V1],
    units=U,
    model_units= ModelUnits(
        time=U.hr, extent=U.mole, substance=U.mole,
        length=U.meter, area=U.m2, volume=U.liter),
    parameters= [
        Parameter(sid="p1", value=0.0, unit=U.mM)
    ],
    assignments= [
        InitialAssignment('p1', 'normal(0 mM, 1 mM)'),
    ]
)

# create model and print SBML
doc = Document(model)
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'distrib_assignment'                                                 factory.py:3526
WARNING  'name' should be set on 'Model(sid='distrib_assignment', packages=[<Package.DISTRIB_V1:     factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], model_units=<sbmlutils.factory.ModelUnits                   
         object at 0x7f8f297effa0>, units=<class '__main__.U'>, parameters=[p1 = 0.0                               
         [UnitDefinition(mM, mmole/liter)]], assignments=[<sbmlutils.factory.InitialAssignment                     
         object at 0x7f8eaa9c4970>], _FrozenClass__isfrozen=True)'                                                 
WARNING  'name' should be set on 'Parameter(p1)'                                                     factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p1)'                                                  factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="distrib_assignment" substanceUnits="mole" timeUnits="hr" volumeUnits="litre" areaUnits="m2" lengthUnits="metre" extentUnits="mole">
    <listOfUnitDefinitions>
      <unitDefinition id="hr" name="hr">
        <listOfUnits>
          <unit kind="second" exponent="1" scale="0" multiplier="3600"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="m2" name="meter^2">
        <listOfUnits>
          <unit kind="metre" exponent="2" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="mM" name="mmole/liter">
        <listOfUnits>
          <unit kind="mole" exponent="1" scale="0" multiplier="0.001"/>
          <unit kind="litre" exponent="-1" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
    </listOfUnitDefinitions>
    <listOfParameters>
      <parameter id="p1" value="0" units="mM" constant="true"/>
    </listOfParameters>
    <listOfInitialAssignments>
      <initialAssignment symbol="p1">
        <math xmlns="http://www.w3.org/1998/Math/MathML" xmlns:sbml="http://www.sbml.org/sbml/level3/version1/core">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal"> normal </csymbol>
            <cn sbml:units="mM" type="integer"> 0 </cn>
            <cn sbml:units="mM" type="integer"> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
    </listOfInitialAssignments>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.002
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Using a normal distribution

In this example, the initial value of y is set as a draw from the normal distribution normal(z,10):

[4]:
model = Model(
    'normal',
    packages=[Package.DISTRIB_V1],
    objects=[
        Parameter('y', value=1.0),
        Parameter('z', value=1.0),
        InitialAssignment('y', 'normal(z, 10)'),
    ]
)

# create model and print SBML
doc = Document(model)
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'normal'                                                             factory.py:3526
WARNING  'name' should be set on 'Model(sid='normal', packages=[<Package.DISTRIB_V1: 'distrib-v1'>,  factory.py:441
         <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>, parameters=[y = 1.0               
         [None], z = 1.0 [None]], assignments=[<sbmlutils.factory.InitialAssignment object at                      
         0x7f8f2b01f2b0>], _FrozenClass__isfrozen=True)'                                                           
WARNING  'name' should be set on 'Parameter(y)'                                                      factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(y)'                                                   factory.py:466
WARNING  'name' should be set on 'Parameter(z)'                                                      factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(z)'                                                   factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="normal">
    <listOfParameters>
      <parameter id="y" value="1" constant="true"/>
      <parameter id="z" value="1" constant="true"/>
    </listOfParameters>
    <listOfInitialAssignments>
      <initialAssignment symbol="y">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal"> normal </csymbol>
            <ci> z </ci>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
    </listOfInitialAssignments>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.001
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Defining a truncated normal distribution

When used with four arguments instead of two, the normal distribution is truncated to normal(z, 10, z-2, z+2). This use would apply a draw from a normal distribution with mean z, standard deviation 10, lower bound z-2 (inclusive) and upper bound z+2 (not inclusive) to the SBML symbol y.

[5]:
model = Model(
    'truncated_normal',
    packages = [Package.DISTRIB_V1],
    objects = [
        Parameter('y', value=1.0),
        Parameter('z', value=1.0),
        InitialAssignment('y', 'normal(z, 10, z-2, z+2)'),
    ]
)

# create model and print SBML
doc = Document(model)
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'truncated_normal'                                                   factory.py:3526
WARNING  'name' should be set on 'Model(sid='truncated_normal', packages=[<Package.DISTRIB_V1:       factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>,                    
         parameters=[y = 1.0 [None], z = 1.0 [None]],                                                              
         assignments=[<sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c4a30>],                             
         _FrozenClass__isfrozen=True)'                                                                             
WARNING  'name' should be set on 'Parameter(y)'                                                      factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(y)'                                                   factory.py:466
WARNING  'name' should be set on 'Parameter(z)'                                                      factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(z)'                                                   factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="truncated_normal">
    <listOfParameters>
      <parameter id="y" value="1" constant="true"/>
      <parameter id="z" value="1" constant="true"/>
    </listOfParameters>
    <listOfInitialAssignments>
      <initialAssignment symbol="y">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal"> normal </csymbol>
            <ci> z </ci>
            <cn type="integer"> 10 </cn>
            <apply>
              <minus/>
              <ci> z </ci>
              <cn type="integer"> 2 </cn>
            </apply>
            <apply>
              <plus/>
              <ci> z </ci>
              <cn type="integer"> 2 </cn>
            </apply>
          </apply>
        </math>
      </initialAssignment>
    </listOfInitialAssignments>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.002
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Defining conditional events

Simultaneous events in SBML are ordered based on their Priority values, with higher values being executed first, and potentially cancelling events that fire after them. In this example, two simultaneous events have priorities set with csymbols defined in distrib. The event E0 has a priority of uniform(0,1), while the event E1 has a priority of uniform(0,2). This means that 75% of the time, event E1 will have a higher priority than E0, and will fire first, assigning a value of 5 to parameter x. Because this negates the trigger condition for E0, which is set persistent="false", this means that E0 never fires, and the value of x remains at 5. The remaining 25% of the time, the reverse happens, with E0 setting the value of x to 3 instead.

[6]:
model = Model(
    'conditional_events',
    packages=[Package.DISTRIB_V1],
    objects=[
        Parameter('x', value=1.0, constant=False),
        Event(
            "E0",
            trigger="time>2 && x<1",
            priority="uniform(0, 1)",
            trigger_initialValue=True, trigger_persistent=False,
            assignments={"x": "3"}
        ),
        Event(
            "E1",
            trigger="time>2 && x<1",
            priority="uniform(0, 2)",
            trigger_initialValue=True, trigger_persistent=False,
            assignments={"x": "5"}
        )
    ]
)

# create model and print SBML
doc = Document(model)
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'conditional_events'                                                 factory.py:3526
WARNING  'name' should be set on 'Model(sid='conditional_events', packages=[<Package.DISTRIB_V1:     factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>,                    
         parameters=[x = 1.0 [None]], events=[<sbmlutils.factory.Event object at 0x7f8eaaa34fd0>,                  
         <sbmlutils.factory.Event object at 0x7f8eaaa346d0>], _FrozenClass__isfrozen=True)'                        
WARNING  'name' should be set on 'Parameter(x)'                                                      factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(x)'                                                   factory.py:466
WARNING  'name' should be set on 'Event(E0)'                                                         factory.py:441
WARNING  'sboTerm' should be set on 'Event(E0)'                                                      factory.py:466
WARNING  'name' should be set on 'Event(E1)'                                                         factory.py:441
WARNING  'sboTerm' should be set on 'Event(E1)'                                                      factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="conditional_events">
    <listOfParameters>
      <parameter id="x" value="1" constant="false"/>
    </listOfParameters>
    <listOfEvents>
      <event id="E0" useValuesFromTriggerTime="true">
        <trigger initialValue="true" persistent="false">
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <and/>
              <apply>
                <gt/>
                <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/time"> time </csymbol>
                <cn type="integer"> 2 </cn>
              </apply>
              <apply>
                <lt/>
                <ci> x </ci>
                <cn type="integer"> 1 </cn>
              </apply>
            </apply>
          </math>
        </trigger>
        <priority>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/uniform"> uniform </csymbol>
              <cn type="integer"> 0 </cn>
              <cn type="integer"> 1 </cn>
            </apply>
          </math>
        </priority>
        <listOfEventAssignments>
          <eventAssignment variable="x">
            <math xmlns="http://www.w3.org/1998/Math/MathML">
              <cn type="integer"> 3 </cn>
            </math>
          </eventAssignment>
        </listOfEventAssignments>
      </event>
      <event id="E1" useValuesFromTriggerTime="true">
        <trigger initialValue="true" persistent="false">
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <and/>
              <apply>
                <gt/>
                <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/time"> time </csymbol>
                <cn type="integer"> 2 </cn>
              </apply>
              <apply>
                <lt/>
                <ci> x </ci>
                <cn type="integer"> 1 </cn>
              </apply>
            </apply>
          </math>
        </trigger>
        <priority>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/uniform"> uniform </csymbol>
              <cn type="integer"> 0 </cn>
              <cn type="integer"> 2 </cn>
            </apply>
          </math>
        </priority>
        <listOfEventAssignments>
          <eventAssignment variable="x">
            <math xmlns="http://www.w3.org/1998/Math/MathML">
              <cn type="integer"> 5 </cn>
            </math>
          </eventAssignment>
        </listOfEventAssignments>
      </event>
    </listOfEvents>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.002
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Overview of all distributions

The following gives an example how to use all of the various distributions

[7]:
model = Model(
    'all_distributions',
    packages = [Package.DISTRIB_V1],
    objects = [
        InitialAssignment('p_normal_1', 'normal(0, 1)'),
        InitialAssignment('p_normal_2', 'normal(0, 1, 0, 10)'),
        InitialAssignment('p_uniform', 'uniform(5, 10)'),
        InitialAssignment('p_bernoulli', 'bernoulli(0.4)'),
        InitialAssignment('p_binomial_1', 'binomial(100, 0.3)'),
        InitialAssignment('p_binomial_2', 'binomial(100, 0.3, 0, 2)'),
        InitialAssignment('p_cauchy_1', 'cauchy(0, 1)'),
        InitialAssignment('p_cauchy_2', 'cauchy(0, 1, 0, 5)'),
        InitialAssignment('p_chisquare_1', 'chisquare(10)'),
        InitialAssignment('p_chisquare_2', 'chisquare(10, 0, 10)'),
        InitialAssignment('p_exponential_1', 'exponential(1.0)'),
        InitialAssignment('p_exponential_2', 'exponential(1.0, 0, 10)'),
        InitialAssignment('p_gamma_1', 'gamma(0, 1)'),
        InitialAssignment('p_gamma_2', 'gamma(0, 1, 0, 10)'),
        InitialAssignment('p_laplace_1', 'laplace(0, 1)'),
        InitialAssignment('p_laplace_2', 'laplace(0, 1, 0, 10)'),
        InitialAssignment('p_lognormal_1', 'lognormal(0, 1)'),
        InitialAssignment('p_lognormal_2', 'lognormal(0, 1, 0, 10)'),
        InitialAssignment('p_poisson_1', 'poisson(0.5)'),
        InitialAssignment('p_poisson_2', 'poisson(0.5, 0, 10)'),
        InitialAssignment('p_raleigh_1', 'rayleigh(0.5)'),
        InitialAssignment('p_raleigh_2', 'rayleigh(0.5, 0, 10)'),
    ]
)

# create model and print SBML
doc = Document(model)
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'all_distributions'                                                  factory.py:3526
WARNING  'name' should be set on 'Model(sid='all_distributions', packages=[<Package.DISTRIB_V1:      factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>,                    
         assignments=[<sbmlutils.factory.InitialAssignment object at 0x7f8eaa958d60>,                              
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958d90>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958dc0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958df0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958e20>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958e50>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958e80>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958eb0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa958ee0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c4760>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c45b0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c46d0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c4ac0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c4f10>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c48b0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c4a00>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c4a60>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c4c40>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8eaa9c47c0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8f2877e3a0>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8f28779b50>,                                           
         <sbmlutils.factory.InitialAssignment object at 0x7f8f287792b0>],                                          
         _FrozenClass__isfrozen=True)'                                                                             
WARNING  'name' should be set on 'Parameter(p_normal_1)'                                             factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_normal_1)'                                          factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_normal_2)'                                             factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_normal_2)'                                          factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_uniform)'                                              factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_uniform)'                                           factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_bernoulli)'                                            factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_bernoulli)'                                         factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_binomial_1)'                                           factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_binomial_1)'                                        factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_binomial_2)'                                           factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_binomial_2)'                                        factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_cauchy_1)'                                             factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_cauchy_1)'                                          factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_cauchy_2)'                                             factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_cauchy_2)'                                          factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_chisquare_1)'                                          factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_chisquare_1)'                                       factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_chisquare_2)'                                          factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_chisquare_2)'                                       factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_exponential_1)'                                        factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_exponential_1)'                                     factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_exponential_2)'                                        factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_exponential_2)'                                     factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_gamma_1)'                                              factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_gamma_1)'                                           factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_gamma_2)'                                              factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_gamma_2)'                                           factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_laplace_1)'                                            factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_laplace_1)'                                         factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_laplace_2)'                                            factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_laplace_2)'                                         factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_lognormal_1)'                                          factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_lognormal_1)'                                       factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_lognormal_2)'                                          factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_lognormal_2)'                                       factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_poisson_1)'                                            factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_poisson_1)'                                         factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_poisson_2)'                                            factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_poisson_2)'                                         factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_raleigh_1)'                                            factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_raleigh_1)'                                         factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
WARNING  'name' should be set on 'Parameter(p_raleigh_2)'                                            factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(p_raleigh_2)'                                         factory.py:466
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="all_distributions">
    <listOfParameters>
      <parameter id="p_normal_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_normal_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_uniform" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_bernoulli" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_binomial_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_binomial_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_cauchy_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_cauchy_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_chisquare_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_chisquare_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_exponential_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_exponential_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_gamma_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_gamma_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_laplace_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_laplace_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_lognormal_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_lognormal_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_poisson_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_poisson_2" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_raleigh_1" value="NaN" units="dimensionless" constant="true"/>
      <parameter id="p_raleigh_2" value="NaN" units="dimensionless" constant="true"/>
    </listOfParameters>
    <listOfInitialAssignments>
      <initialAssignment symbol="p_normal_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal"> normal </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_normal_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal"> normal </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_uniform">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/uniform"> uniform </csymbol>
            <cn type="integer"> 5 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_bernoulli">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/bernoulli"> bernoulli </csymbol>
            <cn> 0.4 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_binomial_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/binomial"> binomial </csymbol>
            <cn type="integer"> 100 </cn>
            <cn> 0.3 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_binomial_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/binomial"> binomial </csymbol>
            <cn type="integer"> 100 </cn>
            <cn> 0.3 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 2 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_cauchy_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/cauchy"> cauchy </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_cauchy_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/cauchy"> cauchy </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 5 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_chisquare_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/chisquare"> chisquare </csymbol>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_chisquare_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/chisquare"> chisquare </csymbol>
            <cn type="integer"> 10 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_exponential_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/exponential"> exponential </csymbol>
            <cn> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_exponential_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/exponential"> exponential </csymbol>
            <cn> 1 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_gamma_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/gamma"> gamma </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_gamma_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/gamma"> gamma </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_laplace_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/laplace"> laplace </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_laplace_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/laplace"> laplace </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_lognormal_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/lognormal"> lognormal </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_lognormal_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/lognormal"> lognormal </csymbol>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 1 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_poisson_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/poisson"> poisson </csymbol>
            <cn> 0.5 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_poisson_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/poisson"> poisson </csymbol>
            <cn> 0.5 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_raleigh_1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/rayleigh"> rayleigh </csymbol>
            <cn> 0.5 </cn>
          </apply>
        </math>
      </initialAssignment>
      <initialAssignment symbol="p_raleigh_2">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/rayleigh"> rayleigh </csymbol>
            <cn> 0.5 </cn>
            <cn type="integer"> 0 </cn>
            <cn type="integer"> 10 </cn>
          </apply>
        </math>
      </initialAssignment>
    </listOfInitialAssignments>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.004
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Basic uncertainty example

Here, the species with an initial amount of 3.22 is described as having a standard deviation of 0.3, a value that might be written as 3.22 +- 0.3.

[8]:
import libsbml
md: ModelDict = {
    'sid': 'basic_example_1',
    'packages': [Package.DISTRIB_V1],
    'compartments': [
        Compartment("C", value=1.0)
    ],
    'species': [
        Species(sid="s1", compartment="C", initialAmount=3.22,
                uncertainties=[
                  Uncertainty(uncertParameters=[
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_STANDARDDEVIATION, value=0.3)
                  ])
                ])
    ],
}

# create model and print SBML
doc = Document(Model(**md))
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'basic_example_1'                                                    factory.py:3526
WARNING  'name' should be set on 'Model(sid='basic_example_1', packages=[<Package.DISTRIB_V1:        factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>,                    
         compartments=[C = 1.0 [None]], species=[<sbmlutils.factory.Species object at                              
         0x7f8eaa93f9a0>], _FrozenClass__isfrozen=True)'                                                           
WARNING  'name' should be set on 'Compartment(C)'                                                    factory.py:441
WARNING  'sboTerm' should be set on 'Compartment(C)'                                                 factory.py:466
WARNING  'name' should be set on 'Species(s1, [<sbmlutils.factory.Uncertainty object at              factory.py:441
         0x7f8eaa93ffd0>])'                                                                                        
WARNING  'sboTerm' should be set on 'Species(s1, [<sbmlutils.factory.Uncertainty object at           factory.py:466
         0x7f8eaa93ffd0>])'                                                                                        
WARNING  'name' should be set on 'Uncertainty()'                                                     factory.py:441
WARNING  'sboTerm' should be set on 'Uncertainty()'                                                  factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="basic_example_1">
    <listOfCompartments>
      <compartment id="C" spatialDimensions="3" size="1" constant="true"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="s1" compartment="C" initialAmount="3.22" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
        <distrib:listOfUncertainties>
          <distrib:uncertainty>
            <distrib:uncertParameter distrib:value="0.3" distrib:type="standardDeviation"/>
          </distrib:uncertainty>
        </distrib:listOfUncertainties>
      </species>
    </listOfSpecies>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.001
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

It is also possible to include additional information about the species, should more be known. In this example, the initial amount of 3.22 is noted as having a mean of 3.2, a standard deviation of 0.3, and a variance of 0.09.

[9]:
import libsbml
md: ModelDict = {
    'sid': 'basic_example_2',
    'packages': [Package.DISTRIB_V1],
    'compartments': [
        Compartment("C", value=1.0)
    ],
    'species': [
        Species(sid="s1", compartment="C", initialAmount=3.22,
                uncertainties=[
                  Uncertainty(uncertParameters=[
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_MEAN, value=3.2),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_STANDARDDEVIATION, value=0.3),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_VARIANCE, value=0.09),
                  ])
                ])
    ],
}

# create model and print SBML
doc = Document(Model(**md))
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'basic_example_2'                                                    factory.py:3526
WARNING  'name' should be set on 'Model(sid='basic_example_2', packages=[<Package.DISTRIB_V1:        factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>,                    
         compartments=[C = 1.0 [None]], species=[<sbmlutils.factory.Species object at                              
         0x7f8eaa8b1370>], _FrozenClass__isfrozen=True)'                                                           
WARNING  'name' should be set on 'Compartment(C)'                                                    factory.py:441
WARNING  'sboTerm' should be set on 'Compartment(C)'                                                 factory.py:466
WARNING  'name' should be set on 'Species(s1, [<sbmlutils.factory.Uncertainty object at              factory.py:441
         0x7f8eaa9c5850>])'                                                                                        
WARNING  'sboTerm' should be set on 'Species(s1, [<sbmlutils.factory.Uncertainty object at           factory.py:466
         0x7f8eaa9c5850>])'                                                                                        
WARNING  'name' should be set on 'Uncertainty()'                                                     factory.py:441
WARNING  'sboTerm' should be set on 'Uncertainty()'                                                  factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="basic_example_2">
    <listOfCompartments>
      <compartment id="C" spatialDimensions="3" size="1" constant="true"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="s1" compartment="C" initialAmount="3.22" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
        <distrib:listOfUncertainties>
          <distrib:uncertainty>
            <distrib:uncertParameter distrib:value="3.2" distrib:type="mean"/>
            <distrib:uncertParameter distrib:value="0.3" distrib:type="standardDeviation"/>
            <distrib:uncertParameter distrib:value="0.09" distrib:type="variance"/>
          </distrib:uncertainty>
        </distrib:listOfUncertainties>
      </species>
    </listOfSpecies>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.002
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Multiple uncertainties

The following gives an example how to encode multiple uncertainties for a parameter. Here the two uncertainties 5.0 (mean) +- 0.3 (std) [2.0 - 8.0] and 4.5 (mean) +- 1.1 (std) [1.0 - 10.0] are set.

[10]:
import libsbml

class U(Units):
    hr = UnitDefinition("hr")
    m2 = UnitDefinition("m2", "meter^2")
    mM = UnitDefinition("mM", "mmole/liter")

md: ModelDict = {
    'sid': 'multiple_uncertainties',
    'packages': [Package.DISTRIB_V1],
    'units': U,
    'model_units': ModelUnits(time=U.hr, extent=U.mole, substance=U.mole,
                              length=U.meter, area=U.m2, volume=U.liter),

    'parameters': [
        Parameter(sid="p1", value=5.0, unit=U.mM,
                  uncertainties=[
                      Uncertainty('p1_uncertainty_1', uncertParameters=[
                          UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_MEAN, value=5.0, unit=U.mM),
                          UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_STANDARDDEVIATION, value=0.3, unit=U.mM),
                          UncertSpan(type=libsbml.DISTRIB_UNCERTTYPE_RANGE, valueLower=2.0, valueUpper=8.0, unit=U.mM),
                      ]),
                      Uncertainty('p1_uncertainty_2', uncertParameters=[
                          UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_MEAN, value=4.5, unit=U.mM),
                          UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_STANDARDDEVIATION, value=1.1, unit=U.mM),
                          UncertSpan(type=libsbml.DISTRIB_UNCERTTYPE_RANGE, valueLower=1.0, valueUpper=10.0, unit=U.mM),
                      ])
                  ])
    ],
    'assignments': [
        InitialAssignment('p1', 'normal(0 mM, 1 mM)'),
    ]
}

# create model and print SBML
doc = Document(Model(**md))
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'multiple_uncertainties'                                             factory.py:3526
WARNING  'name' should be set on 'Model(sid='multiple_uncertainties', packages=[<Package.DISTRIB_V1: factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], model_units=<sbmlutils.factory.ModelUnits                   
         object at 0x7f8eaa8ceb50>, units=<class '__main__.U'>, parameters=[p1 = 5.0                               
         [UnitDefinition(mM, mmole/liter)]], assignments=[<sbmlutils.factory.InitialAssignment                     
         object at 0x7f8eaa8ce760>], _FrozenClass__isfrozen=True)'                                                 
WARNING  'name' should be set on 'Parameter(p1, [<sbmlutils.factory.Uncertainty object at            factory.py:441
         0x7f8eaa8ce160>, <sbmlutils.factory.Uncertainty object at 0x7f8eaa8ce310>])'                              
WARNING  'sboTerm' should be set on 'Parameter(p1, [<sbmlutils.factory.Uncertainty object at         factory.py:466
         0x7f8eaa8ce160>, <sbmlutils.factory.Uncertainty object at 0x7f8eaa8ce310>])'                              
WARNING  'name' should be set on 'Uncertainty(p1_uncertainty_1)'                                     factory.py:441
WARNING  'sboTerm' should be set on 'Uncertainty(p1_uncertainty_1)'                                  factory.py:466
ERROR    Unsupported type for UncertParameter: '15' in '<sbmlutils.factory.UncertSpan object at     factory.py:2121
         0x7f8eaa8ce1f0>'.                                                                                         
WARNING  'name' should be set on 'Uncertainty(p1_uncertainty_2)'                                     factory.py:441
WARNING  'sboTerm' should be set on 'Uncertainty(p1_uncertainty_2)'                                  factory.py:466
ERROR    Unsupported type for UncertParameter: '15' in '<sbmlutils.factory.UncertSpan object at     factory.py:2121
         0x7f8eaa8ce2b0>'.                                                                                         
WARNING  'name' should be set on 'InitialAssignment()'                                               factory.py:441
WARNING  'sboTerm' should be set on 'InitialAssignment()'                                            factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="multiple_uncertainties" substanceUnits="mole" timeUnits="hr" volumeUnits="litre" areaUnits="m2" lengthUnits="metre" extentUnits="mole">
    <listOfUnitDefinitions>
      <unitDefinition id="hr" name="hr">
        <listOfUnits>
          <unit kind="second" exponent="1" scale="0" multiplier="3600"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="m2" name="meter^2">
        <listOfUnits>
          <unit kind="metre" exponent="2" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="mM" name="mmole/liter">
        <listOfUnits>
          <unit kind="mole" exponent="1" scale="0" multiplier="0.001"/>
          <unit kind="litre" exponent="-1" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
    </listOfUnitDefinitions>
    <listOfParameters>
      <parameter id="p1" value="5" units="mM" constant="true">
        <distrib:listOfUncertainties>
          <distrib:uncertainty distrib:id="p1_uncertainty_1">
            <distrib:uncertParameter distrib:value="5" distrib:units="mM" distrib:type="mean"/>
            <distrib:uncertParameter distrib:value="0.3" distrib:units="mM" distrib:type="standardDeviation"/>
          </distrib:uncertainty>
          <distrib:uncertainty distrib:id="p1_uncertainty_2">
            <distrib:uncertParameter distrib:value="4.5" distrib:units="mM" distrib:type="mean"/>
            <distrib:uncertParameter distrib:value="1.1" distrib:units="mM" distrib:type="standardDeviation"/>
          </distrib:uncertainty>
        </distrib:listOfUncertainties>
      </parameter>
    </listOfParameters>
    <listOfInitialAssignments>
      <initialAssignment symbol="p1">
        <math xmlns="http://www.w3.org/1998/Math/MathML" xmlns:sbml="http://www.sbml.org/sbml/level3/version1/core">
          <apply>
            <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal"> normal </csymbol>
            <cn sbml:units="mM" type="integer"> 0 </cn>
            <cn sbml:units="mM" type="integer"> 1 </cn>
          </apply>
        </math>
      </initialAssignment>
    </listOfInitialAssignments>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.002
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Defining a random variable

In addition to describing the uncertainty about an experimental observation one can also use this mechanism to describe a parameter as a random variable.

[11]:
import libsbml
md: ModelDict = {
    'sid': 'random_variable',
    'packages': [Package.DISTRIB_V1],
    'parameters': [
        Parameter("shape_Z", value=10.0),
        Parameter("scale_Z", value=0.1),
        Parameter("Z", value=0.1,
                  uncertainties=[
                      Uncertainty(formula="gamma(shape_Z, scale_Z)",
                                  uncertParameters=[
                                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_MEAN, value=1.03),
                                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_VARIANCE, value=0.97),
                                  ])
                  ])
    ]
}

# create model and print SBML
doc = Document(Model(**md))
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'random_variable'                                                    factory.py:3526
WARNING  'name' should be set on 'Model(sid='random_variable', packages=[<Package.DISTRIB_V1:        factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>,                    
         parameters=[shape_Z = 10.0 [None], scale_Z = 0.1 [None], Z = 0.1 [None]],                                 
         _FrozenClass__isfrozen=True)'                                                                             
WARNING  'name' should be set on 'Parameter(shape_Z)'                                                factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(shape_Z)'                                             factory.py:466
WARNING  'name' should be set on 'Parameter(scale_Z)'                                                factory.py:441
WARNING  'sboTerm' should be set on 'Parameter(scale_Z)'                                             factory.py:466
WARNING  'name' should be set on 'Parameter(Z, [<sbmlutils.factory.Uncertainty object at             factory.py:441
         0x7f8eaa8d43d0>])'                                                                                        
WARNING  'sboTerm' should be set on 'Parameter(Z, [<sbmlutils.factory.Uncertainty object at          factory.py:466
         0x7f8eaa8d43d0>])'                                                                                        
WARNING  'name' should be set on 'Uncertainty()'                                                     factory.py:441
WARNING  'sboTerm' should be set on 'Uncertainty()'                                                  factory.py:466
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="random_variable">
    <listOfParameters>
      <parameter id="shape_Z" value="10" constant="true"/>
      <parameter id="scale_Z" value="0.1" constant="true"/>
      <parameter id="Z" value="0.1" constant="true">
        <distrib:listOfUncertainties>
          <distrib:uncertainty>
            <distrib:uncertParameter distrib:value="1.03" distrib:type="mean"/>
            <distrib:uncertParameter distrib:value="0.97" distrib:type="variance"/>
            <distrib:uncertParameter distrib:type="distribution" distrib:definitionURL="http://www.sbml.org/sbml/symbols/distrib/gamma">
              <math xmlns="http://www.w3.org/1998/Math/MathML">
                <apply>
                  <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/gamma"> gamma </csymbol>
                  <ci> shape_Z </ci>
                  <ci> scale_Z </ci>
                </apply>
              </math>
            </distrib:uncertParameter>
          </distrib:uncertainty>
        </distrib:listOfUncertainties>
      </parameter>
    </listOfParameters>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.002
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Overview over UncertParameters and UncertSpans

The following example provides an overview over the available fields.

[12]:
import libsbml
md: ModelDict = {
    'sid': 'parameters_spans',
    'packages': [Package.DISTRIB_V1],
    'parameters': [
        Parameter("p",
          uncertainties=[
              Uncertainty(
                  formula="normal(0, 1)",  # distribution
                  uncertParameters=[
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_COEFFIENTOFVARIATION, value=1.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_KURTOSIS, value=2.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_MEAN, value=3.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_MEDIAN, value=4.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_MODE, value=5.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_SAMPLESIZE, value=6.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_SKEWNESS, value=7.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_STANDARDDEVIATION, value=8.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_STANDARDERROR, value=9.0),
                      UncertParameter(type=libsbml.DISTRIB_UNCERTTYPE_VARIANCE, value=10.0),
                      UncertSpan(type=libsbml.DISTRIB_UNCERTTYPE_CONFIDENCEINTERVAL, valueLower=1.0, valueUpper=2.0),
                      UncertSpan(type=libsbml.DISTRIB_UNCERTTYPE_CREDIBLEINTERVAL, valueLower=2.0, valueUpper=3.0),
                      UncertSpan(type=libsbml.DISTRIB_UNCERTTYPE_INTERQUARTILERANGE, valueLower=3.0, valueUpper=4.0),
                      UncertSpan(type=libsbml.DISTRIB_UNCERTTYPE_RANGE, valueLower=4.0, valueUpper=5.0),
                  ])
          ])
    ]
}

# create model and print SBML
doc = Document(Model(**md))
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'parameters_spans'                                                   factory.py:3526
WARNING  'name' should be set on 'Model(sid='parameters_spans', packages=[<Package.DISTRIB_V1:       factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], units=<class 'sbmlutils.factory.Units'>,                    
         parameters=[p = None [None]], _FrozenClass__isfrozen=True)'                                               
WARNING  'name' should be set on 'Parameter(p, [<sbmlutils.factory.Uncertainty object at             factory.py:441
         0x7f8eaa8ce730>])'                                                                                        
WARNING  'sboTerm' should be set on 'Parameter(p, [<sbmlutils.factory.Uncertainty object at          factory.py:466
         0x7f8eaa8ce730>])'                                                                                        
WARNING  'name' should be set on 'Uncertainty()'                                                     factory.py:441
WARNING  'sboTerm' should be set on 'Uncertainty()'                                                  factory.py:466
ERROR    Unsupported type for UncertParameter: '12' in '<sbmlutils.factory.UncertSpan object at     factory.py:2121
         0x7f8eaa8ce4c0>'.                                                                                         
ERROR    Unsupported type for UncertParameter: '13' in '<sbmlutils.factory.UncertSpan object at     factory.py:2121
         0x7f8eaa8ce5b0>'.                                                                                         
ERROR    Unsupported type for UncertParameter: '14' in '<sbmlutils.factory.UncertSpan object at     factory.py:2121
         0x7f8eaa8cedf0>'.                                                                                         
ERROR    Unsupported type for UncertParameter: '15' in '<sbmlutils.factory.UncertSpan object at     factory.py:2121
         0x7f8eaa8cecd0>'.                                                                                         
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="parameters_spans">
    <listOfParameters>
      <parameter id="p" value="NaN" constant="true">
        <distrib:listOfUncertainties>
          <distrib:uncertainty>
            <distrib:uncertParameter distrib:value="1" distrib:type="coeffientOfVariation"/>
            <distrib:uncertParameter distrib:value="2" distrib:type="kurtosis"/>
            <distrib:uncertParameter distrib:value="3" distrib:type="mean"/>
            <distrib:uncertParameter distrib:value="4" distrib:type="median"/>
            <distrib:uncertParameter distrib:value="5" distrib:type="mode"/>
            <distrib:uncertParameter distrib:value="6" distrib:type="sampleSize"/>
            <distrib:uncertParameter distrib:value="7" distrib:type="skewness"/>
            <distrib:uncertParameter distrib:value="8" distrib:type="standardDeviation"/>
            <distrib:uncertParameter distrib:value="9" distrib:type="standardError"/>
            <distrib:uncertParameter distrib:value="10" distrib:type="variance"/>
            <distrib:uncertParameter distrib:type="distribution" distrib:definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal">
              <math xmlns="http://www.w3.org/1998/Math/MathML">
                <apply>
                  <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/distrib/normal"> normal </csymbol>
                  <cn type="integer"> 0 </cn>
                  <cn type="integer"> 1 </cn>
                </apply>
              </math>
            </distrib:uncertParameter>
          </distrib:uncertainty>
        </distrib:listOfUncertainties>
      </parameter>
    </listOfParameters>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.002
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Information on experimental parameters (SABIO-RK)

In the following example we store the experimental information which was used for setting the parameter in the model.

[13]:
import libsbml
from sbmlutils.metadata import *

class U(Units):
    hr = UnitDefinition("hr")
    m2 = UnitDefinition("m2", "meter^2")
    mM = UnitDefinition("mM", "mmole/liter")


md: ModelDict = {
    'sid': 'sabiork_parameter',
    'packages': [Package.DISTRIB_V1],
    'units': U,
    'model_units': ModelUnits(time=U.hr, extent=U.mole,
                              substance=U.mole,
                              length=U.meter, area=U.m2,
                              volume=U.liter),
    'parameters': [
        Parameter(
            sid="Km_glc", name="Michelis-Menten constant glucose",
            value=5.0, unit=U.mM, sboTerm=SBO.MICHAELIS_CONSTANT,
            uncertainties=[
                Uncertainty(
                  sid="uncertainty1",
                  uncertParameters=[
                      UncertParameter(
                          type=libsbml.DISTRIB_UNCERTTYPE_MEAN,
                          value=5.07),
                      UncertParameter(
                          type=libsbml.DISTRIB_UNCERTTYPE_STANDARDDEVIATION,
                          value=0.97),
                  ], annotations=[
                        (BQB.IS, "sabiork.kineticrecord/793"),  # entry in SABIO-RK
                        (BQB.HAS_TAXON, "taxonomy/9606"),  # homo sapiens
                        (BQB.IS, "ec-code/2.7.1.2"),  # glucokinase
                        (BQB.IS, "uniprot/P35557"),  # Glucokinase homo sapiens
                        (BQB.IS, "bto/BTO:0000075"),  # liver
                    ]),
                Uncertainty(
                    sid="uncertainty2",
                    uncertParameters=[
                        UncertParameter(
                            type=libsbml.DISTRIB_UNCERTTYPE_MEAN,
                            value=2.7),
                        UncertParameter(
                            type=libsbml.DISTRIB_UNCERTTYPE_STANDARDDEVIATION,
                            value=0.11),
                    ], annotations=[
                        (BQB.IS, "sabiork.kineticrecord/2581"),
                        # entry in SABIO-RK
                        (BQB.HAS_TAXON, "taxonomy/9606"),  # homo sapiens
                        (BQB.IS, "ec-code/2.7.1.2"),  # glucokinase
                        (BQB.IS, "uniprot/P35557"),  # Glucokinase homo sapiens
                        (BQB.IS, "bto/BTO:0000075"),  # liver
                    ]),
            ])
    ]
}

# create model and print SBML
doc = Document(Model(**md))
print_xml(doc.get_sbml())

# validate model
validate_doc(doc.doc, options=ValidationOptions(units_consistency=False));
INFO     Create SBML for model 'sabiork_parameter'                                                  factory.py:3526
WARNING  'name' should be set on 'Model(sid='sabiork_parameter', packages=[<Package.DISTRIB_V1:      factory.py:441
         'distrib-v1'>, <Package.COMP_V1: 'comp-v1'>], model_units=<sbmlutils.factory.ModelUnits                   
         object at 0x7f8eaa93faf0>, units=<class '__main__.U'>, parameters=[Km_glc = 5.0                           
         [UnitDefinition(mM, mmole/liter)]], _FrozenClass__isfrozen=True)'                                         
WARNING  'name' should be set on 'Uncertainty(uncertainty1, [(<BQB.IS: 'BQB_IS'>,                    factory.py:441
         'sabiork.kineticrecord/793'), (<BQB.HAS_TAXON: 'BQB_HAS_TAXON'>, 'taxonomy/9606'),                        
         (<BQB.IS: 'BQB_IS'>, 'ec-code/2.7.1.2'), (<BQB.IS: 'BQB_IS'>, 'uniprot/P35557'), (<BQB.IS:                
         'BQB_IS'>, 'bto/BTO:0000075')])'                                                                          
WARNING  'sboTerm' should be set on 'Uncertainty(uncertainty1, [(<BQB.IS: 'BQB_IS'>,                 factory.py:466
         'sabiork.kineticrecord/793'), (<BQB.HAS_TAXON: 'BQB_HAS_TAXON'>, 'taxonomy/9606'),                        
         (<BQB.IS: 'BQB_IS'>, 'ec-code/2.7.1.2'), (<BQB.IS: 'BQB_IS'>, 'uniprot/P35557'), (<BQB.IS:                
         'BQB_IS'>, 'bto/BTO:0000075')])'                                                                          
WARNING  'name' should be set on 'Uncertainty(uncertainty2, [(<BQB.IS: 'BQB_IS'>,                    factory.py:441
         'sabiork.kineticrecord/2581'), (<BQB.HAS_TAXON: 'BQB_HAS_TAXON'>, 'taxonomy/9606'),                       
         (<BQB.IS: 'BQB_IS'>, 'ec-code/2.7.1.2'), (<BQB.IS: 'BQB_IS'>, 'uniprot/P35557'), (<BQB.IS:                
         'BQB_IS'>, 'bto/BTO:0000075')])'                                                                          
WARNING  'sboTerm' should be set on 'Uncertainty(uncertainty2, [(<BQB.IS: 'BQB_IS'>,                 factory.py:466
         'sabiork.kineticrecord/2581'), (<BQB.HAS_TAXON: 'BQB_HAS_TAXON'>, 'taxonomy/9606'),                       
         (<BQB.IS: 'BQB_IS'>, 'ec-code/2.7.1.2'), (<BQB.IS: 'BQB_IS'>, 'uniprot/P35557'), (<BQB.IS:                
         'BQB_IS'>, 'bto/BTO:0000075')])'                                                                          
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:distrib="http://www.sbml.org/sbml/level3/version1/distrib/version1" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" distrib:required="true" comp:required="true">
  <notes>
    <body xmlns="http://www.w3.org/1999/xhtml">
      <p>Created with <a href="https://github.com/matthiaskoenig/sbmlutils">https://github.com/matthiaskoenig/sbmlutils</a>.
<a href="https://doi.org/10.5281/zenodo.5525390">
        <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.5525390.svg" alt="DOI"/></a></p>
      </body>
    </notes>
  <model id="sabiork_parameter" substanceUnits="mole" timeUnits="hr" volumeUnits="litre" areaUnits="m2" lengthUnits="metre" extentUnits="mole">
    <listOfUnitDefinitions>
      <unitDefinition id="hr" name="hr">
        <listOfUnits>
          <unit kind="second" exponent="1" scale="0" multiplier="3600"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="m2" name="meter^2">
        <listOfUnits>
          <unit kind="metre" exponent="2" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
      <unitDefinition id="mM" name="mmole/liter">
        <listOfUnits>
          <unit kind="mole" exponent="1" scale="0" multiplier="0.001"/>
          <unit kind="litre" exponent="-1" scale="0" multiplier="1"/>
        </listOfUnits>
      </unitDefinition>
    </listOfUnitDefinitions>
    <listOfParameters>
      <parameter metaid="meta_Km_glc" sboTerm="SBO:0000027" id="Km_glc" name="Michelis-Menten constant glucose" value="5" units="mM" constant="true">
        <annotation>
          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
            <rdf:Description rdf:about="#meta_Km_glc">
              <bqbiol:is>
                <rdf:Bag>
                  <rdf:li rdf:resource="http://identifiers.org/SBO:0000027"/>
                </rdf:Bag>
              </bqbiol:is>
            </rdf:Description>
          </rdf:RDF>
        </annotation>
        <distrib:listOfUncertainties>
          <distrib:uncertainty metaid="meta_uncertainty1" distrib:id="uncertainty1">
            <annotation>
              <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
                <rdf:Description rdf:about="#meta_uncertainty1">
                  <bqbiol:is>
                    <rdf:Bag>
                      <rdf:li rdf:resource="http://identifiers.org/sabiork.kineticrecord/793"/>
                      <rdf:li rdf:resource="http://identifiers.org/ec-code/2.7.1.2"/>
                      <rdf:li rdf:resource="http://identifiers.org/uniprot/P35557"/>
                      <rdf:li rdf:resource="http://identifiers.org/BTO:0000075"/>
                    </rdf:Bag>
                  </bqbiol:is>
                  <bqbiol:hasTaxon>
                    <rdf:Bag>
                      <rdf:li rdf:resource="http://identifiers.org/taxonomy/9606"/>
                    </rdf:Bag>
                  </bqbiol:hasTaxon>
                </rdf:Description>
              </rdf:RDF>
            </annotation>
            <distrib:uncertParameter distrib:value="5.07" distrib:type="mean"/>
            <distrib:uncertParameter distrib:value="0.97" distrib:type="standardDeviation"/>
          </distrib:uncertainty>
          <distrib:uncertainty metaid="meta_uncertainty2" distrib:id="uncertainty2">
            <annotation>
              <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
                <rdf:Description rdf:about="#meta_uncertainty2">
                  <bqbiol:is>
                    <rdf:Bag>
                      <rdf:li rdf:resource="http://identifiers.org/sabiork.kineticrecord/2581"/>
                      <rdf:li rdf:resource="http://identifiers.org/ec-code/2.7.1.2"/>
                      <rdf:li rdf:resource="http://identifiers.org/uniprot/P35557"/>
                      <rdf:li rdf:resource="http://identifiers.org/BTO:0000075"/>
                    </rdf:Bag>
                  </bqbiol:is>
                  <bqbiol:hasTaxon>
                    <rdf:Bag>
                      <rdf:li rdf:resource="http://identifiers.org/taxonomy/9606"/>
                    </rdf:Bag>
                  </bqbiol:hasTaxon>
                </rdf:Description>
              </rdf:RDF>
            </annotation>
            <distrib:uncertParameter distrib:value="2.7" distrib:type="mean"/>
            <distrib:uncertParameter distrib:value="0.11" distrib:type="standardDeviation"/>
          </distrib:uncertainty>
        </distrib:listOfUncertainties>
      </parameter>
    </listOfParameters>
  </model>
</sbml>
────────────────────────────────────────────────── Validate SBML ──────────────────────────────────────────────────
<SBMLDocument>
valid                    : TRUE
check time (s)           : 0.003
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[ ]: