|
17 | 17 | name='gfp', promoter='pconst', rbs='rbs_strong', protein='GFP' |
18 | 18 | ) |
19 | 19 |
|
20 | | -# Simulation parmaters |
| 20 | +# Simulation parameters |
21 | 21 | initial_conditions = {'dna_gfp': 1 * nM} |
22 | 22 | timepts = np.linspace(0, 6 * hrs, 1000) |
23 | 23 |
|
|
253 | 253 | # PURE mixtures |
254 | 254 | # |
255 | 255 |
|
| 256 | +pure_timepts = np.linspace(0, 180 * min) |
| 257 | + |
256 | 258 | simple_mixture = bcp.PURE( |
257 | 259 | name='simple', components=[gfp_dna, cfp_dna], |
258 | 260 | include_machinery=False, include_resources=False, include_fuel=False) |
259 | 261 | simple_crn = simple_mixture.compile_crn() |
260 | 262 | simple_res = simple_crn.simulate_with_bioscrape_via_sbml( |
261 | | - timepts, initial_condition_dict=cfp_initial_conditions |
| 263 | + pure_timepts, initial_condition_dict=cfp_initial_conditions |
262 | 264 | ) |
263 | 265 |
|
264 | 266 | machinery_mixture = bcp.PURE( |
265 | 267 | name='machinery', components=[gfp_dna, cfp_dna], |
266 | 268 | include_machinery=True, include_resources=False, include_fuel=False) |
267 | 269 | machinery_crn = machinery_mixture.compile_crn() |
268 | 270 | machinery_res = machinery_crn.simulate_with_bioscrape_via_sbml( |
269 | | - timepts, initial_condition_dict=cfp_initial_conditions |
| 271 | + pure_timepts, initial_condition_dict=cfp_initial_conditions |
270 | 272 | ) |
271 | 273 |
|
272 | 274 | resource_mixture = bcp.PURE( |
273 | 275 | name='resources', components=[gfp_dna, cfp_dna], |
274 | 276 | include_machinery=True, include_resources=True, include_fuel=False) |
275 | 277 | resource_crn = resource_mixture.compile_crn() |
276 | 278 | resource_res = resource_crn.simulate_with_bioscrape_via_sbml( |
277 | | - timepts, initial_condition_dict=cfp_initial_conditions |
| 279 | + pure_timepts, initial_condition_dict=cfp_initial_conditions |
278 | 280 | ) |
279 | 281 |
|
280 | 282 | energy_mixture = bcp.PURE( |
281 | 283 | name='energy', components=[gfp_dna, cfp_dna], |
282 | 284 | include_machinery=True, include_resources=True, include_fuel=True) |
283 | 285 | energy_crn = energy_mixture.compile_crn() |
284 | 286 | energy_res = energy_crn.simulate_with_bioscrape_via_sbml( |
285 | | - timepts, initial_condition_dict=cfp_initial_conditions |
| 287 | + pure_timepts, initial_condition_dict=cfp_initial_conditions |
286 | 288 | ) |
287 | 289 |
|
288 | 290 | energy_mixture_gfp = bcp.PURE( |
289 | 291 | name='energy', components=[gfp_dna], |
290 | 292 | include_machinery=True, include_resources=True, include_fuel=True) |
291 | 293 | energy_crn_gfp = energy_mixture_gfp.compile_crn() |
292 | 294 | energy_res_gfp = energy_crn_gfp.simulate_with_bioscrape_via_sbml( |
293 | | - timepts, initial_condition_dict=initial_conditions |
| 295 | + pure_timepts, initial_condition_dict=initial_conditions |
294 | 296 | ) |
295 | 297 |
|
296 | 298 | plt.figure(6) |
297 | 299 | plt.clf() |
298 | 300 |
|
299 | 301 | plt.plot( |
300 | | - timepts / min, simple_res['protein_GFP'] / uM, |
| 302 | + pure_timepts / min, simple_res['protein_GFP'] / uM, |
301 | 303 | label='GFP+CFP, simple') |
302 | 304 | plt.plot( |
303 | | - timepts / min, machinery_res['protein_GFP'] / uM, |
| 305 | + pure_timepts / min, machinery_res['protein_GFP'] / uM, |
304 | 306 | label='GFP+CFP, machinery') |
305 | 307 | plt.plot( |
306 | | - timepts / min, resource_res['protein_GFP'] / uM, |
| 308 | + pure_timepts / min, resource_res['protein_GFP'] / uM, |
307 | 309 | label='GFP+CFP, resources') |
308 | 310 | plt.plot( |
309 | | - timepts / min, energy_res['protein_GFP'] / uM, |
| 311 | + pure_timepts / min, energy_res['protein_GFP'] / uM, |
310 | 312 | label='GFP+CFP, energy') |
311 | 313 | plt.plot( |
312 | | - timepts / min, energy_res_gfp['protein_GFP'] / uM, |
| 314 | + pure_timepts / min, energy_res_gfp['protein_GFP'] / uM, |
313 | 315 | label='GFP only, energy') |
314 | 316 | plt.plot( |
315 | | - timepts / min, pure_res['protein_GFP'] + 0.1 / uM, '--', |
| 317 | + timepts[0:50] / min, pure_res['protein_GFP'][0:50] + 0.1 / uM, '--', |
316 | 318 | label='GFP only + 0.1, basic') |
317 | 319 |
|
318 | 320 | plt.ylim([0, 12]) |
|
321 | 323 | plt.xlabel("Time [min]") |
322 | 324 | plt.ylabel("Concentration [uM]") |
323 | 325 | plt.legend() |
| 326 | + |
| 327 | +# |
| 328 | +# Activators and repressors |
| 329 | +# |
| 330 | + |
| 331 | +TetR = bcp.Protein('TetR') |
| 332 | +aTc = bcp.Species('aTc') |
| 333 | +TetR_inactive = bcp.ChemicalComplex( |
| 334 | + [TetR.species, aTc], mechanisms={'binding': bcp.One_Step_Binding()} |
| 335 | +) |
| 336 | +ptet_repressed = bcp.RepressiblePromoter('ptet', TetR) |
| 337 | +dna_GFP_repressed = bcp.DNAassembly( |
| 338 | + 'GFP', promoter=ptet_repressed, rbs='RBS', protein='GFP', length=714 |
| 339 | +) |
| 340 | + |
| 341 | +initial_conditions = {'dna_GFP': 1 * nM, 'protein_TetR': 30 * uM} |
| 342 | +repressed_mixture = bcp.PURE( |
| 343 | + name='repressed', |
| 344 | + components=[dna_GFP_repressed, TetR_inactive], |
| 345 | + include_machinery=True, |
| 346 | + include_resources=True, |
| 347 | + include_fuel=True, |
| 348 | +) |
| 349 | +repressed_crn = repressed_mixture.compile_crn() |
| 350 | + |
| 351 | +TetR = bcp.Protein('TetR') |
| 352 | +aTc = bcp.Species('aTc') |
| 353 | +TetR_inactive = bcp.ChemicalComplex( |
| 354 | + [TetR.species, aTc], mechanisms={'binding': bcp.One_Step_Binding()} |
| 355 | +) |
| 356 | +ptet_regulated = bcp.RegulatedPromoter('ptet', TetR) |
| 357 | +dna_GFP_regulated = bcp.DNAassembly( |
| 358 | + 'GFP', promoter=ptet_regulated, rbs='RBS', protein='GFP' |
| 359 | +) |
| 360 | +regulated_parameters = { |
| 361 | + ('transcription', 'ptet_leak', 'ktx'): 50, # unbound |
| 362 | + ('transcription', 'ptet_TetR', 'ktx'): 0.001, # bound |
| 363 | +} |
| 364 | + |
| 365 | +regulated_mixture = bcp.PURE( |
| 366 | + name='regulated', |
| 367 | + components=[dna_GFP_regulated, TetR_inactive], |
| 368 | + include_machinery=True, |
| 369 | + include_resources=True, |
| 370 | + include_fuel=True, |
| 371 | + parameters=regulated_parameters, |
| 372 | +) |
| 373 | +regulated_crn = regulated_mixture.compile_crn() |
| 374 | + |
| 375 | +plt.figure(7) |
| 376 | +plt.clf() |
| 377 | + |
| 378 | +offset = -0.01 |
| 379 | +TetR_0 = initial_conditions['protein_TetR'] |
| 380 | +for aTc_0 in np.linspace(0, 50*uM, 5): |
| 381 | +# aTc_0 = 0 |
| 382 | +# for TetR_0 in np.linspace(0, 20*uM, 5): |
| 383 | + repressed_res = repressed_crn.simulate_with_bioscrape_via_sbml( |
| 384 | + pure_timepts, initial_condition_dict=initial_conditions |
| 385 | + | {'aTc': aTc_0} | {'protein_TetR': TetR_0} |
| 386 | + ) |
| 387 | + lines = plt.plot( |
| 388 | + pure_timepts / min, |
| 389 | + repressed_res['protein_GFP'] / uM + offset, |
| 390 | + label=f"aTc={aTc_0 / uM} uM, TetR={TetR_0 / uM} uM", |
| 391 | + ) |
| 392 | + |
| 393 | + regulated_res = regulated_crn.simulate_with_bioscrape_via_sbml( |
| 394 | + pure_timepts, initial_condition_dict=initial_conditions |
| 395 | + | {'aTc': aTc_0} | {'protein_TetR': TetR_0} |
| 396 | + ) |
| 397 | + plt.plot( |
| 398 | + pure_timepts / min, |
| 399 | + regulated_res['protein_GFP'] / uM + offset, |
| 400 | + color=lines[0].get_color(), |
| 401 | + linestyle='--', |
| 402 | + ) |
| 403 | + |
| 404 | + offset += 0.05 |
| 405 | + |
| 406 | +plt.title("Represssed (-) versus Regulated (--)") |
| 407 | +plt.xlabel("Time [min]") |
| 408 | +plt.ylabel("Concentration [uM]") |
| 409 | +plt.legend() |
| 410 | + |
| 411 | +# |
| 412 | +# PURE debugging |
| 413 | +# |
| 414 | + |
| 415 | +repressed_res = repressed_crn.simulate_with_bioscrape_via_sbml( |
| 416 | + pure_timepts, initial_condition_dict=initial_conditions |
| 417 | + | {'aTc': 37.5 * uM} | {'protein_TetR': 30 * uM} |
| 418 | +) |
| 419 | + |
| 420 | +plt.figure(8) |
| 421 | +plt.clf() |
| 422 | +bcp.plot_gene_expression_data( |
| 423 | + repressed_res, repressed_crn, dna_GFP_repressed, |
| 424 | + trace_offset=[0.01, 0.002, 0.1, 0.1]) |
| 425 | +plt.suptitle("Gene expression, repressed", fontsize='large') |
| 426 | +plt.tight_layout() |
| 427 | + |
| 428 | +regulated_res = regulated_crn.simulate_with_bioscrape_via_sbml( |
| 429 | + pure_timepts, initial_condition_dict=initial_conditions |
| 430 | + | {'aTc': 37.5 * uM} | {'protein_TetR': 30 * uM} |
| 431 | +) |
| 432 | + |
| 433 | +plt.figure(9) |
| 434 | +plt.clf() |
| 435 | +bcp.plot_gene_expression_data( |
| 436 | + regulated_res, regulated_crn, dna_GFP_regulated, |
| 437 | + trace_offset=[0.01, 0.002, 0.1, 0.1]) |
| 438 | +plt.suptitle("Gene expression, regulated", fontsize='large') |
| 439 | +plt.tight_layout() |
0 commit comments