本文整理汇总了Python中tellurium.loadSBMLModel函数的典型用法代码示例。如果您正苦于以下问题:Python loadSBMLModel函数的具体用法?Python loadSBMLModel怎么用?Python loadSBMLModel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadSBMLModel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: spark_work
def spark_work(model_with_parameters):
import tellurium as te
if(antimony == "antimony"):
model_roadrunner = te.loada(model_with_parameters[0])
else:
model_roadrunner = te.loadSBMLModel(model_with_parameters[0])
parameter_scan_initilisation = te.ParameterScan(model_roadrunner,**model_with_parameters[1])
simulator = getattr(parameter_scan_initilisation, function_name)
return(simulator())
开发者ID:sys-bio,项目名称:tellurium,代码行数:9,代码来源:tellurium.py
示例2: test_roadrunner
def test_roadrunner(self):
# load test model as SBML
sbml = te.getTestModel('feedback.xml')
rr = te.loadSBMLModel(sbml)
# simulate
s = rr.simulate(0, 100.0, 200)
rr.plot(s)
self.assertIsNotNone(rr)
self.assertIsNotNone(s)
self.assertEqual(s.shape[0], 200)
self.assertEqual(s["time"][0], 0)
self.assertAlmostEqual(s["time"][-1], 100.0)
开发者ID:yarden,项目名称:tellurium,代码行数:13,代码来源:test_tellurium.py
示例3: test_roadrunner
def test_roadrunner(self):
# load test model as SBML
from tellurium.tests.testdata import FEEDBACK_SBML
# sbml = te.getTestModel('feedback.xml')
rr = te.loadSBMLModel(FEEDBACK_SBML)
# simulate
s = rr.simulate(0, 100.0, 200)
rr.plot(s)
self.assertIsNotNone(rr)
self.assertIsNotNone(s)
self.assertEqual(s.shape[0], 200)
self.assertEqual(s["time"][0], 0)
self.assertAlmostEqual(s["time"][-1], 100.0)
开发者ID:kirichoi,项目名称:tellurium,代码行数:14,代码来源:test_tellurium.py
示例4: stochastic_work
def stochastic_work(model_object):
import tellurium as te
if model_type == "antimony":
model_roadrunner = te.loada(model_object.model)
else:
model_roadrunner = te.loadSBMLModel(model_object.model)
model_roadrunner.integrator = model_object.integrator
# seed the randint method with the current time
random.seed()
# it is now safe to use random.randint
model_roadrunner.setSeed(random.randint(1000, 99999))
model_roadrunner.integrator.variable_step_size = model_object.variable_step_size
model_roadrunner.reset()
simulated_data = model_roadrunner.simulate(model_object.from_time, model_object.to_time, model_object.step_points)
return([simulated_data.colnames,np.array(simulated_data)])
开发者ID:sys-bio,项目名称:tellurium,代码行数:15,代码来源:tellurium.py
示例5:
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 = "/home/mkoenig/git/tellurium/tellurium/tests/testdata/sedml/sedx/_te_BM12"
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <model1>
model1 = te.loadSBMLModel(os.path.join(workingDir, "model1.xml"))
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task1>
# Task: <task1>
task1 = [None]
model1.setIntegrator("cvode")
model1.timeCourseSelections = ["[Z]", "[X]", "[Y]", "time"]
task1[0] = model1.simulate(start=0.0, end=100.0, steps=1000)
# --------------------------------------------------------
# DataGenerators
# --------------------------------------------------------
# DataGenerator <time>
开发者ID:yarden,项目名称:tellurium,代码行数:31,代码来源:BM12.sedx.py
示例6:
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 = '/home/mkoenig/git/tellurium/tellurium/tests/testdata/sedml/sed-ml'
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <model1>
model1 = te.loadSBMLModel(os.path.join(workingDir, '../models/BorisEJB.xml'))
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task1>
# Task: <task1>
task1 = [None]
model1.setIntegrator('cvode')
model1.conservedMoietyAnalysis = True
model1.steadyStateSelections = ['[MKKK]', '[MKKK_P]', '[MAPK]', '[MAPK_PP]', '[MKK_P]', '[MAPK_P]', 'time', '[MKK]']
model1.simulate()
task1[0] = model1.steadyState()
model1.conservedMoietyAnalysis = False
# --------------------------------------------------------
开发者ID:yarden,项目名称:tellurium,代码行数:31,代码来源:BorisEJB-steady.sedml.py
示例7:
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 = '/home/mkoenig/git/tellurium/tellurium/tests/testdata/sedml/sed-ml'
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <model1>
model1 = te.loadSBMLModel(os.path.join(workingDir, '../models/curien.xml'))
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task1>
# Task: <task1>
task1 = [None]
model1.setIntegrator('cvode')
model1.timeCourseSelections = ['[Phser]', 'time']
task1[0] = model1.simulate(start=0.0, end=500.0, steps=500)
# --------------------------------------------------------
# DataGenerators
# --------------------------------------------------------
# DataGenerator <time>
开发者ID:yarden,项目名称:tellurium,代码行数:31,代码来源:sedmlCurienJWS.sedml.py
示例8: enumerate
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 = '/home/mkoenig/git/tellurium/examples/tellurium-files/phrasedml/_te_oneStep'
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <model1>
model1 = te.loadSBMLModel(os.path.join(workingDir, 'oneStep.xml'))
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task0>
# not part of any DataGenerator: task0
# Task <task1>
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>
开发者ID:yarden,项目名称:tellurium,代码行数:31,代码来源:oneStep.pyccode.py
示例9:
# coding: utf-8
# Back to the main [Index](../index.ipynb)
# ### Model loading from BioModels
# Models can be easily retrieved from BioModels via their identifier.
# In[1]:
#!!! DO NOT CHANGE !!! THIS FILE WAS CREATED AUTOMATICALLY FROM NOTEBOOKS !!! CHANGES WILL BE OVERWRITTEN !!! CHANGE CORRESPONDING NOTEBOOK FILE !!!
from __future__ import print_function
import tellurium as te
# Load model from biomodels.
r = te.loadSBMLModel("http://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000010")
result = r.simulate(0, 3000, 5000)
r.plot(result);
# In[2]:
开发者ID:kirichoi,项目名称:tellurium,代码行数:20,代码来源:model_modelFromBioModels.py
示例10: test_loadSBMLModel_file
def test_loadSBMLModel_file(self):
r = te.loadSBMLModel(self.sbml_file)
self.assertIsNotNone(r)
开发者ID:kirichoi,项目名称:tellurium,代码行数:3,代码来源:test_tellurium.py
示例11:
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 = '/home/mkoenig/git/tellurium/tellurium/tests/testdata/sedml/sedx/_te_ClockSedML'
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <model1>
model1 = te.loadSBMLModel(os.path.join(workingDir, 'Clock_BIOMD21.xml'))
# Model <model2>
model2 = te.loadSBMLModel(os.path.join(workingDir, 'Clock_BIOMD21.xml'))
# /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='V_dT']/@value 4.8
model2['V_dT'] = 4.8
# /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='V_mT']/@value 0.28
model2['V_mT'] = 0.28
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task1>
# Task: <task1>
task1 = [None]
model1.setIntegrator('cvode')
model1.timeCourseSelections = ['[Mt]', 'time']
开发者ID:yarden,项目名称:tellurium,代码行数:31,代码来源:ClockSedML.sedx.py
示例12:
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/tellurium/tests/testdata/sedml/sed-ml'
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <Application0>
Application0 = te.loadSBMLModel(os.path.join(workingDir, '../models/app2sim.xml'))
# Model <Application0_0>
Application0_0 = te.loadSBMLModel(os.path.join(workingDir, '../models/app2sim.xml'))
# /sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='s1'] 10.0
Application0_0['init([s1])'] = 10.0
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task_0_0>
# Task: <task_0_0>
task_0_0 = [None]
Application0.setIntegrator('cvode')
Application0.timeCourseSelections = ['[s0]', '[s1]', 'time']
task_0_0[0] = Application0.simulate(start=0.0, end=20.0, steps=1000)
开发者ID:yarden,项目名称:tellurium,代码行数:30,代码来源:app2sim.sedml.py
示例13: str
elif i[3] == 0:
m.addReaction(["S" + str(i[0]), "S" + str(i[1])],
["S" + str(i[2])], "k" + str(count) + "*S" +
str(i[0]) + "*S" + str(i[1]))
elif i[1] == 0:
m.addReaction(["S" + str(i[0])], ["S" + str(i[1]),
"S" + str(i[2])], "k" + str(count) + "*S" +
str(i[0]))
else:
m.addReaction(["S" + str(i[0]), "S" + str(i[1])], ["S" + str(i[2]),
"S" + str(i[3])], "k" + str(count) + "*S" +
str(i[0]) + "*S" + str(i[1]))
te.saveToFile('ProteinModel.xml', str(m))
r = te.loadSBMLModel('ProteinModel.xml')
try:
if forbidZeros:
r.simulate()
for i in r.getSteadyStateValues():
if i < 1e-5:
raise ValueError
r.simulate(end=1000)
steady = r.steadyState()
if steady < 10e-6:
print "Success!"
print ("Number of tries = " + str(zcount))
zcount = 0
for i in data:
zcount += 1
开发者ID:violasox,项目名称:random-networks,代码行数:31,代码来源:GenerateProteinNetwork.py
示例14:
from __future__ import print_function, division
import libsbml
import tellurium as te
import lxml.etree as ET
from io import StringIO
import tempfile
r = te.loada('''
J0: S1 -> S2; k1*S1;
S1=10.0; S2=0.0; k1=1.0;
''')
# create SBML file
f = tempfile.NamedTemporaryFile('w', suffix=".xml")
r.exportToSBML(f.name)
# create C14N canonical XML
et = ET.parse(f.name)
output = StringIO.StringIO()
et.write_c14n(output)
c14n_xml = output.getvalue()
# TODO: in addition sort all elements of the listOfs
# read with libsbml
doc = libsbml.readSBMLFromString(c14n_xml)
# read with roadrunner
te.loadSBMLModel(c14n_xml)
开发者ID:matthiaskoenig,项目名称:sbmlutils,代码行数:30,代码来源:sbmldiff.py
示例15: test_loadSBMLModel_str
def test_loadSBMLModel_str(self):
r = te.loadSBMLModel(self.sbml_str)
self.assertIsNotNone(r)
开发者ID:kirichoi,项目名称:tellurium,代码行数:3,代码来源:test_tellurium.py
示例16:
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_03"
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <mod1>
mod1 = te.loadSBMLModel(os.path.join(workingDir, "case_03.xml"))
# Model <mod2>
mod2 = te.loadSBMLModel(os.path.join(workingDir, "case_03.xml"))
__var__S1 = mod2["init([S1])"]
mod2["init([S2])"] = __var__S1 + 4
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task1>
# Task: <task1>
task1 = [None]
mod1.setIntegrator("cvode")
mod1.timeCourseSelections = ["[S1]", "[S2]", "time"]
task1[0] = mod1.simulate(start=0.0, end=10.0, steps=100)
开发者ID:kirichoi,项目名称:tellurium,代码行数:30,代码来源:case_03.pycode.py
示例17: enumerate
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/tellurium/tests/testdata/sedml/sed-ml'
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <Application0>
Application0 = te.loadSBMLModel(os.path.join(workingDir, '../models/asedml3repeat.xml'))
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task_0_0>
# not part of any DataGenerator: task_0_0
# Task <repeatedTask_0_0>
repeatedTask_0_0 = []
__range__range_0_0_s1_init_uM = np.linspace(start=10.0, stop=30.0, num=4)
for __k__range_0_0_s1_init_uM, __value__range_0_0_s1_init_uM in enumerate(__range__range_0_0_s1_init_uM):
Application0.reset()
# Task: <task_0_0>
task_0_0 = [None]
开发者ID:yarden,项目名称:tellurium,代码行数:31,代码来源:asedml3repeat.sedml.py
示例18:
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import libsedml
import pandas
import os.path
workingDir = '/home/mkoenig/git/tellurium/tellurium/tests/testdata/sedml/sedx/_te_BIOMD0000000139'
# --------------------------------------------------------
# Models
# --------------------------------------------------------
# Model <model1>
import tellurium.temiriam as temiriam
__model1_sbml = temiriam.getSBMLFromBiomodelsURN('urn:miriam:biomodels.db:BIOMD0000000139')
model1 = te.loadSBMLModel(__model1_sbml)
# --------------------------------------------------------
# Tasks
# --------------------------------------------------------
# Task <task1>
# Task: <task1>
task1 = [None]
model1.setIntegrator('cvode')
model1.timeCourseSelections = ['Total_NFkBn', 'time']
task1[0] = model1.simulate(start=0.0, end=2500.0, steps=1000)
# --------------------------------------------------------
# DataGenerators
# --------------------------------------------------------
# DataGenerator <time>
开发者ID:yarden,项目名称:tellurium,代码行数:31,代码来源:BIOMD0000000139.sedx.py
示例19: str
s.join([k2, sp2]) + "+" + s.join([k3, sp1, sp2]) + ")")
elif i[6] == 8:
m.addReaction([], [sp3], "(1+" + s.join([k1, sp1, sp2]) +
")/(1+" + s.join([k1, sp1]) + "+" + s.join([k2, sp2]) + "+"
+ s.join([k3, sp1, sp2]) + ")")
elif i[6] == 9:
m.addReaction([], [sp3], "(" + s.join([k1, sp1]) + ")/(1+" +
s.join([k1, sp1]) + "+" + s.join([k2, sp2]) + "+" +
s.join([k3, sp1, sp2]) + ")")
decayData = [] # Holds protein decay information
re.proteindecay()
te.saveToFile('GeneticModel.xml', str(m))
r = te.loadSBMLModel('GeneticModel.xml')
try:
if forbidZeros:
r.simulate()
for i in r.getSteadyStateValues():
if i < 1e-5:
raise ValueError
steady = r.steadyState() # Determine if final concentrations steady out
if steady < 10e-6: # If they do, then it's a successful model
print "Success!"
print ("Number of tries = " + str(zcount))
zcount = 0
for i in data:
zcount += 1
print ("Number of reactions = " + str(zcount))
if printReactions:
开发者ID:violasox,项目名称:random-networks,代码行数:31,代码来源:GenerateGeneticNetwork.py
示例20: str
if i[1] == 0 and i[3] == 0:
m.addReaction([sp1], [sp2], "k" + str(count) + "*" + sp1)
elif i[3] == 0:
m.addReaction([sp1, sp2], [sp3], "k" + str(count) + "*" + sp1
+ "*" + sp2)
elif i[1] == 0:
m.addReaction([sp1], [sp2, sp3], "k" + str(count) + "*" + sp1)
else:
m.addReaction([sp1, sp2], [sp3, sp4], "k" + str(count) + "*" + sp1
+ "*" + sp2)
te.saveToFile('Model.xml', str(m))
r = te.loadSBMLModel('Model.xml')
try:
if forbidZeros:
r.simulate()
for i in r.getSteadyStateValues():
if i < 1e-5:
raise ValueError
if limitBoundarySpecies:
if speciesType.count(1) > maxBoundarySpecies:
raise ValueError
steady = r.steadyState() #Determine if concentrations converge
if steady < 10e-6: # If they do, it's a successful model
print "Success!"
print ("Number of tries = " + str(zcount))
zcount = 0
for i in data:
开发者ID:violasox,项目名称:random-networks,代码行数:31,代码来源:GenerateReactionNetwork.py
注:本文中的tellurium.loadSBMLModel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论