1 | ;; |
---|
2 | ;; |
---|
3 | ;; nemx 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) |
---|
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.0" "Initial release")) |
---|
35 | |
---|
36 | |
---|
37 | (requires (url "args.html" "args") |
---|
38 | (url "datatype.html" "datatype") |
---|
39 | (url "digraph.html" "digraph") |
---|
40 | (url "environments.html" "environments") |
---|
41 | (url "graph-bfs.html""graph-bfs") |
---|
42 | (url "graph-cycles.html" "graph-cycles") |
---|
43 | (url "matchable.html" "matchable") |
---|
44 | (url "mathh.html" "mathh") |
---|
45 | (url "strictly-pretty.html" "strictly-pretty") |
---|
46 | (url "sxml-tools.html" "sxml-tools") |
---|
47 | (url "sxml-transforms.html" "sxml-transforms") |
---|
48 | (url "syntax-case.html" "syntax-case") |
---|
49 | (url "varsubst.html" "varsubst") |
---|
50 | (url "vector-lib.html" "vector-lib")) |
---|
51 | |
---|
52 | |
---|
53 | (usage "nemo [options...] [input files ...]") |
---|
54 | (download "nemo.egg") |
---|
55 | |
---|
56 | (documentation |
---|
57 | |
---|
58 | (p (tt "NEMO") " is a program that reads an on channel description " |
---|
59 | "in a format based on ChannelML and generates a corresponding description " |
---|
60 | "in the [[http://www.neuron.yale.edu/neuron/docs/help/neuron/nmodl/nmodl.html|NMODL]] " |
---|
61 | "language used by the [[http://www.neuron.yale.edu/neuron/|NEURON]] simulator. ") |
---|
62 | |
---|
63 | (subsection "Options" |
---|
64 | (p (symbol-table |
---|
65 | (describe "-i FORMAT" "specify input format (xml, sxml, s-exp)") |
---|
66 | (describe "--xml[=FILE]" "write XML output to file (default: <model-name>.xml") |
---|
67 | (describe "--sxml[=FILE]" "write SXML output to file (default: <model-name>.sxml") |
---|
68 | (describe "--nmodl[=FILE]" "write NMODL output to file (default: <model-name>.mod") |
---|
69 | (describe "--nmodl-method=METHOD" "specify NMODL integration method (cnexp, derivimplicit)") |
---|
70 | (describe "-t" "use interpolation tables in generated code") |
---|
71 | (describe "-h, --help" "print help")))) |
---|
72 | |
---|
73 | (subsection "Model description language" |
---|
74 | (p "The following constructs comprise the model description language: ") |
---|
75 | (p (symbol-table |
---|
76 | (describe "(INPUT {ID | (ID [AS LOCAL-ID] [FROM NAMESPACE])} ... )" |
---|
77 | "declare an imported quantity") |
---|
78 | (describe "(OUTPUT ID)" |
---|
79 | "declare that an existing quantity be exported") |
---|
80 | (describe "(CONST ID = EXPR)" |
---|
81 | "declare a constant quantity (its value will be computed at declaration time)") |
---|
82 | (describe "(DEFUN ID ({ARG-ID} ... ) BODY)" |
---|
83 | "declare a function (an expression with no free variables)") |
---|
84 | (describe "(ASGN ID = EXPR)" |
---|
85 | "declare an assigned quantity (an expression that can refer to other quantities in the system)") |
---|
86 | (describe "(STATE-COMPLEX ID TRANSITIONS INITIAL OPEN)" |
---|
87 | "declare a state complex quantity") |
---|
88 | (describe "(COMPONENT (TYPE ID) (NAME ID) ELEMENTS)" |
---|
89 | "declare a system component (a quantity that can contain other quantities)") |
---|
90 | ) |
---|
91 | )) |
---|
92 | |
---|
93 | ) |
---|
94 | (examples (pre #<<EOF |
---|
95 | |
---|
96 | ;; Akemann and Knoepfel, J.Neurosci. 26 (2006) 4602 |
---|
97 | |
---|
98 | (nemo-model PotIhCa |
---|
99 | ((input v cai cao) |
---|
100 | |
---|
101 | (const Vrest = -68) |
---|
102 | (const diam = 20) |
---|
103 | (const celsius = 24) |
---|
104 | |
---|
105 | (const temp_adj = (pow 3 (/ (- celsius 22) 10))) |
---|
106 | |
---|
107 | (defun ghk (v celsius ci co) |
---|
108 | (let ((F 96485.0) (R 8.3145)) |
---|
109 | (let ((zeta (/ (* 2e-3 F v) (* R (+ 273.19 celsius))))) |
---|
110 | (if (< (abs (- 1.0 (exp (neg zeta)))) 1e-6) |
---|
111 | (* 1e-6 (* 2 F) (- ci (* co (exp (neg zeta)))) (+ 1.0 (/ zeta 2))) |
---|
112 | (/ (* 1e-6 (* 2 zeta F) (- ci (* co (exp (neg zeta))))) (- 1.0 (exp (neg zeta)))))))) |
---|
113 | |
---|
114 | |
---|
115 | (component (type ion-channel) (name Kv1) |
---|
116 | |
---|
117 | (component (type gate) |
---|
118 | |
---|
119 | ;; rate functions |
---|
120 | (defun Kv1_amf (v) |
---|
121 | (let ((cma 0.12889) |
---|
122 | (cka -33.90877) |
---|
123 | (cva 45)) |
---|
124 | (* cma (exp (neg (/ (+ v cva) cka)))))) |
---|
125 | |
---|
126 | (defun Kv1_bmf (v) |
---|
127 | (let ((cmb 0.12889) |
---|
128 | (ckb 12.42101) |
---|
129 | (cvb 45)) |
---|
130 | (* cmb (exp (neg (/ (+ v cvb) ckb)))))) |
---|
131 | |
---|
132 | (hh-ionic-conductance |
---|
133 | (Kv1 ;; ion name: exported variables will be of the form {ion}_{id} |
---|
134 | (initial-m (/ (Kv1_amf Vrest) (+ (Kv1_amf Vrest) (Kv1_bmf Vrest)))) |
---|
135 | (m-power 4) |
---|
136 | (h-power 0) |
---|
137 | (m-alpha (* temp_adj (Kv1_amf v) )) |
---|
138 | (m-beta (* temp_adj (Kv1_bmf v) ))) |
---|
139 | |
---|
140 | )) |
---|
141 | |
---|
142 | |
---|
143 | |
---|
144 | (component (type pore) |
---|
145 | (const gbar_Kv1 = 0.011) |
---|
146 | (output gbar_Kv1 )) |
---|
147 | |
---|
148 | (component (type permeating-substance) (name k) |
---|
149 | (const e_Kv1 = -85) |
---|
150 | (output e_Kv1 )) |
---|
151 | |
---|
152 | ) ;; end Kv1 current |
---|
153 | |
---|
154 | |
---|
155 | (component (type ion-channel) (name Kv4) |
---|
156 | |
---|
157 | (component (type gate) |
---|
158 | |
---|
159 | ;; rate functions |
---|
160 | |
---|
161 | |
---|
162 | (defun Kv4_amf (v) |
---|
163 | (let ((can 0.15743) |
---|
164 | (ckan -32.19976) |
---|
165 | (cvan 57)) |
---|
166 | (* can (exp (neg (/ (+ v cvan) ckan)))))) |
---|
167 | |
---|
168 | |
---|
169 | (defun Kv4_bmf (v) |
---|
170 | (let ((cbn 0.15743) |
---|
171 | (ckbn 37.51346) |
---|
172 | (cvbn 57)) |
---|
173 | (* cbn (exp (neg (/ (+ v cvbn) ckbn)))))) |
---|
174 | |
---|
175 | |
---|
176 | (defun Kv4_ahf (v) |
---|
177 | (let ((cah 0.01342) |
---|
178 | (ckah -7.86476) |
---|
179 | (cvah 60)) |
---|
180 | (/ cah (+ 1.0 (exp (neg (/ (+ v cvah) ckah))))))) |
---|
181 | |
---|
182 | |
---|
183 | (defun Kv4_bhf (v) |
---|
184 | (let ((cbh 0.04477) |
---|
185 | (ckbh 11.3615) |
---|
186 | (cvbh 54)) |
---|
187 | (/ cbh (+ 1.0 (exp (neg (/ (+ v cvbh) ckbh))))))) |
---|
188 | |
---|
189 | (hh-ionic-conductance |
---|
190 | (Kv4 ;; ion name: exported variables will be of the form {ion}_{id} |
---|
191 | (initial-m (/ (Kv4_amf Vrest) (+ (Kv4_amf Vrest) (Kv4_bmf Vrest)))) |
---|
192 | (initial-h (/ (Kv4_ahf Vrest) (+ (Kv4_ahf Vrest) (Kv4_bhf Vrest))) ) |
---|
193 | (m-power 4) |
---|
194 | (h-power 1) |
---|
195 | (m-alpha (* temp_adj (Kv4_amf v))) |
---|
196 | (m-beta (* temp_adj (Kv4_bmf v))) |
---|
197 | (h-alpha (* temp_adj (Kv4_ahf v))) |
---|
198 | (h-beta (* temp_adj (Kv4_bhf v))) |
---|
199 | )) |
---|
200 | |
---|
201 | ) |
---|
202 | |
---|
203 | (component (type pore) |
---|
204 | (const gbar_Kv4 = 0.0039) |
---|
205 | (output gbar_Kv4 )) |
---|
206 | |
---|
207 | (component (type permeating-substance) (name k) |
---|
208 | (const e_Kv4 = -85) |
---|
209 | (output e_Kv4 )) |
---|
210 | |
---|
211 | ) ;; end Kv4 current |
---|
212 | |
---|
213 | |
---|
214 | |
---|
215 | (component (type ion-channel) (name Ih) |
---|
216 | |
---|
217 | (component (type gate) |
---|
218 | |
---|
219 | ;; rate functions |
---|
220 | |
---|
221 | (defun Ih_inf (v) |
---|
222 | (let ((cvn 90.1) |
---|
223 | (ckn -9.9)) |
---|
224 | (/ 1.0 (+ 1.0 (exp (neg (/ (+ v cvn) ckn) )))))) |
---|
225 | |
---|
226 | (defun Ih_tau (v) |
---|
227 | (let ((cct 190) |
---|
228 | (cat 720) |
---|
229 | (cvt 81.5) |
---|
230 | (ckt 11.9)) |
---|
231 | (+ cct (* cat (exp (neg (pow (/ (+ v cvt) ckt) 2))))))) |
---|
232 | |
---|
233 | (hh-ionic-conductance |
---|
234 | (Ih ;; ion name: exported variables will be of the form {ion}_{id} |
---|
235 | (initial-m (Ih_inf Vrest)) |
---|
236 | (m-power 1) |
---|
237 | (h-power 0) |
---|
238 | (m-inf (Ih_inf v)) |
---|
239 | (m-tau (/ (Ih_tau v) temp_adj)) |
---|
240 | )) |
---|
241 | |
---|
242 | ) |
---|
243 | |
---|
244 | (component (type pore) |
---|
245 | (const gbar_Ih = 0.0002) |
---|
246 | (output gbar_Ih )) |
---|
247 | |
---|
248 | (component (type permeating-substance) (name non-specific) |
---|
249 | (const e_Ih = -30) |
---|
250 | (output e_Ih )) |
---|
251 | |
---|
252 | ) ;; end Ih current |
---|
253 | |
---|
254 | (component (type ion-channel) (name CaP) |
---|
255 | |
---|
256 | (component (type gate) |
---|
257 | |
---|
258 | ;; rate functions |
---|
259 | (defun CaP_inf (v) |
---|
260 | (let ((cv 19) (ck 5.5)) |
---|
261 | (/ 1.0 (+ 1.0 (exp (neg (/ (+ v cv) ck))))))) |
---|
262 | |
---|
263 | (defun CaP_tau (v) |
---|
264 | (if (> v -50) |
---|
265 | (* 1e3 (+ 0.000191 (* 0.00376 (pow (exp (neg (/ (+ v 41.9) 27.8))) 2)))) |
---|
266 | (* 1e3 (+ 0.00026367 (* 0.1278 (exp (* 0.10327 v))))))) |
---|
267 | |
---|
268 | (hh-ionic-conductance |
---|
269 | (CaP ;; ion name: exported variables will be of the form {ion}_{id} |
---|
270 | (initial-m (CaP_inf Vrest)) |
---|
271 | (m-power 1) |
---|
272 | (h-power 0) |
---|
273 | (m-inf (CaP_inf v)) |
---|
274 | (m-tau (/ (CaP_tau v) temp_adj)))) |
---|
275 | |
---|
276 | ) |
---|
277 | |
---|
278 | (component (type pore) |
---|
279 | (const gmax_CaP = 0.01667) |
---|
280 | (gbar_CaP = (* gmax_CaP (ghk v celsius cai cao))) |
---|
281 | (output gbar_CaP )) |
---|
282 | |
---|
283 | (component (type accumulating-substance) (name ca) ) |
---|
284 | |
---|
285 | |
---|
286 | ) ;; end CaP current |
---|
287 | |
---|
288 | |
---|
289 | (component (type ion-channel) (name CaBK) |
---|
290 | |
---|
291 | (component (type gate) |
---|
292 | |
---|
293 | ;; rate functions |
---|
294 | |
---|
295 | (defun CaBK_zinf (ca) |
---|
296 | (let ((zhalf 0.001)) |
---|
297 | (/ 1 (+ 1 (/ zhalf ca))))) |
---|
298 | |
---|
299 | (const CaBK_ztau = 1.0) |
---|
300 | |
---|
301 | (defun CaBK_minf (v) |
---|
302 | (let ((cvm 28.9) |
---|
303 | (ckm 6.2)) |
---|
304 | (/ 1.0 (+ 1.0 (exp (neg (/ (+ v 5.0 cvm) ckm))))))) |
---|
305 | |
---|
306 | (defun CaBK_mtau (v) |
---|
307 | (let ((ctm 0.000505) |
---|
308 | (cvtm1 86.4) |
---|
309 | (cktm1 -10.1) |
---|
310 | (cvtm2 -33.3) |
---|
311 | (cktm2 10)) |
---|
312 | (+ ctm (/ 1.0 (+ (exp (neg (/ (+ v 5.0 cvtm1) cktm1))) |
---|
313 | (exp (neg (/ (+ v 5.0 cvtm2) cktm2)))))))) |
---|
314 | |
---|
315 | (defun CaBK_hinf (v) |
---|
316 | (let ((ch 0.085) |
---|
317 | (cvh 32) |
---|
318 | (ckh -5.8)) |
---|
319 | (+ ch (/ (- 1.0 ch) (+ 1.0 (exp (neg (/ (+ v 5.0 cvh) ckh)))))))) |
---|
320 | |
---|
321 | (defun CaBK_htau (v) |
---|
322 | (let ((cth 0.0019) |
---|
323 | (cvth1 48.5) |
---|
324 | (ckth1 -5.2) |
---|
325 | (cvth2 -54.2) |
---|
326 | (ckth2 12.9)) |
---|
327 | (+ cth (/ 1.0 ( + (exp (- (/ (+ v cvth1) ckth1))) |
---|
328 | (exp (- (/ (+ v cvth2) ckth2)))))))) |
---|
329 | |
---|
330 | (state-complex |
---|
331 | (CaBK_z |
---|
332 | (transitions (-> zC zO (/ (CaBK_zinf cai) CaBK_ztau)) |
---|
333 | (-> zO zC (/ (- 1 (CaBK_zinf cai)) CaBK_ztau))) |
---|
334 | (initial (CaBK_zinf 1e-4)) |
---|
335 | (open zO) (power 2))) |
---|
336 | |
---|
337 | (output CaBK_z ) |
---|
338 | |
---|
339 | |
---|
340 | (hh-ionic-conductance |
---|
341 | (CaBK ;; ion name: exported variables will be of the form {ion}_{id} |
---|
342 | (initial-m (/ (CaBK_minf Vrest) temp_adj)) |
---|
343 | (initial-h (/ (CaBK_hinf Vrest) temp_adj )) |
---|
344 | (m-power 3) |
---|
345 | (h-power 1) |
---|
346 | (m-inf (/ (CaBK_minf v) temp_adj )) |
---|
347 | (m-tau (/ (CaBK_mtau v) temp_adj )) |
---|
348 | (h-inf (/ (CaBK_hinf v) temp_adj) ) |
---|
349 | (h-tau (/ (CaBK_htau v) temp_adj) ))) |
---|
350 | |
---|
351 | ) |
---|
352 | |
---|
353 | (component (type pore) |
---|
354 | (const gbar_CaBK = 0.014) |
---|
355 | (output gbar_CaBK )) |
---|
356 | |
---|
357 | (component (type permeating-substance) (name k) |
---|
358 | (const e_CaBK = -85) |
---|
359 | (output e_CaBK )) |
---|
360 | |
---|
361 | ) ;; end BK current |
---|
362 | |
---|
363 | |
---|
364 | |
---|
365 | )) ;; end model |
---|
366 | |
---|
367 | EOF |
---|
368 | )) |
---|
369 | |
---|
370 | (license |
---|
371 | "Copyright 2008 Ivan Raikov and the Okinawa Institute of Science and Technology. |
---|
372 | |
---|
373 | This program is free software: you can redistribute it and/or modify |
---|
374 | it under the terms of the GNU General Public License as published by |
---|
375 | the Free Software Foundation, either version 3 of the License, or (at |
---|
376 | your option) any later version. |
---|
377 | |
---|
378 | This program is distributed in the hope that it will be useful, but |
---|
379 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
380 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
381 | General Public License for more details. |
---|
382 | |
---|
383 | A full copy of the GPL license can be found at |
---|
384 | <http://www.gnu.org/licenses/>.")))) |
---|
385 | |
---|
386 | (if (eggdoc->html doc) (void)) |
---|