How to use the tellurium.loadSBMLModel function in tellurium

To help you get started, we’ve selected a few tellurium examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sys-bio / tellurium / examples / tellurium-files / phrasedml / testcase_01.pycode.py View on Github external
import tellurium as te
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path

workingDir = '/tmp/tmpCP0o4p_sedml/_te_testcase_01'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
model0 = te.loadSBMLModel(os.path.join(workingDir, 'testcase_01.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
None

# --------------------------------------------------------
# DataGenerators
# --------------------------------------------------------
# DataGenerator 
__var__task0_____time = np.transpose(np.array([sim['time'] for sim in task0]))
if len(__var__task0_____time.shape) == 1:
     __var__task0_____time.shape += (1,)
plot_0_0_0 = __var__task0_____time
github sys-bio / tellurium / examples / tellurium-files / phrasedml / case_04.pycode.py View on Github external
import os.path
Config.LOADSBMLOPTIONS_RECOMPILE = True

workingDir = r'/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/_te_case_04'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
mod1 = te.loadSBMLModel(os.path.join(workingDir, 'case_04.xml'))
# Model 
mod2 = te.loadSBMLModel(os.path.join(workingDir, 'case_04.xml'))
__var__S1 = mod2['init([S1])']
mod2['init([S2])'] = __var__S1 + 4
# Model 
mod3 = te.loadSBMLModel(os.path.join(workingDir, 'case_04.xml'))
__var__S1 = mod3['init([S1])']
mod3['init([S2])'] = __var__S1 + 4
# /sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='S1']/@initialConcentration 20
mod3['init([S1])'] = 20

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
# Task: 
task1 = [None]
mod1.setIntegrator('cvode')
mod1.timeCourseSelections = ['[S1]', '[S2]', 'time']
task1[0] = mod1.simulate(start=0.0, end=10.0, steps=100)

# Task 
github sys-bio / tellurium / examples / tellurium-files / phrasedml / parameterScan1D.pycode.py View on Github external
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path
Config.LOADSBMLOPTIONS_RECOMPILE = True

workingDir = r'/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/_te_parameterScan1D'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
model1 = te.loadSBMLModel(os.path.join(workingDir, 'parameterScan1D.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
# not part of any DataGenerator: task0

# Task 

task1 = []
__range__vector_for_J0_v0 = [8.0, 4.0, 0.40000000000000002]
for __k__vector_for_J0_v0, __value__vector_for_J0_v0 in enumerate(__range__vector_for_J0_v0):
    model1.reset()
    # Task: 
    task0 = [None]
    model1.setIntegrator('cvode')
github sys-bio / tellurium / examples / tellurium-files / SBMLfromBioModelsDB.py View on Github external
# -*- coding: utf-8 -*-
"""
Load model from biomodels.
"""
from __future__ import print_function, division
import tellurium as te

r = te.loadSBMLModel("http://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000010")
result = r.simulate(0, 3000, 5000)
r.plot(result)
github sys-bio / tellurium / examples / tellurium-files / phrasedml / oneStep.pycode.py View on Github external
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path
Config.LOADSBMLOPTIONS_RECOMPILE = True

workingDir = r'/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/_te_oneStep'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
model1 = te.loadSBMLModel(os.path.join(workingDir, 'oneStep.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
# not part of any DataGenerator: task0

# Task 

task1 = []
__range__x = np.linspace(start=0.0, stop=10.0, num=101)
for __k__x, __value__x in enumerate(__range__x):
    if __k__x == 0:
        model1.reset()
    # Task: 
    task0 = [None]
github sys-bio / tellurium / examples / tellurium-files / phrasedml / repeatedStochastic.pycode.py View on Github external
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path
Config.LOADSBMLOPTIONS_RECOMPILE = True

workingDir = r'/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/_te_repeatedStochastic'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
model1 = te.loadSBMLModel(os.path.join(workingDir, 'repeatedStochastic.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
# not part of any DataGenerator: task1

# Task 
# not part of any DataGenerator: task2

# Task 

repeat1 = []
__range__x = np.linspace(start=0.0, stop=10.0, num=11)
for __k__x, __value__x in enumerate(__range__x):
    model1.reset()
github sys-bio / tellurium / examples / tellurium-files / phrasedml / case_06.pycode.py View on Github external
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path
Config.LOADSBMLOPTIONS_RECOMPILE = True

workingDir = r'/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/_te_case_06'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
mod1 = te.loadSBMLModel(os.path.join(workingDir, 'case_06.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
# not part of any DataGenerator: task1

# Task 

repeat1 = []
__range__uniform_linear_for_S2 = np.linspace(start=0.0, stop=10.0, num=3)
__range__vector_for_S1 = [1.0, 3.0, 5.0]
for __k__uniform_linear_for_S2, __value__uniform_linear_for_S2 in enumerate(__range__uniform_linear_for_S2):
    __value__vector_for_S1 = __range__vector_for_S1[__k__uniform_linear_for_S2]
    mod1.reset()
    # Task: 
github sys-bio / tellurium / examples / tellurium-files / phrasedml / parameterScan2D.pycode.py View on Github external
import tellurium as te
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path

workingDir = '/tmp/tmpSc7n0W_sedml/_te_parameterScan2D'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
model_3 = te.loadSBMLModel(os.path.join(workingDir, 'parameterScan2D.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
task_1 = [None]
model_3.setIntegrator('cvode')
Config = model_3
model_3.conservedMoietyAnalysis = True
model_3.steadyStateSelections = []
model_3.steadyState()
task_1[0] = dict(zip(model_3.steadyStateSelections, model_3.getSteadyStateValues()))
model_3.conservedMoietyAnalysis = False

# Task 
__range__vector_for_J1_KK2 = [1.0, 5.0, 10.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0]
github sys-bio / tellurium / examples / tellurium-files / phrasedml / parameterScan1D.pycode.py View on Github external
import tellurium as te
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path

workingDir = '/tmp/tmpBo0ZRb_sedml/_te_parameterScan1D'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
model1 = te.loadSBMLModel(os.path.join(workingDir, 'parameterScan1D.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
task0 = [None]
model1.setIntegrator('cvode')
model1.timeCourseSelections = []
task0[0] = model1.simulate(start=0.0, end=20.0, steps=1000)

# Task 
__range__vector_for_J0_v0 = [8.0, 4.0, 0.40000000000000002]
task1 = [None]*len(__range__vector_for_J0_v0)
for k in range(len(__range__vector_for_J0_v0)):
    model1.reset()
    __value__vector_for_J0_v0 = __range__vector_for_J0_v0[k]
github sys-bio / tellurium / examples / tellurium-files / phrasedml / parameterScan2D.pycode.py View on Github external
from tellurium.sedml.mathml import *
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path
Config.LOADSBMLOPTIONS_RECOMPILE = True

workingDir = r'/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/_te_parameterScan2D'

# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model 
model_3 = te.loadSBMLModel(os.path.join(workingDir, 'parameterScan2D.xml'))

# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task 
# not part of any DataGenerator: task_1

# Task 
# not part of any DataGenerator: repeatedtask_1

# Task 

repeatedtask_2 = []
__range__uniform_linear_for_J4_KK5 = np.linspace(start=1.0, stop=40.0, num=11)
for __k__uniform_linear_for_J4_KK5, __value__uniform_linear_for_J4_KK5 in enumerate(__range__uniform_linear_for_J4_KK5):
    model_3.reset()