document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #Model fitting
  2. library(minpack.lm)
  3. library(bbmle)
  4. library(plyr)
  5. library(ggplot2)
  6.  
  7. #Observed data between 0uM and 10uM
  8. x<-c(0,0,0,0.5,0.5,0.5,1,1,1,2.5,2.5,2.5,5,5,5,7.5,7.5,7.5,10,10,10)
  9. y<-c(0.002857143,0.00152381,0.00212963,0.011598174,0.009054726,0.011746032,0.021904762,0.00854902,0.016464646,0.038600823,0.043166667,0.043508772,0.045142857,0.045367965,0.035365854,0.043474178,0.044122807,0.04971831,0.03822807,0.045063291,0.043288889)
  10. #0.043508772<=0.053508772, 0.04971831<=0.05971831, 0.03822807<=0.033?
  11. df<-data.frame(x, y)
  12.  
  13. #HILL FUNCTION
  14. Hill<-nlsLM(y~((a+b*x^d)/(c+x^d)), start=list(a=0.002, b=0.044, c=1, d=2), trace=TRUE)
  15.  
  16. #LOGISYIC FUNCTION
  17. Logt<-nlsLM(y~(a+b/(1+exp(4*c*(d-x)/b+2))), start=list(a=0.001, b=0.044, c=0.025, d=0.1), trace=TRUE)
  18.  
  19. #GOMPERTZ FUNCTION
  20. Gomp<-nlsLM(y~(a+b*exp(-exp(c*2.71828*(d-x)/b+1))), start=list(a=0.001, b=0.044, c=0.025, d=0.1), trace=TRUE)
  21.  
  22.  
  23. AICtab(Hill, Logt, Gomp)
  24. #     dAIC df
  25. #Logt 0.0  5
  26. #Gomp 1.8  5
  27. #Hill 3.6  5
  28.  
  29.  
  30. summary(Logt)
  31. #Formula: y ~ (a + b/(1 + exp(4 * c * (d - x)/b + 2)))
  32.  
  33. #Parameters:
  34. #   Estimate Std. Error t value Pr(>|t|)    
  35. #a 0.0001397  0.0048826   0.029 0.977507    
  36. #b 0.0434417  0.0053800   8.075 3.22e-07 ***
  37. #c 0.0222537  0.0054435   4.088 0.000766 ***
  38. #d 0.2392522  0.3978514   0.601 0.555535    
  39.  
  40. #Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  41.  
  42. #Residual standard error: 0.004108 on 17 degrees of freedom
  43.  
  44. #Number of iterations to convergence: 9
  45. #Achieved convergence tolerance: 1.49e-08
  46. plot(x, y, lwd=2, xlab=\'AuCl4_uM\', ylab=\'Relative_bGal\')
  47. xfit <- seq(0, 10, 0.01)
  48. yfit <- (0.0001397+0.041717/(1+exp(4*0.0222537*(0.2392522-xfit)/ 0.0434417+2)))
  49. lines(spline(xfit, yfit), lwd=2)
  50.  
  51. #The effect of gold concentration
  52. iGEM<-function(t, state, parms) {
  53. with(as.list(c(state, parms)), {
  54.  
  55. if(Uin<0) {Uin<-0}
  56. else {Uin<-Uin}
  57. if(Uout<0) {Uout<-0}
  58. else {Uout<-Uout}
  59.  
  60. dR <- (a + b/(1 + exp(4 * c * (d - Uin)/b + 2)))-R
  61. dUin <- (e*(Uout-Uin))
  62. dUout <- (e*(Uin-Uout))
  63.  
  64. list(c(dR, dUin, dUout))
  65. })
  66. }
  67.  
  68. library(deSolve)
  69.  
  70. parms<-c(
  71. a=0.0001397,
  72. b=0.0434417,
  73. c=0.0222537,
  74. d=0.2392522,
  75. e=0.01)
  76.  
  77. times<-seq(0, 120, 0.05)
  78.  
  79. state<-c(
  80. R=0.003464946,
  81. Uin=0,
  82. Uout=0)
  83. out0 <- ode(y = state, times = times, func = iGEM, parms = parms)
  84.  
  85.  
  86. state<-c(
  87. R=0.003464946,
  88. Uin=0,
  89. Uout=0.5)
  90. out1 <- ode(y = state, times = times, func = iGEM, parms = parms)
  91.  
  92. state<-c(
  93. R=0.003464946,
  94. Uin=0,
  95. Uout=1)
  96. out2 <- ode(y = state, times = times, func = iGEM, parms = parms)
  97.  
  98. state<-c(
  99. R=0.003464946,
  100. Uin=0,
  101. Uout=2)
  102. out3 <- ode(y = state, times = times, func = iGEM, parms = parms)
  103.  
  104. state<-c(
  105. R=0.003464946,
  106. Uin=0,
  107. Uout=4)
  108. out4 <- ode(y = state, times = times, func = iGEM, parms = parms)
  109.  
  110. state<-c(
  111. R=0.003464946,
  112. Uin=0,
  113. Uout=6)
  114. out5 <- ode(y = state, times = times, func = iGEM, parms = parms)
  115.  
  116.  
  117. state<-c(
  118. R=0.003464946,
  119. Uin=0,
  120. Uout=8)
  121. out6 <- ode(y = state, times = times, func = iGEM, parms = parms)
  122.  
  123.  
  124. state<-c(
  125. R=0.003464946,
  126. Uin=0,
  127. Uout=10)
  128. out7 <- ode(y = state, times = times, func = iGEM, parms = parms)
  129.  
  130.  
  131. out<-rbind(out0, out1, out2, out3, out4, out5, out6, out7)
  132. plot(out, pch=\'.\')
  133.  
  134.  
  135. #The effect of membrane permeability
  136. iGEM<-function(t, state, parms) {
  137. with(as.list(c(state, parms)), {
  138.  
  139. if(Uin<0) {Uin<-0}
  140. else {Uin<-Uin}
  141. if(Uout<0) {Uout<-0}
  142. else {Uout<-Uout}
  143.  
  144. dR <- (a + b/(1 + exp(4 * c * (d - Uin)/b + 2)))-R
  145. dUin <- (e*(Uout-Uin))
  146. dUout <- (e*(Uin-Uout))
  147.  
  148. list(c(dR, dUin, dUout))
  149. })
  150. }
  151. time<-seq(0, 400, 1)
  152.  
  153. library(deSolve)
  154. parms<-c(
  155. a=0.0001397,
  156. b=0.0434417,
  157. c=0.0222537,
  158. d=0.2392522,
  159. e=0.01)
  160.  
  161. state<-c(
  162. R=0.003464946,
  163. Uin=0,
  164. Uout=0)
  165. out0 <- ode(y = state, times = times, func = iGEM, parms = parms)
  166.  
  167. times<-seq(0, 400, 0.1)
  168.  
  169. parms<-c(
  170. a=0.0001397,
  171. b=0.0434417,
  172. c=0.0222537,
  173. d=0.2392522,
  174. e=0.01)
  175.  
  176. state<-c(
  177. R=0.003464946,
  178. Uin=0,
  179. Uout=5)
  180. out1 <- ode(y = state, times = times, func = iGEM, parms = parms)
  181.  
  182. parms<-c(
  183. a=0.0001397,
  184. b=0.0434417,
  185. c=0.0222537,
  186. d=0.2392522,
  187. e=0.05)
  188.  
  189. state<-c(
  190. R=0.003464946,
  191. Uin=0,
  192. Uout=5)
  193. out2 <- ode(y = state, times = times, func = iGEM, parms = parms)
  194.  
  195. parms<-c(
  196. a=0.0001397,
  197. b=0.0434417,
  198. c=0.0222537,
  199. d=0.2392522,
  200. e=0.005)
  201.  
  202. state<-c(
  203. R=0.003464946,
  204. Uin=0,
  205. Uout=5)
  206. out3 <- ode(y = state, times = times, func = iGEM, parms = parms)
  207.  
  208.  
  209. out<-rbind(out0, out1, out2, out3)
  210. plot(out, pch=\'.\')
  211.  
  212.  
  213. #The effect of gold mineralization peptides
  214. #mineralisastion to peptide degradation ratio
  215. iGEM<-function(t, state, parms) {
  216. with(as.list(c(state, parms)), {
  217.  
  218. if(Uin<0) {Uin<-0}
  219. else {Uin<-Uin}
  220. if(Uout<0) {Uout<-0}
  221. else {Uout<-Uout}
  222. if(Uout==0) {P<-0}
  223. else {P<-P}
  224.  
  225. dR <- (a + b/(1 + exp(4 * c * (d - Uin)/b + 2)))-R
  226. dUin <- (e*(Uout-Uin))
  227. dUout <- (e*(Uin-Uout)-f*P)
  228. dP<-(g*R/(h+R)-i*P)
  229.  
  230. list(c(dR, dUin, dUout, dP))
  231. })
  232. }
  233.  
  234. library(deSolve)
  235.  
  236. times<-seq(0, 150, 0.1)
  237.  
  238. parms<-c(
  239. a=0.0001397,
  240. b=0.0434417,
  241. c=0.0222537,
  242. d=0.2392522,
  243. e=0.1,
  244. f=0.1,
  245. g=0.1,
  246. h=0.1,
  247. i=0.1)
  248.  
  249. state<-c(
  250. R=0.003464946,
  251. Uin=0,
  252. Uout=0,
  253. P=0)
  254. out0 <- ode(y = state, times = times, func = iGEM, parms = parms)
  255.  
  256. state<-c(
  257. R=0.003464946,
  258. Uin=0,
  259. Uout=5,
  260. P=0)
  261.  
  262. out1 <- ode(y = state, times = times, func = iGEM, parms = parms)
  263.  
  264. parms<-c(
  265. a=0.0001397,
  266. b=0.0434417,
  267. c=0.0222537,
  268. d=0.2392522,
  269. e=0.1,
  270. f=0.12,
  271. g=1,
  272. h=1,
  273. i=0.1)
  274. out2 <- ode(y = state, times = times, func = iGEM, parms = parms)
  275.  
  276. parms<-c(
  277. a=0.0001397,
  278. b=0.0434417,
  279. c=0.0222537,
  280. d=0.2392522,
  281. e=0.1,
  282. f=0.2,
  283. g=1,
  284. h=1,
  285. i=0.1)
  286. out3 <- ode(y = state, times = times, func = iGEM, parms = parms)
  287.  
  288. out<-rbind(out0, out1, out2, out3)
  289. plot(out, pch=\'.\')
');