1 | ;; |
---|
2 | ;; |
---|
3 | ;; nemo documentation for the Chicken Scheme module system. |
---|
4 | ;; |
---|
5 | ;; |
---|
6 | ;; This program is free software: you can redistribute it and/or |
---|
7 | ;; modify it under the terms of the GNU General Public License as |
---|
8 | ;; published by the Free Software Foundation, either version 3 of the |
---|
9 | ;; License, or (at your option) any later version. |
---|
10 | ;; |
---|
11 | ;; This program is distributed in the hope that it will be useful, but |
---|
12 | ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | ;; General Public License for more details. |
---|
15 | ;; |
---|
16 | ;; A full copy of the GPL license can be found at |
---|
17 | ;; <http://www.gnu.org/licenses/>. |
---|
18 | ;; |
---|
19 | ;; |
---|
20 | |
---|
21 | |
---|
22 | (use eggdoc srfi-1) |
---|
23 | |
---|
24 | (define doc |
---|
25 | `((eggdoc:begin |
---|
26 | |
---|
27 | (name "nemo") |
---|
28 | |
---|
29 | (description "Neuron model description language.") |
---|
30 | |
---|
31 | (author (url "http://chicken.wiki.br/ivan raikov" "Ivan Raikov")) |
---|
32 | |
---|
33 | (history |
---|
34 | (version "1.8" "Bug fixes related to kinetic equation processing") |
---|
35 | (version "1.6" "Added infix expression parser (nemo format)") |
---|
36 | (version "1.0" "Initial release")) |
---|
37 | |
---|
38 | |
---|
39 | (requires (url "args.html" "args") |
---|
40 | (url "datatype.html" "datatype") |
---|
41 | (url "digraph.html" "digraph") |
---|
42 | (url "environments.html" "environments") |
---|
43 | (url "graph-bfs.html" "graph-bfs") |
---|
44 | (url "graph-cycles.html" "graph-cycles") |
---|
45 | (url "lalr.html" "lalr") |
---|
46 | (url "matchable.html" "matchable") |
---|
47 | (url "mathh.html" "mathh") |
---|
48 | (url "strictly-pretty.html" "strictly-pretty") |
---|
49 | (url "sxml-tools.html" "sxml-tools") |
---|
50 | (url "sxml-transforms.html" "sxml-transforms") |
---|
51 | (url "syntax-case.html" "syntax-case") |
---|
52 | (url "varsubst.html" "varsubst") |
---|
53 | (url "vector-lib.html" "vector-lib") |
---|
54 | (url "varsubst.html" "varsubst") |
---|
55 | ) |
---|
56 | |
---|
57 | |
---|
58 | (usage "nemo [options...] [input files ...]") |
---|
59 | (download "nemo.egg") |
---|
60 | |
---|
61 | (documentation |
---|
62 | |
---|
63 | (p (tt "NEMO") " is a program that reads an on channel description " |
---|
64 | "in a format based on ChannelML and generates a corresponding description " |
---|
65 | "in the " (url "http://www.neuron.yale.edu/neuron/docs/help/neuron/nmodl/nmodl.html" "NMODL") |
---|
66 | "language used by the " (url "http://www.neuron.yale.edu/neuron/" "NEURON simulator") ". ") |
---|
67 | |
---|
68 | (subsection "Options" |
---|
69 | (p (symbol-table |
---|
70 | (describe "-i FORMAT" "specify input format (nemo, xml, sxml, s-exp)") |
---|
71 | (describe "--xml[=FILE]" "write XML output to file (default: <model-name>.xml") |
---|
72 | (describe "--sxml[=FILE]" "write SXML output to file (default: <model-name>.sxml") |
---|
73 | (describe "--nmodl[=FILE]" "write NMODL output to file (default: <model-name>.mod") |
---|
74 | (describe "--nmodl-method=METHOD" "specify NMODL integration method (cnexp, derivimplicit)") |
---|
75 | (describe "--nmodl-kinetic=[STATES]" ("use NMODL kinetic equations for the given state complexes " |
---|
76 | "(or for all state complexes)")) |
---|
77 | (describe "-t" "use interpolation tables in generated code") |
---|
78 | (describe "-h, --help" "print help")))) |
---|
79 | |
---|
80 | (subsection "Model description language" |
---|
81 | (p "The following constructs comprise the model description language: ") |
---|
82 | (p (ebnf-def "MODEL" |
---|
83 | (ebnf-choice |
---|
84 | ( (ebnf-form (ebnf-kw "INPUT ") |
---|
85 | (ebnf-choice (ebnf-var "ID") |
---|
86 | (ebnf-form (ebnf-var "ID") (ebnf-opt (ebnf-kw "AS ") (ebnf-var "LOCAL-ID")) |
---|
87 | (ebnf-opt (ebnf-kw "FROM ") (ebnf-var "NAMESPACE")))) |
---|
88 | "... )") |
---|
89 | (comment "Declares one or several imported quantities. " |
---|
90 | "If the optional " (ebnf-kw "AS") " parameter is given, " |
---|
91 | "then the quantity is imported as " (ebnf-var "LOCAL-ID") ". " |
---|
92 | "If the optional " (ebnf-kw "FROM") " parameter is given, " |
---|
93 | "then the quantity is imported from namespace " (ebnf-var "NAMESPACE") ". ")) |
---|
94 | |
---|
95 | ( (ebnf-form (ebnf-kw "OUTPUT") (ebnf-var "ID") ) |
---|
96 | (comment "Declares that an existing quantity be exported.")) |
---|
97 | |
---|
98 | ( (ebnf-form (ebnf-kw "CONST") (ebnf-var "ID") "=" (ebnf-var "EXPR")) |
---|
99 | (comment "Declares a constant quantity (its value will be computed at declaration time).")) |
---|
100 | |
---|
101 | ( (ebnf-form (ebnf-kw "DEFUN") (ebnf-var "ID") (ebnf-form (ebnf-var "ARG-ID") "..." ) |
---|
102 | (ebnf-var "EXPR")) |
---|
103 | (comment "Declares a function (a parameterized expression with no free variables).")) |
---|
104 | |
---|
105 | ( (ebnf-form (ebnf-var "ID") "=" (ebnf-var "EXPR")) |
---|
106 | (comment "Declares an assigned quantity " |
---|
107 | "(an expression that can refer to other quantities in the system).")) |
---|
108 | |
---|
109 | ( (ebnf-form (ebnf-kw "STATE-COMPLEX") (ebnf-var "ID") (ebnf-var "TRANSITIONS") |
---|
110 | (ebnf-var "INITIAL-EXPR") (ebnf-var "OPEN-ID")) |
---|
111 | (p "Declares a state complex quantity. See below for the syntax of state transition equations. " |
---|
112 | (ebnf-var "INITIAL-EXPR") " is an expression that computes the initial value. " |
---|
113 | (ebnf-var "OPEN-ID") " is the name of the open state. It must be one of the states " |
---|
114 | "defined by the transition equations. ")) |
---|
115 | |
---|
116 | ( (ebnf-form (ebnf-kw "COMPONENT") |
---|
117 | (ebnf-form (ebnf-kw "TYPE") (ebnf-var "ID")) |
---|
118 | (ebnf-form (ebnf-kw "NAME") (ebnf-var "ID")) |
---|
119 | (ebnf-var "ELEMENTS")) |
---|
120 | (p "Declares a system component (a quantity that can contain other quantities).")) |
---|
121 | ))) |
---|
122 | |
---|
123 | (subsubsection "Expressions" |
---|
124 | (p "Expressions in the model description language are defined as: ") |
---|
125 | (p (ebnf-def "EXPR" |
---|
126 | (ebnf-choice |
---|
127 | ( (ebnf-var "NUM") |
---|
128 | (comment "A numeric constant.")) |
---|
129 | ( (ebnf-var "ID") |
---|
130 | (comment "A variable name.")) |
---|
131 | ( (ebnf-form (ebnf-var "ID") (ebnf-form (ebnf-var "EXPR") "...")) |
---|
132 | (comment "A function invocation.")) |
---|
133 | ( (ebnf-form (ebnf-var "EXPR") (ebnf-var "OP") (ebnf-var "EXPR") ) |
---|
134 | (comment "Arithmetic operator invocation. The following operators are supported: " |
---|
135 | (tt "+ - / * > < <= >= ^"))) |
---|
136 | ( (ebnf-form (ebnf-kw "LET") (ebnf-form (ebnf-var "BINDINGS")) (ebnf-var "EXPR") ) |
---|
137 | (comment "Local variables declaration. Each element in " |
---|
138 | (ebnf-var "BINDINGS") " is of the form: " |
---|
139 | (ebnf-form (ebnf-var "ID") (ebnf-var "EXPR")))) |
---|
140 | ( (ebnf-form (ebnf-kw "IF") (ebnf-var "CONDITION") |
---|
141 | (ebnf-kw "THEN") (ebnf-var "EXPR") |
---|
142 | (ebnf-kw "ELSE") (ebnf-var "EXPR") ) |
---|
143 | (comment "Conditional expression. The expression after " (ebnf-kw "IF") |
---|
144 | " must be a comparison expression. "))) |
---|
145 | ))) |
---|
146 | |
---|
147 | (subsubsection "State transition equations" |
---|
148 | (p "State transition equations in the model description language are defined as: ") |
---|
149 | (p (ebnf-def "TRANSITION" |
---|
150 | (ebnf-choice |
---|
151 | ( (ebnf-form (ebnf-kw "->") (ebnf-var "SRC-ID") (ebnf-var "DEST-ID") |
---|
152 | (ebnf-var "EXPR") ) |
---|
153 | (comment "Declares that a transition occurs from state " |
---|
154 | (ebnf-var "SRC-ID") " to state " (ebnf-var "DEST-ID") |
---|
155 | " at rate computed by " (ebnf-var "EXPR") ". ")) |
---|
156 | ( (ebnf-form (ebnf-kw "<->") (ebnf-var "SRC-ID") (ebnf-var "DEST-ID") |
---|
157 | (ebnf-var "EXPR-1") (ebnf-var "EXPR-2") ) |
---|
158 | (comment "Declares that a transition occurs from state " |
---|
159 | (ebnf-var "SRC-ID") " to state " (ebnf-var "DEST-ID") |
---|
160 | " and vice versa, at rates computed by " (ebnf-var "EXPR-1") |
---|
161 | " and " (ebnf-var "EXPR-2") ". ")) |
---|
162 | )))) |
---|
163 | |
---|
164 | (subsubsection "Ion channel definitions" |
---|
165 | (p "Currently, the " (tt "NMODL") " code generator recognizes and generates code for " |
---|
166 | "ion channel components that are defined as follows: ") |
---|
167 | (p (ebnf-form (ebnf-compound "COMPONENT (TYPE ion-channel) (NAME {NAME})" |
---|
168 | |
---|
169 | ( (ebnf-form (ebnf-kw "COMPONENT") (ebnf-form (ebnf-kw "TYPE") "gate") "..." ) |
---|
170 | (comment "One or more gate definitions. Each component of type gate " |
---|
171 | "must export the state complexes that characterize the gate dynamics. ")) |
---|
172 | |
---|
173 | ( (ebnf-form (ebnf-kw "COMPONENT") |
---|
174 | (ebnf-form (ebnf-kw "TYPE") "pore") "...") |
---|
175 | (comment "Conductance law definition. This component must export a " |
---|
176 | "constant maximal conductance, or an assigned quantity whose " |
---|
177 | "equation represents the conductance law used. ")) |
---|
178 | |
---|
179 | ( (ebnf-opt (ebnf-form (ebnf-kw "COMPONENT") (ebnf-form (ebnf-kw "TYPE") "permeating-substance") "...")) |
---|
180 | (comment "")) |
---|
181 | |
---|
182 | ( (ebnf-opt (ebnf-form (ebnf-kw "COMPONENT") (ebnf-form (ebnf-kw "TYPE") "accumulating-substance") "...")) |
---|
183 | (comment "")) |
---|
184 | |
---|
185 | )))) |
---|
186 | |
---|
187 | (subsubsection "Hodgkin-Huxley ionic conductance extension" |
---|
188 | (p "The Hodgkin-Huxley ionic conductance extension is a shortcut that declares " |
---|
189 | "a state transition complex corresponding to the Hodgkin-Huxley formulation " |
---|
190 | "of ion channel dynamics. ") |
---|
191 | |
---|
192 | (p (ebnf-form (ebnf-compound "HH-IONIC-CONDUCTANCE" |
---|
193 | ( (ebnf-form (ebnf-var "ION-NAME" ) |
---|
194 | (comment "Ion name: exported variables will be of the form " (tt "{ion}_{id}") ". ") |
---|
195 | |
---|
196 | (ebnf-form (ebnf-kw "M-POWER") (ebnf-var "INTEGER") ) |
---|
197 | (comment "Power of state variable " (tt "M") ". " ) |
---|
198 | |
---|
199 | (ebnf-form (ebnf-kw "H-POWER") (ebnf-var "INTEGER") ) |
---|
200 | (comment "Power of state variable " (tt "H") ". If zero, the initial value and " |
---|
201 | "equations for this variable can be omitted. ") |
---|
202 | |
---|
203 | (ebnf-form (ebnf-kw "INITIAL-M") (ebnf-var "EXPR") ) |
---|
204 | (comment "Expression that computes initial value for state variable " (tt "M") ". " ) |
---|
205 | |
---|
206 | (ebnf-form (ebnf-kw "INITIAL-H") (ebnf-var "EXPR") ) |
---|
207 | (comment "Expression that computes initial value for state variable " (tt "H") ". " ) |
---|
208 | |
---|
209 | |
---|
210 | (ebnf-form (ebnf-kw "M-ALPHA") (ebnf-var "EXPR") ) |
---|
211 | (comment "Closed state to open state rate expression for state variable " (tt "M") ". " ) |
---|
212 | |
---|
213 | (ebnf-form (ebnf-kw "M-BETA") (ebnf-var "EXPR") ) |
---|
214 | (comment "Open state to closed state rate expression for state variable " (tt "M") ". " ) |
---|
215 | |
---|
216 | (ebnf-form (ebnf-kw "H-ALPHA") (ebnf-var "EXPR") ) |
---|
217 | (comment "Closed state to open state rate expression for state variable " (tt "H") ". " ) |
---|
218 | |
---|
219 | (ebnf-form (ebnf-kw "H-BETA") (ebnf-var "EXPR") ) |
---|
220 | (comment "Open state to closed state rate expression for state variable " (tt "H") ". " ) |
---|
221 | |
---|
222 | |
---|
223 | (ebnf-form (ebnf-kw "M-INF") (ebnf-var "EXPR") ) |
---|
224 | (comment "Steady state expression for variable " (tt "M") ". " ) |
---|
225 | |
---|
226 | (ebnf-form (ebnf-kw "M-TAU") (ebnf-var "EXPR") ) |
---|
227 | (comment "Time constant expression for variable " (tt "M") ". " ) |
---|
228 | |
---|
229 | (ebnf-form (ebnf-kw "H-INF") (ebnf-var "EXPR") ) |
---|
230 | (comment "Steady state expression for variable " (tt "H") ". " ) |
---|
231 | |
---|
232 | (ebnf-form (ebnf-kw "H-TAU") (ebnf-var "EXPR") ) |
---|
233 | (comment "Time constant expression for variable " (tt "H") ". " ) |
---|
234 | |
---|
235 | |
---|
236 | )) |
---|
237 | ))) |
---|
238 | ) |
---|
239 | |
---|
240 | ) |
---|
241 | |
---|
242 | ) |
---|
243 | (examples (pre #<<EOF |
---|
244 | |
---|
245 | ;; Akemann and Knoepfel, J.Neurosci. 26 (2006) 4602 |
---|
246 | |
---|
247 | (nemo-model PotIhCa |
---|
248 | |
---|
249 | ((input v cai cao) |
---|
250 | |
---|
251 | (const Vrest = -68) |
---|
252 | (const diam = 20) |
---|
253 | (const celsius = 24) |
---|
254 | |
---|
255 | (const temp_adj = (pow (3 ((celsius - 22) / 10)))) |
---|
256 | |
---|
257 | (defun ghk (v celsius ci co) |
---|
258 | (let ((F 96485.0) (R 8.3145)) |
---|
259 | (let ((zeta ((2e-3 * F * v) / (R * (273.19 + celsius))))) |
---|
260 | (if ((abs (1.0 - exp (neg (zeta)))) < 1e-6) |
---|
261 | then (1e-6 * (2 * F) * (ci - (co * exp (neg (zeta)))) * (1.0 + (zeta / 2))) |
---|
262 | else ((1e-6 * (2 * zeta * F) * (ci - (co * exp (neg (zeta))))) / (1.0 - exp (neg (zeta)))))))) |
---|
263 | |
---|
264 | |
---|
265 | (decaying-pool (ca (initial 1e-4) (depth 0.1) (beta 1) (temp-adj temp_adj))) |
---|
266 | |
---|
267 | (component (type ion-channel) (name Kv1) |
---|
268 | |
---|
269 | (component (type gate) |
---|
270 | |
---|
271 | ;; rate functions |
---|
272 | (defun Kv1_amf (v) |
---|
273 | (let ((cma 0.12889) |
---|
274 | (cka -33.90877) |
---|
275 | (cva 45)) |
---|
276 | (cma * (exp (neg ((v + cva) / cka)))))) |
---|
277 | |
---|
278 | (defun Kv1_bmf (v) |
---|
279 | (let ((cmb 0.12889) |
---|
280 | (ckb 12.42101) |
---|
281 | (cvb 45)) |
---|
282 | (cmb * (exp (neg ((v + cvb) / ckb)))))) |
---|
283 | |
---|
284 | (hh-ionic-conductance |
---|
285 | (Kv1 ;; ion name: exported variables will be of the form {ion}_{id} |
---|
286 | (initial-m (Kv1_amf (Vrest) / (Kv1_amf (Vrest) + Kv1_bmf (Vrest)))) |
---|
287 | (m-power 4) |
---|
288 | (h-power 0) |
---|
289 | (m-alpha (temp_adj * Kv1_amf (v) )) |
---|
290 | (m-beta (temp_adj * Kv1_bmf (v) )))) |
---|
291 | |
---|
292 | ) |
---|
293 | |
---|
294 | (component (type pore) |
---|
295 | (const gbar_Kv1 = 0.011) |
---|
296 | (output gbar_Kv1 )) |
---|
297 | |
---|
298 | (component (type permeating-substance) (name k) |
---|
299 | (const e_Kv1 = -85) |
---|
300 | (output e_Kv1 )) |
---|
301 | |
---|
302 | ) ;; end Kv1 current |
---|
303 | |
---|
304 | (component (type ion-channel) (name Kv4) |
---|
305 | |
---|
306 | (component (type gate) |
---|
307 | |
---|
308 | ;; rate functions |
---|
309 | |
---|
310 | |
---|
311 | (defun Kv4_amf (v) |
---|
312 | (let ((can 0.15743) |
---|
313 | (ckan -32.19976) |
---|
314 | (cvan 57)) |
---|
315 | (can * exp (neg ((v + cvan) / ckan))))) |
---|
316 | |
---|
317 | |
---|
318 | (defun Kv4_bmf (v) |
---|
319 | (let ((cbn 0.15743) |
---|
320 | (ckbn 37.51346) |
---|
321 | (cvbn 57)) |
---|
322 | (cbn * exp (neg ((v + cvbn) / ckbn))))) |
---|
323 | |
---|
324 | |
---|
325 | (defun Kv4_ahf (v) |
---|
326 | (let ((cah 0.01342) |
---|
327 | (ckah -7.86476) |
---|
328 | (cvah 60)) |
---|
329 | (cah / (1.0 + (exp (neg ((v + cvah) / ckah))))))) |
---|
330 | |
---|
331 | |
---|
332 | (defun Kv4_bhf (v) |
---|
333 | (let ((cbh 0.04477) |
---|
334 | (ckbh 11.3615) |
---|
335 | (cvbh 54)) |
---|
336 | (cbh / (1.0 + (exp (neg ((v + cvbh) / ckbh))))))) |
---|
337 | |
---|
338 | (hh-ionic-conductance |
---|
339 | (Kv4 ;; ion name: exported variables will be of the form {ion}_{id} |
---|
340 | (initial-m (Kv4_amf (Vrest) / (Kv4_amf (Vrest) + Kv4_bmf (Vrest))) ) |
---|
341 | (initial-h (Kv4_ahf (Vrest) / (Kv4_ahf (Vrest) + Kv4_bhf (Vrest))) ) |
---|
342 | (m-power 4) |
---|
343 | (h-power 1) |
---|
344 | (m-alpha (temp_adj * Kv4_amf (v))) |
---|
345 | (m-beta (temp_adj * Kv4_bmf (v))) |
---|
346 | (h-alpha (temp_adj * Kv4_ahf (v))) |
---|
347 | (h-beta (temp_adj * Kv4_bhf (v))) |
---|
348 | )) |
---|
349 | |
---|
350 | ) |
---|
351 | |
---|
352 | (component (type pore) |
---|
353 | (const gbar_Kv4 = 0.0039) |
---|
354 | (output gbar_Kv4 )) |
---|
355 | |
---|
356 | (component (type permeating-substance) (name k) |
---|
357 | (const e_Kv4 = -85) |
---|
358 | (output e_Kv4 )) |
---|
359 | |
---|
360 | ) ;; end Kv4 current |
---|
361 | |
---|
362 | |
---|
363 | (component (type ion-channel) (name Ih) |
---|
364 | |
---|
365 | (component (type gate) |
---|
366 | |
---|
367 | ;; rate functions |
---|
368 | |
---|
369 | (defun Ih_inf (v) |
---|
370 | (let ((cvn 90.1) |
---|
371 | (ckn -9.9)) |
---|
372 | (1.0 / (1.0 + exp (neg ((v + cvn) / ckn) ))))) |
---|
373 | |
---|
374 | (defun Ih_tau (v) |
---|
375 | (let ((cct 190) |
---|
376 | (cat 720) |
---|
377 | (cvt 81.5) |
---|
378 | (ckt 11.9)) |
---|
379 | (cct + (cat * exp (neg (pow (((v + cvt) / ckt) 2))))))) |
---|
380 | |
---|
381 | (hh-ionic-conductance |
---|
382 | (Ih ;; ion name: exported variables will be of the form {ion}_{id} |
---|
383 | (initial-m (Ih_inf (Vrest))) |
---|
384 | (m-power 1) |
---|
385 | (h-power 0) |
---|
386 | (m-inf (Ih_inf (v))) |
---|
387 | (m-tau (Ih_tau (v) / temp_adj)) |
---|
388 | )) |
---|
389 | |
---|
390 | ) |
---|
391 | |
---|
392 | (component (type pore) |
---|
393 | (const gbar_Ih = 0.0002) |
---|
394 | (output gbar_Ih )) |
---|
395 | |
---|
396 | (component (type permeating-substance) (name non-specific) |
---|
397 | (const e_Ih = -30) |
---|
398 | (output e_Ih )) |
---|
399 | |
---|
400 | ) ;; end Ih current |
---|
401 | |
---|
402 | (component (type ion-channel) (name CaP) |
---|
403 | |
---|
404 | (component (type gate) |
---|
405 | |
---|
406 | ;; rate functions |
---|
407 | (defun CaP_inf (v) |
---|
408 | (let ((cv 19) (ck 5.5)) |
---|
409 | (1.0 / (1.0 + exp (neg ((v + cv) / ck)))))) |
---|
410 | |
---|
411 | (defun CaP_tau (v) |
---|
412 | (if (v > -50) |
---|
413 | then (1e3 * (0.000191 + (0.00376 * pow ((exp (neg ((v + 41.9) / 27.8))) 2)))) |
---|
414 | else (1e3 * (0.00026367 + (0.1278 * exp (0.10327 * v)))))) |
---|
415 | |
---|
416 | (hh-ionic-conductance |
---|
417 | (CaP ;; ion name: exported variables will be of the form {ion}_{id} |
---|
418 | (initial-m (CaP_inf (Vrest))) |
---|
419 | (m-power 1) |
---|
420 | (h-power 0) |
---|
421 | (m-inf (CaP_inf (v))) |
---|
422 | (m-tau (CaP_tau (v) / temp_adj)))) |
---|
423 | |
---|
424 | ) |
---|
425 | |
---|
426 | (component (type pore) |
---|
427 | (const gmax_CaP = 0.01667) |
---|
428 | (gbar_CaP = (gmax_CaP * ghk (v celsius cai cao))) |
---|
429 | (output gbar_CaP )) |
---|
430 | |
---|
431 | (component (type accumulating-substance) (name ca) ) |
---|
432 | |
---|
433 | |
---|
434 | ) ;; end CaP current |
---|
435 | |
---|
436 | |
---|
437 | (component (type ion-channel) (name CaBK) |
---|
438 | |
---|
439 | (component (type gate) |
---|
440 | |
---|
441 | ;; rate functions |
---|
442 | |
---|
443 | (defun CaBK_zinf (ca) |
---|
444 | (let ((zhalf 0.001)) |
---|
445 | (1 / (1 + (zhalf / ca))))) |
---|
446 | |
---|
447 | (const CaBK_ztau = 1.0) |
---|
448 | |
---|
449 | (defun CaBK_minf (v) |
---|
450 | (let ((cvm 28.9) |
---|
451 | (ckm 6.2)) |
---|
452 | (1.0 / (1.0 + exp (neg ((v + 5.0 + cvm) / ckm)))))) |
---|
453 | |
---|
454 | (defun CaBK_mtau (v) |
---|
455 | (let ((ctm 0.000505) |
---|
456 | (cvtm1 86.4) |
---|
457 | (cktm1 -10.1) |
---|
458 | (cvtm2 -33.3) |
---|
459 | (cktm2 10)) |
---|
460 | (ctm + (1.0 / (exp (neg ((v + 5.0 + cvtm1) / cktm1)) + |
---|
461 | exp (neg ((v + 5.0 + cvtm2) / cktm2))))))) |
---|
462 | |
---|
463 | (defun CaBK_hinf (v) |
---|
464 | (let ((ch 0.085) |
---|
465 | (cvh 32) |
---|
466 | (ckh -5.8)) |
---|
467 | (ch + ((1.0 - ch) / (1.0 + (exp (neg ((v + 5.0 + cvh) / ckh)))))))) |
---|
468 | |
---|
469 | (defun CaBK_htau (v) |
---|
470 | (let ((cth 0.0019) |
---|
471 | (cvth1 48.5) |
---|
472 | (ckth1 -5.2) |
---|
473 | (cvth2 -54.2) |
---|
474 | (ckth2 12.9)) |
---|
475 | (cth + (1.0 / (exp (neg ((v + cvth1) / ckth1)) + |
---|
476 | exp (neg ((v + cvth2) / ckth2))))))) |
---|
477 | |
---|
478 | (state-complex |
---|
479 | (CaBK_z |
---|
480 | (transitions (<-> C O (CaBK_zinf (cai) / CaBK_ztau) |
---|
481 | ((1 - CaBK_zinf (cai)) / CaBK_ztau))) |
---|
482 | (initial (CaBK_zinf (1e-4))) |
---|
483 | (open O) (power 2))) |
---|
484 | |
---|
485 | (output CaBK_z ) |
---|
486 | |
---|
487 | |
---|
488 | (hh-ionic-conductance |
---|
489 | (CaBK ;; ion name: exported variables will be of the form {ion}_{id} |
---|
490 | (initial-m (CaBK_minf (Vrest) / temp_adj)) |
---|
491 | (initial-h (CaBK_hinf (Vrest) / temp_adj)) |
---|
492 | (m-power 3) |
---|
493 | (h-power 1) |
---|
494 | (m-inf (CaBK_minf (v) / temp_adj) ) |
---|
495 | (m-tau (CaBK_mtau (v) / temp_adj) ) |
---|
496 | (h-inf (CaBK_hinf (v) / temp_adj) ) |
---|
497 | (h-tau (CaBK_htau (v) / temp_adj) ))) |
---|
498 | |
---|
499 | ) |
---|
500 | |
---|
501 | (component (type pore) |
---|
502 | (const gbar_CaBK = 0.014) |
---|
503 | (output gbar_CaBK )) |
---|
504 | |
---|
505 | (component (type permeating-substance) (name k) |
---|
506 | (const e_CaBK = -85) |
---|
507 | (output e_CaBK )) |
---|
508 | |
---|
509 | ) ;; end BK current |
---|
510 | |
---|
511 | )) |
---|
512 | |
---|
513 | EOF |
---|
514 | )) |
---|
515 | |
---|
516 | (license |
---|
517 | "Copyright 2008 Ivan Raikov and the Okinawa Institute of Science and Technology. |
---|
518 | |
---|
519 | This program is free software: you can redistribute it and/or modify |
---|
520 | it under the terms of the GNU General Public License as published by |
---|
521 | the Free Software Foundation, either version 3 of the License, or (at |
---|
522 | your option) any later version. |
---|
523 | |
---|
524 | This program is distributed in the hope that it will be useful, but |
---|
525 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
526 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
527 | General Public License for more details. |
---|
528 | |
---|
529 | A full copy of the GPL license can be found at |
---|
530 | <http://www.gnu.org/licenses/>.")))) |
---|
531 | |
---|
532 | |
---|
533 | (define nemo-eggdoc:css (make-parameter #<<EOF |
---|
534 | <!-- |
---|
535 | CODE { |
---|
536 | color: #666666; |
---|
537 | } |
---|
538 | /* DT.definition EM { font-weight: bold; font-style: normal; } */ |
---|
539 | |
---|
540 | DT.definition { |
---|
541 | background: #eee; |
---|
542 | color: black; |
---|
543 | padding: 0.2em 1em 0.2em 0.7em; |
---|
544 | margin-left: 0.2em; |
---|
545 | border: 1px solid #bbc; |
---|
546 | font-family: "Andale Mono", monospace; |
---|
547 | /* font-size: 1.2em; */ |
---|
548 | |
---|
549 | } |
---|
550 | DD { |
---|
551 | margin-top: 0.8em; |
---|
552 | margin-bottom: 0.8em; |
---|
553 | } |
---|
554 | DIV.subsection { |
---|
555 | border-top: 1px solid #448; |
---|
556 | padding-left: 1em; |
---|
557 | margin-bottom: 1.2em; |
---|
558 | } |
---|
559 | DIV.subsubsection { |
---|
560 | border-top: 1px dotted #99c; |
---|
561 | /* border-left: 1px solid #99c; */ |
---|
562 | padding-left: 1em; |
---|
563 | margin-bottom: 1.2em; |
---|
564 | } |
---|
565 | DIV.subsubsubsection { |
---|
566 | border-top: 1px solid #ddf; |
---|
567 | padding-left: 1em; |
---|
568 | margin-bottom: 1.2em; |
---|
569 | } |
---|
570 | |
---|
571 | DIV.section { |
---|
572 | margin-bottom: 1.5em; |
---|
573 | } |
---|
574 | a:link { |
---|
575 | color: #336; |
---|
576 | } |
---|
577 | a:visited { color: #666; } |
---|
578 | a:active { color: #966; } |
---|
579 | a:hover { color: #669; } |
---|
580 | body { margin: 0; padding: 0; background: #fff; color: #000; font: 9pt "Lucida Grande", "Verdana", sans-serif; } |
---|
581 | H2 { |
---|
582 | background: #336; |
---|
583 | color: #fff; |
---|
584 | padding-top: 0.5em; |
---|
585 | padding-bottom: 0.5em; |
---|
586 | padding-left: 16px; |
---|
587 | margin: 0 0 1em 0; |
---|
588 | } |
---|
589 | UL LI { |
---|
590 | list-style: none; |
---|
591 | } |
---|
592 | TT { |
---|
593 | font-family: "Andale Mono", monospace; |
---|
594 | /* font-size: 1.2em; */ |
---|
595 | } |
---|
596 | H3 { |
---|
597 | color: #113; |
---|
598 | margin-bottom: 0.5em; |
---|
599 | } |
---|
600 | H4, H5, H6 { |
---|
601 | color: #113; |
---|
602 | margin-bottom: 1.0em; |
---|
603 | } |
---|
604 | H5 { |
---|
605 | font-weight: normal; |
---|
606 | font-style: italic; |
---|
607 | font-size: 100%; |
---|
608 | margin-top: 1.2em; |
---|
609 | } |
---|
610 | H6 { |
---|
611 | font-weight: bold; |
---|
612 | font-size: 85%; |
---|
613 | margin-top: 1.2em; |
---|
614 | } |
---|
615 | DIV#eggheader { |
---|
616 | text-align: center; |
---|
617 | float: right; |
---|
618 | margin-right: 2em; |
---|
619 | } |
---|
620 | DIV#header IMG { |
---|
621 | /* display: block; margin-left: auto; margin-right: auto; */ |
---|
622 | /* float: right; */ |
---|
623 | border: none; /* firefox */ |
---|
624 | } |
---|
625 | DIV#footer { |
---|
626 | background: #bbd; |
---|
627 | padding: 0.7em ; |
---|
628 | border-top: 1px solid #cce; |
---|
629 | } |
---|
630 | DIV#footer hr { |
---|
631 | display: none; |
---|
632 | } |
---|
633 | DIV#footer a { |
---|
634 | float: left; |
---|
635 | } |
---|
636 | DIV#revision-history { |
---|
637 | float: right; |
---|
638 | } |
---|
639 | |
---|
640 | DIV#body { |
---|
641 | margin: 1em 1em 1em 16px; |
---|
642 | } |
---|
643 | |
---|
644 | DIV#examples PRE { |
---|
645 | background: #eef; |
---|
646 | padding: 0.1em; |
---|
647 | border: 1px solid #aac; |
---|
648 | } |
---|
649 | PRE#license, DIV#examples PRE { |
---|
650 | padding: 0.5em; |
---|
651 | } |
---|
652 | DIV#examples PRE { |
---|
653 | /* font-size: 85%; */ |
---|
654 | } |
---|
655 | PRE { font-family: "Andale Mono", monospace; } |
---|
656 | TABLE { |
---|
657 | background: #eef; |
---|
658 | padding: 0.2em; |
---|
659 | border: 1px solid #aac; |
---|
660 | border-collapse: collapse; |
---|
661 | width: 100%; |
---|
662 | } |
---|
663 | TABLE.symbol-table TD.symbol { |
---|
664 | font-family: "Andale Mono", monospace; |
---|
665 | vertical-align: top; |
---|
666 | /* font-size: 1.2em; */ |
---|
667 | } |
---|
668 | TABLE.symbol-table TD { |
---|
669 | font-family: "Andale Mono", monospace; |
---|
670 | vertical-align: top; |
---|
671 | /* font-size: 1.2em; */ |
---|
672 | } |
---|
673 | TH { |
---|
674 | text-align: left; |
---|
675 | border-bottom: 1px solid #aac; |
---|
676 | padding: 0.25em 0.5em 0.25em 0.5em; |
---|
677 | } |
---|
678 | TD { padding: 0.25em 0.5em 0.25em 0.5em; } |
---|
679 | --> |
---|
680 | EOF |
---|
681 | )) |
---|
682 | |
---|
683 | |
---|
684 | |
---|
685 | (if (eggdoc->html |
---|
686 | doc |
---|
687 | `( (eggdoc-style . ,(lambda (tag) |
---|
688 | `("<style type=\"text/css\">" ,(nemo-eggdoc:css) |
---|
689 | "</style>"))) |
---|
690 | |
---|
691 | (comment |
---|
692 | *macro* |
---|
693 | . ,(lambda (tag . content) `(p . ,content))) |
---|
694 | |
---|
695 | (ebnf-def ; Term definition |
---|
696 | *macro* |
---|
697 | . ,(lambda (tag term-def . others) |
---|
698 | `(dl (dt (b (tt ,term-def)) (tt " ::= ")) |
---|
699 | (dd ,@others)))) |
---|
700 | |
---|
701 | (ebnf-kw ; Keyword |
---|
702 | *macro* |
---|
703 | . ,(lambda (tag kw) |
---|
704 | `((b (tt ,kw))))) |
---|
705 | |
---|
706 | (ebnf-var ; Variable |
---|
707 | *macro* |
---|
708 | . ,(lambda (tag varname) `("{" (i ,varname) "}"))) |
---|
709 | |
---|
710 | (ebnf-choice ; Choice of terms |
---|
711 | *macro* |
---|
712 | . ,(lambda (tag . terms) |
---|
713 | (intersperse terms `(tt " | ")))) |
---|
714 | |
---|
715 | (ebnf-opt ; Optional terms |
---|
716 | . ,(lambda (tag . terms) |
---|
717 | `(" [" ,@terms "] "))) |
---|
718 | |
---|
719 | (ebnf-form ; ( ... ) Form |
---|
720 | *macro* |
---|
721 | . ,(lambda (tag . terms) |
---|
722 | `("( " ,@(intersperse terms " ") " )"))) |
---|
723 | |
---|
724 | (ebnf-compound ; Compound form |
---|
725 | *macro* |
---|
726 | . ,(lambda (tag term-def . others) |
---|
727 | `(dl (dt (b (tt ,term-def)) ) |
---|
728 | (dd ,@others)))) |
---|
729 | |
---|
730 | ,@(eggdoc:make-stylesheet doc) )) |
---|
731 | |
---|
732 | (void)) |
---|