Synbio course

From CSBLwiki

(Difference between revisions)
Jump to: navigation, search
(Practice #1)
(Practice #1)
Line 36: Line 36:
# quasi-equilibrium; E0 = E + ES; dES = 0
# quasi-equilibrium; E0 = E + ES; dES = 0
# dE = -k1*E0*S+(k1*S+k2)*ES, dES = k1*E0*S-(k1*S+k2+k3)*ES, dP = k2*ES
# dE = -k1*E0*S+(k1*S+k2)*ES, dES = k1*E0*S-(k1*S+k2+k3)*ES, dP = k2*ES
-
# ode functions
+
 
 +
### define ode functions
michaelis = function(t,y,p) {
michaelis = function(t,y,p) {
-
   # S = y[1]; ES = y[2]; P = y[3]
+
   # t, y, p: vector
-
   # k1 = p[1]; k2 = p[2]; k3=p[3]; E0=p[4]
+
  # t: a time scale
 +
  # y: S = y[1]; ES = y[2]; P = y[3]
 +
   # p: k1 = p[1]; k2 = p[2]; k3=p[3]; E0=p[4]
   dS = -p[1]*p[4]*y[1]+(p[1]*y[1]+p[2])*y[2]
   dS = -p[1]*p[4]*y[1]+(p[1]*y[1]+p[2])*y[2]
   dES = p[1]*p[4]*y[1]-(p[1]*y[1]+p[2]+p[3])*y[2]
   dES = p[1]*p[4]*y[1]-(p[1]*y[1]+p[2]+p[3])*y[2]
Line 45: Line 48:
   list(c(dS,dES,dP))
   list(c(dS,dES,dP))
}
}
-
#### initial parameter
+
 
-
k1 = 1000; k2 = 1; k3 = 0.05; E0 = 0.0005
+
#### initial parameters
-
p = c(k1,k2,k3,E0)
+
k1 = 1e3
-
t = seq(0,100,1) # time scale
+
k2 = 1
-
#t = 1
+
k3 = 5e-2
-
y = c(0.001,0,0) # initial values of S, ES and P
+
E0 = 5e-4
 +
 
 +
p = c(k1,k2,k3,E0)  # <-- parameters (initial values)
 +
t = seq(0,100,1)   # <-- a time scale (0 to 100 sec.)
 +
 
 +
y = c(1e-3,0,0)     # <-- initial values of [S], [ES] and [P]
#### solving equations
#### solving equations
-
res = lsoda(y,t,michaelis,p)
+
res = lsoda(y,t,michaelis,p)   # store result (101 x 4 matrix) 
 +
 
#### plotting results
#### plotting results
-
plot(res[,1],res[,2],type="l",col="red",ylim=c(0,0.001))
+
time = res[,1]   # time range - column 1
-
points(res[,1],res[,3],type="l",col="blue")
+
S = res[,2]       # [S] changes - column 2
-
E = p[4]-res[,3]
+
ES = res[,3]      # [ES]
-
points(res[,1],E,type="l",col="cyan")
+
E = p[4]-res[,3]  # [E] free enzyme
-
points(res[,1],res[,4],type="l",col="green")
+
P = res[,4]      # [P] product
 +
 
 +
plot(time,S,type="l",col="red",ylim=c(0,0.001))
 +
points(time,ES,type="l",col="blue")
 +
points(time,E,type="l",col="cyan")
 +
points(time,P,type="l",col="green")
</pre>
</pre>
 +
*Result (above script is working but the result is not correct; you may find an error in the code)
*Result (above script is working but the result is not correct; you may find an error in the code)
[[image:Michaelis-menten.png|thumb|left|Michaelis-Menten simulation result]]
[[image:Michaelis-menten.png|thumb|left|Michaelis-Menten simulation result]]

Revision as of 12:50, 29 October 2010

Contents

2010 Fall LMB904

Practices in R

Practice #1

# execute 'R' & run a command
# you should have an internet connection

>install.package("odesolve")

library(odesolve)
# Michaelis-menten equation
# E + S <-> ES -> E + P
#      k1,k2   k3
# rate equations
# dE = -k1*E*S+k2*ES, dS = -k1*E*S+k2*ES+k3*ES, dES = k1*E*S-k2*ES-k3*ES
# quasi-equilibrium; E0 = E + ES; dES = 0
# dE = -k1*E0*S+(k1*S+k2)*ES, dES = k1*E0*S-(k1*S+k2+k3)*ES, dP = k2*ES

### define ode functions
michaelis = function(t,y,p) {
  # t, y, p: vector
  # t: a time scale
  # y: S = y[1]; ES = y[2]; P = y[3]
  # p: k1 = p[1]; k2 = p[2]; k3=p[3]; E0=p[4]
  dS = -p[1]*p[4]*y[1]+(p[1]*y[1]+p[2])*y[2]
  dES = p[1]*p[4]*y[1]-(p[1]*y[1]+p[2]+p[3])*y[2]
  dP = p[2]*y[2]
  list(c(dS,dES,dP))
}

#### initial parameters
k1 = 1e3
k2 = 1
k3 = 5e-2
E0 = 5e-4

p = c(k1,k2,k3,E0)  # <-- parameters (initial values)
t = seq(0,100,1)    # <-- a time scale (0 to 100 sec.)

y = c(1e-3,0,0)     # <-- initial values of [S], [ES] and [P]

#### solving equations
res = lsoda(y,t,michaelis,p)    # store result (101 x 4 matrix)  


#### plotting results
time = res[,1]    # time range - column 1
S = res[,2]       # [S] changes - column 2
ES = res[,3]      # [ES]
E = p[4]-res[,3]  # [E] free enzyme
P = res[,4]       # [P] product

plot(time,S,type="l",col="red",ylim=c(0,0.001))
points(time,ES,type="l",col="blue")
points(time,E,type="l",col="cyan")
points(time,P,type="l",col="green")
Michaelis-Menten simulation result

Practice #2

Error fetching PMID 10681449:
  1. Error fetching PMID 10681449: [LAM]

Practice #3

Error fetching PMID 10659857:
  1. Error fetching PMID 10659857: [TOG]
Personal tools
Namespaces
Variants
Actions
Site
Choi lab
Resources
Toolbox