Skip to content

Commit eac345e

Browse files
committed
model desc
1 parent 70656b4 commit eac345e

File tree

6 files changed

+689
-267
lines changed

6 files changed

+689
-267
lines changed

docs/iso-effects.ipynb

Lines changed: 318 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,318 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "03f46b26",
6+
"metadata": {},
7+
"source": [
8+
"# Effects of isoproterenol"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": null,
14+
"id": "186be4a6",
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"using ModelingToolkit\n",
19+
"using OrdinaryDiffEq, SteadyStateDiffEq, DiffEqCallbacks\n",
20+
"using Plots\n",
21+
"using CSV\n",
22+
"using DataFrames\n",
23+
"using Dates\n",
24+
"using CaMKIIModel\n",
25+
"using CaMKIIModel: second, μM\n",
26+
"Plots.default(lw=1.5)"
27+
]
28+
},
29+
{
30+
"cell_type": "markdown",
31+
"id": "1dbd36d1",
32+
"metadata": {},
33+
"source": [
34+
"## Setup model"
35+
]
36+
},
37+
{
38+
"cell_type": "code",
39+
"execution_count": null,
40+
"id": "508feb7c",
41+
"metadata": {},
42+
"outputs": [],
43+
"source": [
44+
"sys = build_neonatal_ecc_sys(simplify=true, reduce_iso=true, reduce_camk=true)\n",
45+
"tend = 205second\n",
46+
"prob = ODEProblem(sys, [], tend)\n",
47+
"stimstart = 30second\n",
48+
"stimend = 120second\n",
49+
"alg = KenCarp47()"
50+
]
51+
},
52+
{
53+
"cell_type": "markdown",
54+
"id": "133cdc7a",
55+
"metadata": {},
56+
"source": [
57+
"## Without isoproterenol"
58+
]
59+
},
60+
{
61+
"cell_type": "code",
62+
"execution_count": null,
63+
"id": "a7751eaf",
64+
"metadata": {},
65+
"outputs": [],
66+
"source": [
67+
"@unpack Istim = sys\n",
68+
"callback = build_stim_callbacks(Istim, stimend; period=1second, starttime=stimstart)\n",
69+
"@time sol = solve(prob, alg; callback)"
70+
]
71+
},
72+
{
73+
"cell_type": "code",
74+
"execution_count": null,
75+
"id": "177fbe83",
76+
"metadata": {},
77+
"outputs": [],
78+
"source": [
79+
"i = (sys.t / 1000, sys.vm)\n",
80+
"plot(sol, idxs=i, tspan=(100second, 101second), title=\"Action potential\", xlabel=\"Time (s)\")"
81+
]
82+
},
83+
{
84+
"cell_type": "code",
85+
"execution_count": null,
86+
"id": "84300558",
87+
"metadata": {},
88+
"outputs": [],
89+
"source": [
90+
"plot(sol, idxs=(sys.t / 1000, [sys.Cai_sub_SR, sys.Cai_sub_SL, sys.Cai_mean]), tspan=(100second, 101second), title=\"Calcium transient\", xlabel=\"Time (s)\", ylabel=\"Conc. (μM)\", label=[\"Ca (SR)\" \"Ca (SL)\" \"Ca (avg)\"])"
91+
]
92+
},
93+
{
94+
"cell_type": "code",
95+
"execution_count": null,
96+
"id": "3d16357b",
97+
"metadata": {},
98+
"outputs": [],
99+
"source": [
100+
"plot(sol, idxs=(sys.t / 1000, sys.CaMKAct * 100), title=\"Active CaMKII\", label=false, ylabel=\"Active fraction (%)\", xlabel=\"Time (s)\")"
101+
]
102+
},
103+
{
104+
"cell_type": "markdown",
105+
"id": "ec7e598d",
106+
"metadata": {},
107+
"source": [
108+
"## 0.1uM isoproterenol"
109+
]
110+
},
111+
{
112+
"cell_type": "code",
113+
"execution_count": null,
114+
"id": "fade2254",
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"prob2 = remake(prob, p=[sys.ISO => 0.1μM])\n",
119+
"sol2 = solve(prob2, alg; callback)"
120+
]
121+
},
122+
{
123+
"cell_type": "code",
124+
"execution_count": null,
125+
"id": "ae649703",
126+
"metadata": {},
127+
"outputs": [],
128+
"source": [
129+
"plot(sol2, idxs=(sys.t / 1000, sys.vm), tspan=(100second, 101second), title=\"Action potential\", xlabel=\"Time (s)\")"
130+
]
131+
},
132+
{
133+
"cell_type": "code",
134+
"execution_count": null,
135+
"id": "07f5a634",
136+
"metadata": {},
137+
"outputs": [],
138+
"source": [
139+
"plot(sol2, idxs=(sys.t / 1000, [sys.Cai_sub_SR, sys.Cai_sub_SL, sys.Cai_mean]), tspan=(100second, 101second), title=\"Calcium transcient\", xlabel=\"Time (s)\", ylabel=\"Conc. (μM)\", label=[\"Ca (SR)\" \"Ca (SL)\" \"Ca (avg)\"])"
140+
]
141+
},
142+
{
143+
"cell_type": "code",
144+
"execution_count": null,
145+
"id": "d7cbf5a2",
146+
"metadata": {},
147+
"outputs": [],
148+
"source": [
149+
"plot(sol2, idxs=(sys.t / 1000, sys.CaMKAct * 100), title=\"Active CaMKII\", label=false, ylabel=\"Active fraction (%)\", xlabel=\"Time (s)\")"
150+
]
151+
},
152+
{
153+
"cell_type": "markdown",
154+
"id": "f9025666",
155+
"metadata": {},
156+
"source": [
157+
"## Comparison"
158+
]
159+
},
160+
{
161+
"cell_type": "code",
162+
"execution_count": null,
163+
"id": "eb144dd3",
164+
"metadata": {},
165+
"outputs": [],
166+
"source": [
167+
"i = (sys.t / 1000, sys.Cai_mean)\n",
168+
"tspan = (100second, 101second)\n",
169+
"plot(sol, idxs=i, title=\"Calcium transcient\", lab=\"ISO (-)\"; tspan)\n",
170+
"plot!(sol2, idxs=i, lab=\"ISO (0.1uM)\", xlabel=\"Time (s)\", ylabel=\"Concentration (μM)\"; tspan)"
171+
]
172+
},
173+
{
174+
"cell_type": "code",
175+
"execution_count": null,
176+
"id": "5d73e22b",
177+
"metadata": {},
178+
"outputs": [],
179+
"source": [
180+
"savefig(\"iso-caT.pdf\")"
181+
]
182+
},
183+
{
184+
"cell_type": "markdown",
185+
"id": "d82a623e",
186+
"metadata": {},
187+
"source": [
188+
"Maximal and minimal calcium concentrations in calcium transients."
189+
]
190+
},
191+
{
192+
"cell_type": "code",
193+
"execution_count": null,
194+
"id": "a867605f",
195+
"metadata": {},
196+
"outputs": [],
197+
"source": [
198+
"ca_ctl = sol(tspan[1]:1:tspan[2], idxs=sys.Cai_mean)\n",
199+
"println(extrema(ca_ctl))"
200+
]
201+
},
202+
{
203+
"cell_type": "code",
204+
"execution_count": null,
205+
"id": "331198b3",
206+
"metadata": {},
207+
"outputs": [],
208+
"source": [
209+
"ca_iso = sol2(tspan[1]:1:tspan[2], idxs=sys.Cai_mean)\n",
210+
"println(extrema(ca_iso))"
211+
]
212+
},
213+
{
214+
"cell_type": "code",
215+
"execution_count": null,
216+
"id": "31da0784",
217+
"metadata": {},
218+
"outputs": [],
219+
"source": [
220+
"i = (sys.t / 1000, sys.CaMKAct * 100)\n",
221+
"plot(sol, idxs=i, title=\"Active CaMKII\", lab=\"ISO (-)\")\n",
222+
"plot!(sol2, idxs=i, lab=\"ISO (0.1uM)\", ylabel=\"Active fraction (%)\", xlabel=\"Time (s)\")"
223+
]
224+
},
225+
{
226+
"cell_type": "code",
227+
"execution_count": null,
228+
"id": "765655b0",
229+
"metadata": {},
230+
"outputs": [],
231+
"source": [
232+
"savefig(\"iso-camkact.pdf\")"
233+
]
234+
},
235+
{
236+
"cell_type": "code",
237+
"execution_count": null,
238+
"id": "a4e81ca9",
239+
"metadata": {},
240+
"outputs": [],
241+
"source": [
242+
"i = (sys.t / 1000, sys.vm)\n",
243+
"tspan = (100second, 101second)\n",
244+
"plot(sol, idxs=i, title=\"Action potential\", lab=\"ISO (-)\"; tspan)\n",
245+
"plot!(sol2, idxs=i, lab=\"ISO (0.1uM)\", xlabel=\"Time (ms)\", ylabel=\"Voltage (mV)\"; tspan)"
246+
]
247+
},
248+
{
249+
"cell_type": "markdown",
250+
"id": "066cd384",
251+
"metadata": {},
252+
"source": [
253+
"## Experimental data"
254+
]
255+
},
256+
{
257+
"cell_type": "code",
258+
"execution_count": null,
259+
"id": "10748a73",
260+
"metadata": {},
261+
"outputs": [],
262+
"source": [
263+
"chemicaldf = CSV.read(joinpath(@__DIR__, \"data/CaMKAR-chemical.csv\"), DataFrame)\n",
264+
"ts = Dates.value.(chemicaldf[!, \"Time\"]) ./ 10^9\n",
265+
"ctl = chemicaldf[!, \"Ctrl Mean\"]\n",
266+
"ctl_error = chemicaldf[!, \"Ctrl SD\"] ./ sqrt.(chemicaldf[!, \"Ctrl N\"])"
267+
]
268+
},
269+
{
270+
"cell_type": "code",
271+
"execution_count": null,
272+
"id": "04073b8a",
273+
"metadata": {},
274+
"outputs": [],
275+
"source": [
276+
"iso = chemicaldf[!, \"isoproterenol 100nM Mean\"]\n",
277+
"iso_error = chemicaldf[!, \"isoproterenol 100nM SD\"] ./ sqrt.(chemicaldf[!, \"isoproterenol 100nM N\"])"
278+
]
279+
},
280+
{
281+
"cell_type": "code",
282+
"execution_count": null,
283+
"id": "5a02bb39",
284+
"metadata": {},
285+
"outputs": [],
286+
"source": [
287+
"plot(ts, ctl, yerr=ctl_error, lab=\"Control\", color=:blue, markerstrokecolor=:blue)\n",
288+
"plot!(ts, iso, yerr=iso_error, lab=\"ISO 100nM\", color=:red, markerstrokecolor=:red)\n",
289+
"plot!(xlabel=\"Time (sec.)\", ylabel=\"CaMKII activity (A.U.)\")\n"
290+
]
291+
},
292+
{
293+
"cell_type": "code",
294+
"execution_count": null,
295+
"id": "676c095e",
296+
"metadata": {},
297+
"outputs": [],
298+
"source": [
299+
"savefig(\"iso-exp.pdf\")"
300+
]
301+
}
302+
],
303+
"metadata": {
304+
"kernelspec": {
305+
"display_name": "Julia 1.12.2",
306+
"language": "julia",
307+
"name": "julia-1.12"
308+
},
309+
"language_info": {
310+
"file_extension": ".jl",
311+
"mimetype": "application/julia",
312+
"name": "julia",
313+
"version": "1.12.2"
314+
}
315+
},
316+
"nbformat": 4,
317+
"nbformat_minor": 5
318+
}

0 commit comments

Comments
 (0)