Load SBML file and manipulate using the model builder API

load the file

loadModelBuilder["repressilator.xml"] ;

Compartment cell added.

Species x added to compartment cell

Species y added to compartment cell

Species z added to compartment cell

Species py added to compartment cell

Species px added to compartment cell

Species pz added to compartment cell

Species null added to compartment cell

Parameter alpha added.

Parameter beta added.

Parameter alpha0 added.

Parameter alpha1 added.

Parameter n added.

Parameter k1 added.

Parameter K added.

Reaction reaction1 added.

Reaction reaction2 added.

Reaction reaction3 added.

Reaction reaction4 added.

Reaction reaction5 added.

Reaction reaction6 added.

SMBL Model repressilator loaded into Model Builder

display the current model

showModel[] ;

File Name:Internal Model\nSBML Level 2 Version 1

Model: Repressilator Model = repressilator

Function Definitions

----- None -----

Unit Definitions

----- None -----

Compartments

ID Name Dimension Size Units Derived Units Outside Constant
cell cell 3 ··· volume volume ··· True

Species

ID Name Compartment Type I.C. Units Derived Units B.C Constant Charge
x x cell ··· ··· ··· ··· False False ···
y y cell ··· ··· ··· ··· False False ···
z z cell ··· ··· ··· ··· False False ···
py py cell ··· ··· ··· ··· False False ···
px px cell amount 5. substance substance False False ···
pz pz cell amount 15. substance substance False False ···
null null cell ··· ··· ··· ··· True True ···

Global Parameters

ID Name Value Units Derived Units Constant
alpha alpha 250. ··· ··· True
beta beta 5. ··· ··· True
alpha0 alpha0 0 ··· ··· True
alpha1 alpha1 0 ··· ··· True
n n 2.1 ··· ··· True
k1 k1 1. ··· ··· True
K K 1. ··· ··· True

Rules

----- None -----

Reactions, global and local contexts suppressed

ID Name Fast Reaction Modifiers Parameters Formula Contribution to ODEs
reaction1 reaction1 False null ⇔ x
pz
··· alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
x'[t]==alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
reaction2 reaction2 False null ⇔ y
px
··· alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
y'[t]==alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
reaction3 reaction3 False null ⇔ z
py
··· alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]
z'[t]==alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]
reaction4 reaction4 False px ⇔ null
x
··· -(beta*(-px[t] + x[t]))
px'[t]==beta*(-px[t] + x[t])
reaction5 reaction5 False py ⇔ null
y
··· -(beta*(-py[t] + y[t]))
py'[t]==beta*(-py[t] + y[t])
reaction6 reaction6 False pz ⇔ null
z
··· -(beta*(-pz[t] + z[t]))
pz'[t]==beta*(-pz[t] + z[t])

Differential Equations, global context suppressed

Variable ODEs
px px'[t]==beta*(-px[t] + x[t])
py py'[t]==beta*(-py[t] + y[t])
pz pz'[t]==beta*(-pz[t] + z[t])
x x'[t]==alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
y y'[t]==alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
z z'[t]==alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]

Events

----- None -----

add a reaction

observe that the species A and B have not been previously defined so thay are first added to the model in the single compartment cell

addReaction[A B, kineticLaw k5 * A * x/(k6 + x), parameters {k5 0.1, k6 2}]

Species A added to compartment cell

Species B added to compartment cell

Reaction reaction7 added.

showModel[] ;

File Name:Internal Model\nSBML Level 2 Version 1

Model: Repressilator Model = repressilator

Function Definitions

----- None -----

Unit Definitions

----- None -----

Compartments

ID Name Dimension Size Units Derived Units Outside Constant
cell cell 3 ··· volume volume ··· True

Species

ID Name Compartment Type I.C. Units Derived Units B.C Constant Charge
x x cell ··· ··· ··· ··· False False ···
y y cell ··· ··· ··· ··· False False ···
z z cell ··· ··· ··· ··· False False ···
py py cell ··· ··· ··· ··· False False ···
px px cell amount 5. substance substance False False ···
pz pz cell amount 15. substance substance False False ···
null null cell ··· ··· ··· ··· True True ···
A A cell ··· ··· ··· ··· False False ···
B B cell ··· ··· ··· ··· False False ···

Global Parameters

ID Name Value Units Derived Units Constant
alpha alpha 250. ··· ··· True
beta beta 5. ··· ··· True
alpha0 alpha0 0 ··· ··· True
alpha1 alpha1 0 ··· ··· True
n n 2.1 ··· ··· True
k1 k1 1. ··· ··· True
K K 1. ··· ··· True

Rules

----- None -----

Reactions, global and local contexts suppressed

ID Name Fast Reaction Modifiers Parameters Formula Contribution to ODEs
reaction1 reaction1 False null ⇔ x
pz
··· alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
x'[t]==alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
reaction2 reaction2 False null ⇔ y
px
··· alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
y'[t]==alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
reaction3 reaction3 False null ⇔ z
py
··· alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]
z'[t]==alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]
reaction4 reaction4 False px ⇔ null
x
··· -(beta*(-px[t] + x[t]))
px'[t]==beta*(-px[t] + x[t])
reaction5 reaction5 False py ⇔ null
y
··· -(beta*(-py[t] + y[t]))
py'[t]==beta*(-py[t] + y[t])
reaction6 reaction6 False pz ⇔ null
z
··· -(beta*(-pz[t] + z[t]))
pz'[t]==beta*(-pz[t] + z[t])
reaction7 reaction7 False A ⇔ B ···
k5→0.1
k6→2.
(k5*A[t]*x[t])/(k6 + x[t])
B'[t]==(k5*A[t]*x[t])/(k6 + x[t])
A'[t]==-((k5*A[t]*x[t])/(k6 + x[t]))

Differential Equations, global context suppressed

Variable ODEs
A A'[t]==-((reaction7`k5*A[t]*x[t])/(reaction7`k6 + x[t]))
B B'[t]==(reaction7`k5*A[t]*x[t])/(reaction7`k6 + x[t])
px px'[t]==beta*(-px[t] + x[t])
py py'[t]==beta*(-py[t] + y[t])
pz pz'[t]==beta*(-pz[t] + z[t])
x x'[t]==alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
y y'[t]==alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
z z'[t]==alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]

Events

----- None -----

realize that you forgot to set initial conditions on A and B, so set them now

modifySpecies[A, initialAmount 5] ; modifySpecies[B, initialAmount 0] ;

Previous occurance of species A removed.

Species A added to compartment cell

Previous occurance of species B removed.

Species B added to compartment cell

Show the model again

showModel[] ;

File Name:Internal Model\nSBML Level 2 Version 1

Model: Repressilator Model = repressilator

Function Definitions

----- None -----

Unit Definitions

----- None -----

Compartments

ID Name Dimension Size Units Derived Units Outside Constant
cell cell 3 ··· volume volume ··· True

Species

ID Name Compartment Type I.C. Units Derived Units B.C Constant Charge
x x cell ··· ··· ··· ··· False False ···
y y cell ··· ··· ··· ··· False False ···
z z cell ··· ··· ··· ··· False False ···
py py cell ··· ··· ··· ··· False False ···
px px cell amount 5. substance substance False False ···
pz pz cell amount 15. substance substance False False ···
null null cell ··· ··· ··· ··· True True ···
A A cell amount 5. substance substance False False ···
B B cell amount 0 substance substance False False ···

Global Parameters

ID Name Value Units Derived Units Constant
alpha alpha 250. ··· ··· True
beta beta 5. ··· ··· True
alpha0 alpha0 0 ··· ··· True
alpha1 alpha1 0 ··· ··· True
n n 2.1 ··· ··· True
k1 k1 1. ··· ··· True
K K 1. ··· ··· True

Rules

----- None -----

Reactions, global and local contexts suppressed

ID Name Fast Reaction Modifiers Parameters Formula Contribution to ODEs
reaction1 reaction1 False null ⇔ x
pz
··· alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
x'[t]==alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
reaction2 reaction2 False null ⇔ y
px
··· alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
y'[t]==alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
reaction3 reaction3 False null ⇔ z
py
··· alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]
z'[t]==alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]
reaction4 reaction4 False px ⇔ null
x
··· -(beta*(-px[t] + x[t]))
px'[t]==beta*(-px[t] + x[t])
reaction5 reaction5 False py ⇔ null
y
··· -(beta*(-py[t] + y[t]))
py'[t]==beta*(-py[t] + y[t])
reaction6 reaction6 False pz ⇔ null
z
··· -(beta*(-pz[t] + z[t]))
pz'[t]==beta*(-pz[t] + z[t])
reaction7 reaction7 False A ⇔ B ···
k5→0.1
k6→2.
(k5*A[t]*x[t])/(k6 + x[t])
B'[t]==(k5*A[t]*x[t])/(k6 + x[t])
A'[t]==-((k5*A[t]*x[t])/(k6 + x[t]))

Differential Equations, global context suppressed

Variable ODEs
A A'[t]==-((reaction7`k5*A[t]*x[t])/(reaction7`k6 + x[t]))
B B'[t]==(reaction7`k5*A[t]*x[t])/(reaction7`k6 + x[t])
px px'[t]==beta*(-px[t] + x[t])
py py'[t]==beta*(-py[t] + y[t])
pz pz'[t]==beta*(-pz[t] + z[t])
x x'[t]==alpha0 + (alpha + alpha1*pz[t]^n)/(K^n + pz[t]^n) - k1*x[t]
y y'[t]==alpha0 + (alpha + alpha1*px[t]^n)/(K^n + px[t]^n) - k1*y[t]
z z'[t]==alpha0 + (alpha + alpha1*py[t]^n)/(K^n + py[t]^n) - k1*z[t]

Events

----- None -----

Everything looks good so create the sbml  and write it to the screen

createModel[]

<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Generated 26-Nov ... ; </listOfReactions>\n  <listOfEvents/>\n </model>\n</sbml>


Created by Mathematica  (February 27, 2004)