From 822bd0b04d1cce54c2fff57c4b206c51d1dcb940 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 22 Apr 2014 22:01:56 -0400 Subject: rename notes -> lectures --- lectures/lec01_intro | 17 +++++++++++++++ lectures/lec02_matlab1 | 24 +++++++++++++++++++++ lectures/lec03_matlab2 | 14 +++++++++++++ lectures/lec04_matlab3 | 26 +++++++++++++++++++++++ lectures/lec05_matlab4 | 2 ++ lectures/lec06_intro1 | 44 +++++++++++++++++++++++++++++++++++++++ lectures/lec07_intro2_eulers | 46 +++++++++++++++++++++++++++++++++++++++++ lectures/lec08_intro3 | 11 ++++++++++ lectures/lec09_intro4_stability | 22 ++++++++++++++++++++ notes/lec01_intro | 17 --------------- notes/lec02_matlab1 | 24 --------------------- notes/lec03_matlab2 | 14 ------------- notes/lec04_matlab3 | 26 ----------------------- notes/lec05_matlab4 | 2 -- notes/lec06_intro1 | 44 --------------------------------------- notes/lec07_intro2_eulers | 46 ----------------------------------------- notes/lec08_intro3 | 11 ---------- notes/lec09_intro4_stability | 22 -------------------- 18 files changed, 206 insertions(+), 206 deletions(-) create mode 100644 lectures/lec01_intro create mode 100644 lectures/lec02_matlab1 create mode 100644 lectures/lec03_matlab2 create mode 100644 lectures/lec04_matlab3 create mode 100644 lectures/lec05_matlab4 create mode 100644 lectures/lec06_intro1 create mode 100644 lectures/lec07_intro2_eulers create mode 100644 lectures/lec08_intro3 create mode 100644 lectures/lec09_intro4_stability delete mode 100644 notes/lec01_intro delete mode 100644 notes/lec02_matlab1 delete mode 100644 notes/lec03_matlab2 delete mode 100644 notes/lec04_matlab3 delete mode 100644 notes/lec05_matlab4 delete mode 100644 notes/lec06_intro1 delete mode 100644 notes/lec07_intro2_eulers delete mode 100644 notes/lec08_intro3 delete mode 100644 notes/lec09_intro4_stability diff --git a/lectures/lec01_intro b/lectures/lec01_intro new file mode 100644 index 0000000..7785b73 --- /dev/null +++ b/lectures/lec01_intro @@ -0,0 +1,17 @@ + +top down approach: + start with data, do stats, make predictions + see also Ma'ayan coursera course, "Network Analysis in Systems Bio" + +bottom up approach: + start with a model, run simulations to make predictions + scope: ODE, dynamics + beyond: parameter estimations, PDE, stochastics + +7 weeks, 25 lectures, 20 minutes each, 3-4 a week +questions at the end of lectures, "just for self" +5x homework assignments, required + +will discuss neuron firing a bit + +impression: will be very motivated diff --git a/lectures/lec02_matlab1 b/lectures/lec02_matlab1 new file mode 100644 index 0000000..53a8ac3 --- /dev/null +++ b/lectures/lec02_matlab1 @@ -0,0 +1,24 @@ + +'format compact' => less syntax + +self assess: + C) 13x4 + E) vertcat; different columns + +### julia notes: + +built-in types seem to default to just an array instead of, eg, 3x1 or 1x3. + +can transform with "'"; A'' != A? + +to vert/horiz cat, need to explicitly + +julia> size([1,2,3]) +(3,) + +julia> size([1,2,3]') +(1,3) + +julia> size([1,2,3]'') +(3,1) + diff --git a/lectures/lec03_matlab2 b/lectures/lec03_matlab2 new file mode 100644 index 0000000..0d5b19a --- /dev/null +++ b/lectures/lec03_matlab2 @@ -0,0 +1,14 @@ + +### julia notes + +for plotting, 'winston' is simple and matlab-like + 'gadfly' is nice/correct, using design paradigms + 'pyplot' is matplotlib + +for this class, at least to start, i'm going to try winston. + +Pkg.add("Winston") +using Winston +plot( cumsum(randn(1000)) ) + +in winston, fplot() is nice for plotting functions over ranges diff --git a/lectures/lec04_matlab3 b/lectures/lec04_matlab3 new file mode 100644 index 0000000..5388d38 --- /dev/null +++ b/lectures/lec04_matlab3 @@ -0,0 +1,26 @@ + + +mean() +std() +exp(x) -> e^x + + + +### julia notes + +ref: http://julia.readthedocs.org/en/latest/manual/noteworthy-differences/ +ref: http://sveme.org/julia-for-matlab-users-i.html + +use maximum() instead of max(). +doesn't return multiple values like matlab. use 'findmax' instead. + +anonymous function syntax: + + find(x-> x > 2, [1,2,3,4,5]) + +unpack using parens (tuples?), not brackets + +writedlm, readdlm instead of dlmwrite, dlmread +read/write instead of save/load? + +some built-ins like {sum, prod, max} are deep, not shallow like in matlab. diff --git a/lectures/lec05_matlab4 b/lectures/lec05_matlab4 new file mode 100644 index 0000000..7c5af12 --- /dev/null +++ b/lectures/lec05_matlab4 @@ -0,0 +1,2 @@ + +matlab has globals! diff --git a/lectures/lec06_intro1 b/lectures/lec06_intro1 new file mode 100644 index 0000000..97b2f39 --- /dev/null +++ b/lectures/lec06_intro1 @@ -0,0 +1,44 @@ + +Background: + +Ligands are little molecules (which could be proteins or chemicals or whatever) +which bind to a larger biomolecule (eg, a protein or DNA) called the receptor. +"Receptor/ligand" binding affinity refers to how strongly different ligands +want to attach to different receptors. Both binding (association) and +un-binding (dissociation) is happening all the time, so you get a (dynamic, or +possibly steady state) distribution of binding probability. + +ref: https://en.wikipedia.org/wiki/Ligand_(biochemistry) + +ODEs (ordinary differential equations) are those involving only a single +independent variable; eg, solving for x in terms of t, only having derivatives +dx/dt, (d^2 x / d x^2), etc. the order of the ODE is the highest order of +derivative. + +PDEs (partial differential equations) are those involving multiple independent +variables, and thus partial derivatives. Eg, x in terms of t and r, having +derivatives del x / del t, del x / del r, and del^2 x / (del t * del r). + +ref: https://en.wikipedia.org/wiki/Differential_equation#Ordinary_and_partial +--------- + +Law of mass action: rate of a reaction involving two quantities is proportional +to the product of the densities of both. + +Michaelis-Menten: approximation to solution of enzyme-catalyzed reaction +equation: + + d [S] / dt = (max reaction rate) * [S] / (Km + [S]) + + [S] is concentration of substrate S + Km is Michaelis constant, which is a specific substrate concentration + + (max reaction rate) =~ k_2 [E]_total + Km =~ (k_-1 + k_2) / (k_1) + + all assuming that enzyme E catalizes S into P with rates k_n: + + -> k_1 + [E] + [S] [ES] -> k_2 [E] + [P] + <- k_-1 + diff --git a/lectures/lec07_intro2_eulers b/lectures/lec07_intro2_eulers new file mode 100644 index 0000000..17630d2 --- /dev/null +++ b/lectures/lec07_intro2_eulers @@ -0,0 +1,46 @@ + +euler's method: + +dx/dt =~ ( x(t + Dt) - x(t) ) / Dt, for very small Dt + +so, x(t + Dt) = x(t) + f(x) * Dt, which is how to integrate the system + +"if Dt is too large, becomes highly unstable" (duh) + +scary MATLAB advice: +- watch out of totally crazy values (very high) +- non-negative values go negative + +MATLAB built-in ODE solvers: ode23, ode15s + +runge-kutta (use dxdt from between t_n and t_(n+1) ) +variable time-step methods + +summary: Euler's method sucks, news at 11. + +### misc julia notes + +the only place to find history (?!?!!) is in ~/.julia_history + +### codes + +using Winston + +a=20 +b=2 +c=5 +dt = 0.05 +tlast = 2 + +iterations = int( round(tlast/dt) ) +xall = zeros(iterations, 1) +x = c + +for i = 1:iterations + xall[i] = x + dxdt = a - b*x + x = x + dxdt*dt +end + +time = dt * [0:iterations-1]' +plot(time,xall) diff --git a/lectures/lec08_intro3 b/lectures/lec08_intro3 new file mode 100644 index 0000000..81bcae4 --- /dev/null +++ b/lectures/lec08_intro3 @@ -0,0 +1,11 @@ + +One method for determining stability of a system: + + plot derivative of value (eg, energy?) as a function of the value itself. + +Another: 2D phase plane analysis + + "stable limit cycle" + "stable fixed point" + +Short lecture, just old concepts. diff --git a/lectures/lec09_intro4_stability b/lectures/lec09_intro4_stability new file mode 100644 index 0000000..3462764 --- /dev/null +++ b/lectures/lec09_intro4_stability @@ -0,0 +1,22 @@ + +nullclines: set of points in phase space where one derivative is zero. + can often be derived analytically. + the intersections of nullclines are even more interesting; an intersection + in a 2-D phase space is a fixed point (equilibria) + +vectors in a vector field area point in the same direction (quadrant) until a +nullcline is crossed. the area is a "discrete region". + +"stable-limit cycle" is when there is a stable closed curve in phase space (as +oopposed to, eg, a fixed point) + +how to find if stable vs unstable? + +take the jacobian, and find the eigenvalues of the jacobian at the limit point. +if real parts are all positive, then unstable. if all negative, then stable. if +complex eigenvalues have positive real parts, then there is a stable limit +cycle. + +the 'bier_stability.m' script calculates eigenvalues numerically. + +PROJECT: re-write this script in julia diff --git a/notes/lec01_intro b/notes/lec01_intro deleted file mode 100644 index 7785b73..0000000 --- a/notes/lec01_intro +++ /dev/null @@ -1,17 +0,0 @@ - -top down approach: - start with data, do stats, make predictions - see also Ma'ayan coursera course, "Network Analysis in Systems Bio" - -bottom up approach: - start with a model, run simulations to make predictions - scope: ODE, dynamics - beyond: parameter estimations, PDE, stochastics - -7 weeks, 25 lectures, 20 minutes each, 3-4 a week -questions at the end of lectures, "just for self" -5x homework assignments, required - -will discuss neuron firing a bit - -impression: will be very motivated diff --git a/notes/lec02_matlab1 b/notes/lec02_matlab1 deleted file mode 100644 index 53a8ac3..0000000 --- a/notes/lec02_matlab1 +++ /dev/null @@ -1,24 +0,0 @@ - -'format compact' => less syntax - -self assess: - C) 13x4 - E) vertcat; different columns - -### julia notes: - -built-in types seem to default to just an array instead of, eg, 3x1 or 1x3. - -can transform with "'"; A'' != A? - -to vert/horiz cat, need to explicitly - -julia> size([1,2,3]) -(3,) - -julia> size([1,2,3]') -(1,3) - -julia> size([1,2,3]'') -(3,1) - diff --git a/notes/lec03_matlab2 b/notes/lec03_matlab2 deleted file mode 100644 index 0d5b19a..0000000 --- a/notes/lec03_matlab2 +++ /dev/null @@ -1,14 +0,0 @@ - -### julia notes - -for plotting, 'winston' is simple and matlab-like - 'gadfly' is nice/correct, using design paradigms - 'pyplot' is matplotlib - -for this class, at least to start, i'm going to try winston. - -Pkg.add("Winston") -using Winston -plot( cumsum(randn(1000)) ) - -in winston, fplot() is nice for plotting functions over ranges diff --git a/notes/lec04_matlab3 b/notes/lec04_matlab3 deleted file mode 100644 index 5388d38..0000000 --- a/notes/lec04_matlab3 +++ /dev/null @@ -1,26 +0,0 @@ - - -mean() -std() -exp(x) -> e^x - - - -### julia notes - -ref: http://julia.readthedocs.org/en/latest/manual/noteworthy-differences/ -ref: http://sveme.org/julia-for-matlab-users-i.html - -use maximum() instead of max(). -doesn't return multiple values like matlab. use 'findmax' instead. - -anonymous function syntax: - - find(x-> x > 2, [1,2,3,4,5]) - -unpack using parens (tuples?), not brackets - -writedlm, readdlm instead of dlmwrite, dlmread -read/write instead of save/load? - -some built-ins like {sum, prod, max} are deep, not shallow like in matlab. diff --git a/notes/lec05_matlab4 b/notes/lec05_matlab4 deleted file mode 100644 index 7c5af12..0000000 --- a/notes/lec05_matlab4 +++ /dev/null @@ -1,2 +0,0 @@ - -matlab has globals! diff --git a/notes/lec06_intro1 b/notes/lec06_intro1 deleted file mode 100644 index 97b2f39..0000000 --- a/notes/lec06_intro1 +++ /dev/null @@ -1,44 +0,0 @@ - -Background: - -Ligands are little molecules (which could be proteins or chemicals or whatever) -which bind to a larger biomolecule (eg, a protein or DNA) called the receptor. -"Receptor/ligand" binding affinity refers to how strongly different ligands -want to attach to different receptors. Both binding (association) and -un-binding (dissociation) is happening all the time, so you get a (dynamic, or -possibly steady state) distribution of binding probability. - -ref: https://en.wikipedia.org/wiki/Ligand_(biochemistry) - -ODEs (ordinary differential equations) are those involving only a single -independent variable; eg, solving for x in terms of t, only having derivatives -dx/dt, (d^2 x / d x^2), etc. the order of the ODE is the highest order of -derivative. - -PDEs (partial differential equations) are those involving multiple independent -variables, and thus partial derivatives. Eg, x in terms of t and r, having -derivatives del x / del t, del x / del r, and del^2 x / (del t * del r). - -ref: https://en.wikipedia.org/wiki/Differential_equation#Ordinary_and_partial ---------- - -Law of mass action: rate of a reaction involving two quantities is proportional -to the product of the densities of both. - -Michaelis-Menten: approximation to solution of enzyme-catalyzed reaction -equation: - - d [S] / dt = (max reaction rate) * [S] / (Km + [S]) - - [S] is concentration of substrate S - Km is Michaelis constant, which is a specific substrate concentration - - (max reaction rate) =~ k_2 [E]_total - Km =~ (k_-1 + k_2) / (k_1) - - all assuming that enzyme E catalizes S into P with rates k_n: - - -> k_1 - [E] + [S] [ES] -> k_2 [E] + [P] - <- k_-1 - diff --git a/notes/lec07_intro2_eulers b/notes/lec07_intro2_eulers deleted file mode 100644 index 17630d2..0000000 --- a/notes/lec07_intro2_eulers +++ /dev/null @@ -1,46 +0,0 @@ - -euler's method: - -dx/dt =~ ( x(t + Dt) - x(t) ) / Dt, for very small Dt - -so, x(t + Dt) = x(t) + f(x) * Dt, which is how to integrate the system - -"if Dt is too large, becomes highly unstable" (duh) - -scary MATLAB advice: -- watch out of totally crazy values (very high) -- non-negative values go negative - -MATLAB built-in ODE solvers: ode23, ode15s - -runge-kutta (use dxdt from between t_n and t_(n+1) ) -variable time-step methods - -summary: Euler's method sucks, news at 11. - -### misc julia notes - -the only place to find history (?!?!!) is in ~/.julia_history - -### codes - -using Winston - -a=20 -b=2 -c=5 -dt = 0.05 -tlast = 2 - -iterations = int( round(tlast/dt) ) -xall = zeros(iterations, 1) -x = c - -for i = 1:iterations - xall[i] = x - dxdt = a - b*x - x = x + dxdt*dt -end - -time = dt * [0:iterations-1]' -plot(time,xall) diff --git a/notes/lec08_intro3 b/notes/lec08_intro3 deleted file mode 100644 index 81bcae4..0000000 --- a/notes/lec08_intro3 +++ /dev/null @@ -1,11 +0,0 @@ - -One method for determining stability of a system: - - plot derivative of value (eg, energy?) as a function of the value itself. - -Another: 2D phase plane analysis - - "stable limit cycle" - "stable fixed point" - -Short lecture, just old concepts. diff --git a/notes/lec09_intro4_stability b/notes/lec09_intro4_stability deleted file mode 100644 index 3462764..0000000 --- a/notes/lec09_intro4_stability +++ /dev/null @@ -1,22 +0,0 @@ - -nullclines: set of points in phase space where one derivative is zero. - can often be derived analytically. - the intersections of nullclines are even more interesting; an intersection - in a 2-D phase space is a fixed point (equilibria) - -vectors in a vector field area point in the same direction (quadrant) until a -nullcline is crossed. the area is a "discrete region". - -"stable-limit cycle" is when there is a stable closed curve in phase space (as -oopposed to, eg, a fixed point) - -how to find if stable vs unstable? - -take the jacobian, and find the eigenvalues of the jacobian at the limit point. -if real parts are all positive, then unstable. if all negative, then stable. if -complex eigenvalues have positive real parts, then there is a stable limit -cycle. - -the 'bier_stability.m' script calculates eigenvalues numerically. - -PROJECT: re-write this script in julia -- cgit v1.2.3