{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Final Project\n", "\n", "*Name(s):*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Recall the 7-state model of the mammalian circadian clock published by Becker-Weimann et al. (2004). The paper investigates the relative contributions of positive and negative feedback to oscillator performance. We will be using the model presented in this paper for our final investigation. \n", "\n", "Your goal is to demonstrate your mastery of the topics in this course by understanding and analyzing this model. Each question relates to one topic.\n", "\n", "## The Project\n", "\n", "
    \n", "
  1. Kinetics and Motifs: Describe the kinetics used in this model. Be detailed. Be sure to include a discussion of gates (i.e. AND or OR gates). What is the basic network motif used in this model?\n", "

    Opportunity for thoroughness: To answer the questions about AND/OR gates, make a heat map or surface plot like Uri Alon does in Figure 2.5 of his textbook chapter\n", "

  2. Model Simulation: Write code to simulate the model using the published parameters. Follow the same coding conventions used for previous projects. Simulate the model and recreate Figure 3A of the paper.\n", "
  3. Numerical Solvers: Using the %timeit magic code, compare the time it takes to simulate the model using RK23, RK45, DOP853, Radau, BDF, and LSODA (read the descriptions in the documentation for solve_ivp). Use a relative tolerance of $10^{-8}$, the default absolute tolerance, an end ``time'' of at least 2400 hours, and no t_eval parameter. RK23 is a low-order explicit solver, RK45 is a high-order explicit solver, DOP853 is an even higher order explicit solver, BDF is a variable-order implicit solver, Radau is a high-order implicit solver, and LSODA is an all-purpose solver (it makes lots of adjustments while solving the problem). \n", "
      \n", "
    1. Do your run-times makes sense given these descriptions? Explain your answer. \n", "
    2. Examine how many steps the solver took (sol.t.size). How do they relate to the run times?\n", "
    3. To answer the previous question, it is probably a good idea to re-run the timing with a relative tolerance of $10^{-3}$. This way, you can compare run-times and step counts based on tolerance.\n", "
    4. Is there a clear difference in runtimes between the explicit and implicit solvers? If the implicit solvers are faster, that implies the ODEs are stiff. You don't need to write about stiffness here, but I am mentioning it now because I briefly mentioned it when we talked about numerical solvers. Stiff systems are particularly difficult to solve with the kinds of (explicit) solvers we wrote. Is this system one of those?\n", "
    \n", "
  4. Sensitivity Analysis: Perform a sensitivity analysis of the model. You may decide what you want to find the sensitivity to (the period, the amplitude of a given state, the peak of a given state, etc.). Discuss any clear similarities or stark contrasts with the results from Leloup & Goldbeter's 2004 JTB paper.\n", "
\n", "\n", "## Extensions\n", "\n", "To receive a grade higher than a B+, you will want to include at least one extension. Here are a few possible extensions:\n", "\n", "\n", "\n", "### References\n", "\n", "S Becker-Weimann, J Wolf, H Herzel, and A Kramer, \"Modeling Feedback Loops of the Mammalian Circadian Oscillator\", *Biophys. J.*, 2004\n", "\n", "J Stelling, ED Gilles, and FJ Doyle III, \"Robustness properties of circadian clock architectures\", *Proc. Natl. Acad. Sci*, 2004\n", "\n", "J-C Leloup and A Goldbeter, \"Modeling the mammalian circadian clock: Sensitivity analysis and multiplicity of oscillatory mechanisms\", *J. theor. Biol.*, 2004.\n", "\n", "## Notes\n", "\n", "To time the solvers, use the magic command %timeit. If you are running it for lots of tolerances and lots of methods, then it will probably be helpful to store the timing results in variables. The documentation about this feature of timeit is rather sparse, but I figured out how to get it to work as long as the only code in the cell is the code that calls the solver. Then, the cell immediately following it should assign the variable. e.g.\n", "\n", "In the first cell\n", "\n", " %timeit -o sol = scipy.integrate.solve_ivp(fun=beckerWeimann_model, t_span=(0,10*24), y0=yinit, method='RK45', args=[params], rtol=1e-8 )\n", " \n", " \n", "and in the second cell, do the assignent from the special variable \\_. Below, I show the code and then include print statements that will guide you in your understanding of that variable.\n", "\n", "rk45_time = _ \n", "print( rk45_time )\n", "print( rk45_time.average )\n", "print( rk45_time.stdev ) \n", "\n", "\n", "Unfortunately, I am not sure how to have multiple calls in the same cell. But I think the variable is still useful if you have a different variable name for each call, the you can put them in a list in a later cell, so that you can plot them all together." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Start code and write-up here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "Acknowledgements\n", "\n", "*Replace this text with links to external resources and thanks to people you worked with.*" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }