-
Notifications
You must be signed in to change notification settings - Fork 0
/
PurkinjeCell.hoc
873 lines (553 loc) · 27 KB
/
PurkinjeCell.hoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
// ******************************************************
//
// File generated by: neuroConstruct v1.6.0
//
// ******************************************************
{load_file("nrngui.hoc")}
// Initialising stopwatch for timing setup
{startsw()}
print ""
print "*****************************************************"
print ""
print " neuroConstruct generated NEURON simulation "
print " for project: /Users/hashmup/nC_projects/PurkinjeCell.ncx/PurkinjeCell.ncx "
print ""
print " Description: An initial implementation in NeuroML of the Purkinje Cell model from De Schutter, E. and Bower, J. M. (1994). Based on Arnd Roth el al's conversion of the original GENESIS code to NEURON. "
print " "
print " Note: conversion not fully complete. Press Validate for details. Also, there are long standing issues about getting GENESIS and NEURON behaviour of the Purkinje cell to match. Contact P. Gleeson or A. Roth for more details on current status of this model."
print " "
print " ChannelML files need to be updated to post v1.7.3 format (though they still work file with existing XSL mappings for NEURON & GENESIS)"
print " "
print " "
print ""
print " Simulation Configuration: SimConfig: Default Simulation Configuration "
print " This is the default configuration of the Cell Groups, stimulations, plots, etc for this project "
print " "
print "*****************************************************"
strdef pwd
{system("pwd", pwd)}
print ""
print "Current working dir: ", pwd
objectvar allCells
{allCells = new List()}
// A flag to signal simulation was generated by neuroConstruct
{nC = 1}
// Including neuroConstruct utilities file
{load_file("nCtools.hoc")}
// Including neuroConstruct cell check file
{load_file("cellCheck.hoc")}
// Getting hostname
objref strFuncs
{strFuncs = new StringFunctions()}
strdef host
{system("hostname", host)}
if (strFuncs.len(host)>0) {
strFuncs.left(host, strFuncs.len(host)-1)
} else {
host = "????"
}
// Simulation running in serial mode, setting default host id
{hostid = 0}
// Initializes random-number generator
{use_mcell_ran4(1)}
{mcell_ran4_init(1587749884)}
//////////////////////////////////////////////////////////////////////
// Cell group 0: SampleCellGroup has cells of type: SomaOnly_all
//////////////////////////////////////////////////////////////////////
// Adding cell template file: SomaOnly_all.hoc for cell group SampleCellGroup
{ load_file("SomaOnly_all.hoc") }
// Adding 1 cells of type SomaOnly_all in region SampleRegion
{n_SampleCellGroup = 1}
{n_SampleCellGroup_local = 0 } // actual number created on this host
objectvar a_SampleCellGroup[n_SampleCellGroup]
proc addCell_SampleCellGroup() {
strdef reference
sprint(reference, "SampleCellGroup_%d", $1)
a_SampleCellGroup[$1] = new SomaOnly_all(reference, "SomaOnly_all", "A single segment/compartment cell with all channels which have been successfully translated to ChannelML")
allCells.append(a_SampleCellGroup[$1])
}
for i = 0, n_SampleCellGroup-1 {
addCell_SampleCellGroup(i)
n_SampleCellGroup_local = n_SampleCellGroup_local +1
}
// Placing these cells in a region described by: Rectangular Box from point: (0.0, 0.0, 0.0) to (100.0, 50.0, 100.0)
// Packing has been generated by: Random: num: 1, edge: 1, overlap: 1, other overlap: 0
{a_SampleCellGroup[0].position(43.629883,29.56268,64.92487)}
//////////////////////////////////////////////////////////////////////
// Cell group 1: OrigChansCellGroup has cells of type: SomaOnly_origChans_all
//////////////////////////////////////////////////////////////////////
// Adding cell template file: SomaOnly_origChans_all.hoc for cell group OrigChansCellGroup
{ load_file("SomaOnly_origChans_all.hoc") }
// Adding 1 cells of type SomaOnly_origChans_all in region SampleRegion
{n_OrigChansCellGroup = 1}
{n_OrigChansCellGroup_local = 0 } // actual number created on this host
objectvar a_OrigChansCellGroup[n_OrigChansCellGroup]
proc addCell_OrigChansCellGroup() {
strdef reference
sprint(reference, "OrigChansCellGroup_%d", $1)
a_OrigChansCellGroup[$1] = new SomaOnly_origChans_all(reference, "SomaOnly_origChans_all", "A single segment/compartment cell")
allCells.append(a_OrigChansCellGroup[$1])
}
for i = 0, n_OrigChansCellGroup-1 {
addCell_OrigChansCellGroup(i)
n_OrigChansCellGroup_local = n_OrigChansCellGroup_local +1
}
// Placing these cells in a region described by: Rectangular Box from point: (0.0, 0.0, 0.0) to (100.0, 50.0, 100.0)
// Packing has been generated by: Random: num: 1, edge: 1, overlap: 1, other overlap: 0
{a_OrigChansCellGroup[0].position(28.38983,23.009413,20.715052)}
//////////////////////////////////////////////////////////////////////
// Setting initial parameters
//////////////////////////////////////////////////////////////////////
strdef simConfig
{simConfig = "Default Simulation Configuration"}
{celsius = 37.0}
proc initialiseValues0() {
// Setting initial vals in cell group: SampleCellGroup which has 1 cells
// Giving all cells an initial potential of: -68.0
for i = 0, n_SampleCellGroup-1 {
forsec a_SampleCellGroup[i].all v = -68.0
}
// Setting initial vals in cell group: OrigChansCellGroup which has 1 cells
// Giving all cells an initial potential of: -68.0
for i = 0, n_OrigChansCellGroup-1 {
forsec a_OrigChansCellGroup[i].all v = -68.0
}
}
objref fih0
{fih0 = new FInitializeHandler(0, "initialiseValues0()")}
//////////////////////////////////////////////////////////////////////
// Adding Network Connections
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// Adding 2 stimulation(s)
//////////////////////////////////////////////////////////////////////
{ n_stim_SampleIClamp = 1 }
objectvar stim_SampleIClamp[n_stim_SampleIClamp]
// Note: the stimulation was specified as being at a point 0.5 along segment: Soma
// in section: Soma. For NEURON, this translates to a point 0.5 along section: Soma
a_SampleCellGroup[0].Soma {
stim_SampleIClamp[0] = new CurrentClampExt(0.5)
stim_SampleIClamp[0].del = 100.0
stim_SampleIClamp[0].dur = 100.0
stim_SampleIClamp[0].amp = 0.1
stim_SampleIClamp[0].repeat = 0
}
{ n_stim_Input_0 = 1 }
objectvar stim_Input_0[n_stim_Input_0]
// Note: the stimulation was specified as being at a point 0.5 along segment: Soma
// in section: Soma. For NEURON, this translates to a point 0.5 along section: Soma
a_OrigChansCellGroup[0].Soma {
stim_Input_0[0] = new CurrentClampExt(0.5)
stim_Input_0[0].del = 100.0
stim_Input_0[0].dur = 100.0
stim_Input_0[0].amp = 0.1
stim_Input_0[0].repeat = 0
}
access SomaOnly_all[0].Soma
//////////////////////////////////////////////////////////////////////
// Settings for running the demo
//////////////////////////////////////////////////////////////////////
tstop = 300.0
dt = 0.005
steps_per_ms = 200.0
//////////////////////////////////////////////////////////////////////
// Adding 14 plot(s)
//////////////////////////////////////////////////////////////////////
// This code pops up a plot of a_OrigChansCellGroup[0].Soma.v(0.5)
objref GraphWin_2
GraphWin_2 = new Graph(0)
{GraphWin_2.size(0, tstop,-90.0,50.0)}
{GraphWin_2.view(0, -90.0, tstop, 140.0, 80, 330, 330, 250)}
{
GraphWin_2.addexpr("a_OrigChansCellGroup[0].Soma.v", "a_OrigChansCellGroup[0].Soma.v(0.5)", 1, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_2)
}
// This code pops up a plot of a_SampleCellGroup[0].Soma.v(0.5)
{
GraphWin_2.addexpr("a_SampleCellGroup[0].Soma.v", "a_SampleCellGroup[0].Soma.v(0.5)", 2, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_2)
}
// This code pops up a plot of a_OrigChansCellGroup[0].Soma.z_K2_nmodl(0.5)
objref GraphWin_8
GraphWin_8 = new Graph(0)
{GraphWin_8.size(0, tstop,0.0,1.0)}
{GraphWin_8.view(0, 0.0, tstop, 1.0, 80, 330, 330, 250)}
{
GraphWin_8.addexpr("a_OrigChansCellGroup[0].Soma.z_K2_nmodl", "a_OrigChansCellGroup[0].Soma.z_K2_nmodl(0.5)", 1, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_8)
}
// This code pops up a plot of a_OrigChansCellGroup[0].Soma.m_K2_nmodl(0.5)
{
GraphWin_8.addexpr("a_OrigChansCellGroup[0].Soma.m_K2_nmodl", "a_OrigChansCellGroup[0].Soma.m_K2_nmodl(0.5)", 2, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_8)
}
// This code pops up a plot of a_SampleCellGroup[0].Soma.z_K2(0.5)
{
GraphWin_8.addexpr("a_SampleCellGroup[0].Soma.z_K2", "a_SampleCellGroup[0].Soma.z_K2(0.5)", 3, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_8)
}
// This code pops up a plot of a_SampleCellGroup[0].Soma.m_K2(0.5)
{
GraphWin_8.addexpr("a_SampleCellGroup[0].Soma.m_K2", "a_SampleCellGroup[0].Soma.m_K2(0.5)", 4, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_8)
}
// This code pops up a plot of a_OrigChansCellGroup[0].Soma.ica(0.5)
objref GraphWin_7
GraphWin_7 = new Graph(0)
{GraphWin_7.size(0, tstop,-0.4,0.02)}
{GraphWin_7.view(0, -0.4, tstop, 0.42000002, 80, 330, 330, 250)}
{
GraphWin_7.addexpr("a_OrigChansCellGroup[0].Soma.ica", "a_OrigChansCellGroup[0].Soma.ica(0.5)", 1, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_7)
}
// This code pops up a plot of a_SampleCellGroup[0].Soma.ica(0.5)
{
GraphWin_7.addexpr("a_SampleCellGroup[0].Soma.ica", "a_SampleCellGroup[0].Soma.ica(0.5)", 2, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_7)
}
// This code pops up a plot of a_OrigChansCellGroup[0].Soma.cai(0.5)
objref GraphWin_6
GraphWin_6 = new Graph(0)
{GraphWin_6.size(0, tstop,0.0,0.01)}
{GraphWin_6.view(0, 0.0, tstop, 0.01, 80, 330, 330, 250)}
{
GraphWin_6.addexpr("a_OrigChansCellGroup[0].Soma.cai", "a_OrigChansCellGroup[0].Soma.cai(0.5)", 1, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_6)
}
// This code pops up a plot of a_SampleCellGroup[0].Soma.cai(0.5)
{
GraphWin_6.addexpr("a_SampleCellGroup[0].Soma.cai", "a_SampleCellGroup[0].Soma.cai(0.5)", 2, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_6)
}
// This code pops up a plot of a_OrigChansCellGroup[0].Soma.h_CaP_nmodl(0.5)
objref GraphWin_5
GraphWin_5 = new Graph(0)
{GraphWin_5.size(0, tstop,0.0,1.0)}
{GraphWin_5.view(0, 0.0, tstop, 1.0, 80, 330, 330, 250)}
{
GraphWin_5.addexpr("a_OrigChansCellGroup[0].Soma.h_CaP_nmodl", "a_OrigChansCellGroup[0].Soma.h_CaP_nmodl(0.5)", 1, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_5)
}
// This code pops up a plot of a_OrigChansCellGroup[0].Soma.m_CaP_nmodl(0.5)
{
GraphWin_5.addexpr("a_OrigChansCellGroup[0].Soma.m_CaP_nmodl", "a_OrigChansCellGroup[0].Soma.m_CaP_nmodl(0.5)", 2, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_5)
}
// This code pops up a plot of a_SampleCellGroup[0].Soma.h_CaP(0.5)
{
GraphWin_5.addexpr("a_SampleCellGroup[0].Soma.h_CaP", "a_SampleCellGroup[0].Soma.h_CaP(0.5)", 3, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_5)
}
// This code pops up a plot of a_SampleCellGroup[0].Soma.m_CaP(0.5)
{
GraphWin_5.addexpr("a_SampleCellGroup[0].Soma.m_CaP", "a_SampleCellGroup[0].Soma.m_CaP(0.5)", 4, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_5)
}
//////////////////////////////////////////////////////////////////////
// Adding blocks of native NEURON code
//////////////////////////////////////////////////////////////////////
// Hoc commands to run at location: Type 2, Before return from finitialize()
objref fih_2
fih_2 = new FInitializeHandler(2.0, "callfi2()")
proc callfi2() {
forall if (ismembrane("na_ion")) {
print "Rev pot of na being changed for section ", secname()
ena = 45
}
forall if (ismembrane("k_ion")) {
print "Rev pot of k being changed for section ", secname()
ek = -85
}
forall if (ismembrane("ca_ion")) {
print "Rev pot of k being changed for section ", secname()
// Should be: cai = 4e-5
cai = 4e-5
cao = 2.4
eca = 12.5*log(cao/cai)
ion_style("ca_ion", 1, 1, 0, 0, 0)
}
}
// End of hoc commands to run at location: Type 2, Before return from finitialize()
//////////////////////////////////////////////////////////////////////
// This will run a full simulation of 60001 steps when the hoc file is executed
//////////////////////////////////////////////////////////////////////
// Recording 14 variable(s)
objref v_time
objref f_time
objref propsFile
v_time = new Vector()
{ v_time.record(&t) }
{ v_time.resize(60001) }
f_time = new File()
// Saving VOLTAGE on only one seg, id: 0, in the only cell in OrigChansCellGroup
// Creating vector for segment: Soma(ID: 0)
objref v_OrigChansCellGroup_seg_Soma_v[1]
for i=0, 0 {
{ v_OrigChansCellGroup_seg_Soma_v[i] = new Vector() }
{ v_OrigChansCellGroup_seg_Soma_v[i].record(&a_OrigChansCellGroup[i].Soma.v(0.5))}
{ v_OrigChansCellGroup_seg_Soma_v[i].resize(60001) }
}
objref f_OrigChansCellGroup_seg_Soma_v[1]
// Saving VOLTAGE on only one seg, id: 0, in the only cell in SampleCellGroup
// Creating vector for segment: Soma(ID: 0)
objref v_SampleCellGroup_seg_Soma_v[1]
for i=0, 0 {
{ v_SampleCellGroup_seg_Soma_v[i] = new Vector() }
{ v_SampleCellGroup_seg_Soma_v[i].record(&a_SampleCellGroup[i].Soma.v(0.5))}
{ v_SampleCellGroup_seg_Soma_v[i].resize(60001) }
}
objref f_SampleCellGroup_seg_Soma_v[1]
// Saving K2_nmodl:z on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl
{ v_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl = new Vector() }
{ v_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl.record(&a_OrigChansCellGroup[0].Soma.z_K2_nmodl(0.5)) }
{ v_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl.resize(60001) }
objref f_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl
// Saving K2_nmodl:m on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl
{ v_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl = new Vector() }
{ v_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl.record(&a_OrigChansCellGroup[0].Soma.m_K2_nmodl(0.5)) }
{ v_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl.resize(60001) }
objref f_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl
// Saving K2:z on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_SampleCellGroup_cn0_seg_Soma_z_K2
{ v_SampleCellGroup_cn0_seg_Soma_z_K2 = new Vector() }
{ v_SampleCellGroup_cn0_seg_Soma_z_K2.record(&a_SampleCellGroup[0].Soma.z_K2(0.5)) }
{ v_SampleCellGroup_cn0_seg_Soma_z_K2.resize(60001) }
objref f_SampleCellGroup_cn0_seg_Soma_z_K2
// Saving K2:m on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_SampleCellGroup_cn0_seg_Soma_m_K2
{ v_SampleCellGroup_cn0_seg_Soma_m_K2 = new Vector() }
{ v_SampleCellGroup_cn0_seg_Soma_m_K2.record(&a_SampleCellGroup[0].Soma.m_K2(0.5)) }
{ v_SampleCellGroup_cn0_seg_Soma_m_K2.resize(60001) }
objref f_SampleCellGroup_cn0_seg_Soma_m_K2
// Saving ica on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_OrigChansCellGroup_cn0_seg_Soma_ica
{ v_OrigChansCellGroup_cn0_seg_Soma_ica = new Vector() }
{ v_OrigChansCellGroup_cn0_seg_Soma_ica.record(&a_OrigChansCellGroup[0].Soma.ica(0.5)) }
{ v_OrigChansCellGroup_cn0_seg_Soma_ica.resize(60001) }
objref f_OrigChansCellGroup_cn0_seg_Soma_ica
// Saving CaP:CURR_DENS:ca on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_SampleCellGroup_cn0_seg_Soma_ica
{ v_SampleCellGroup_cn0_seg_Soma_ica = new Vector() }
{ v_SampleCellGroup_cn0_seg_Soma_ica.record(&a_SampleCellGroup[0].Soma.ica(0.5)) }
{ v_SampleCellGroup_cn0_seg_Soma_ica.resize(60001) }
objref f_SampleCellGroup_cn0_seg_Soma_ica
// Saving cai on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_OrigChansCellGroup_cn0_seg_Soma_cai
{ v_OrigChansCellGroup_cn0_seg_Soma_cai = new Vector() }
{ v_OrigChansCellGroup_cn0_seg_Soma_cai.record(&a_OrigChansCellGroup[0].Soma.cai(0.5)) }
{ v_OrigChansCellGroup_cn0_seg_Soma_cai.resize(60001) }
objref f_OrigChansCellGroup_cn0_seg_Soma_cai
// Saving cad:CONC:ca on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_SampleCellGroup_cn0_seg_Soma_cai
{ v_SampleCellGroup_cn0_seg_Soma_cai = new Vector() }
{ v_SampleCellGroup_cn0_seg_Soma_cai.record(&a_SampleCellGroup[0].Soma.cai(0.5)) }
{ v_SampleCellGroup_cn0_seg_Soma_cai.resize(60001) }
objref f_SampleCellGroup_cn0_seg_Soma_cai
// Saving CaP_nmodl:h on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl
{ v_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl = new Vector() }
{ v_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl.record(&a_OrigChansCellGroup[0].Soma.h_CaP_nmodl(0.5)) }
{ v_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl.resize(60001) }
objref f_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl
// Saving CaP_nmodl:m on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl
{ v_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl = new Vector() }
{ v_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl.record(&a_OrigChansCellGroup[0].Soma.m_CaP_nmodl(0.5)) }
{ v_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl.resize(60001) }
objref f_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl
// Saving CaP:h on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_SampleCellGroup_cn0_seg_Soma_h_CaP
{ v_SampleCellGroup_cn0_seg_Soma_h_CaP = new Vector() }
{ v_SampleCellGroup_cn0_seg_Soma_h_CaP.record(&a_SampleCellGroup[0].Soma.h_CaP(0.5)) }
{ v_SampleCellGroup_cn0_seg_Soma_h_CaP.resize(60001) }
objref f_SampleCellGroup_cn0_seg_Soma_h_CaP
// Saving CaP:m on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Creating vector for segment: Soma(ID: 0) in cell number: 0
objref v_SampleCellGroup_cn0_seg_Soma_m_CaP
{ v_SampleCellGroup_cn0_seg_Soma_m_CaP = new Vector() }
{ v_SampleCellGroup_cn0_seg_Soma_m_CaP.record(&a_SampleCellGroup[0].Soma.m_CaP(0.5)) }
{ v_SampleCellGroup_cn0_seg_Soma_m_CaP.resize(60001) }
objref f_SampleCellGroup_cn0_seg_Soma_m_CaP
strdef simReference
simReference = "Sim_672"
strdef simsDir
simsDir = "/Users/hashmup/nC_projects/PurkinjeCell.ncx/simulations/"
// Note: to change location of the generated simulation files, just change value of targetDir
// e.g. targetDir="" or targetDir="aSubDir/"
strdef targetDir
{ sprint(targetDir, "%s%s/", simsDir, simReference)}
// Single simulation run...
strdef date
// Note: not showing date/time of start/stop of simulation. This requires Cygwin to be installed// which includes the "date" unix command. Install under c:\cygwin
setuptime = stopsw()
print "Setup time for simulation: ",setuptime," seconds"
print "Starting simulation of duration ",tstop,"ms, dt: ",dt,"ms, reference: ",simReference,""
{currenttime = startsw()}
//////////////////////////////////////////////////////////////////////
// Main run statement
//////////////////////////////////////////////////////////////////////
{run()}
{realruntime = startsw() - currenttime}
print "Finished simulation in ", realruntime ,"seconds"
print "Storing the data..."
strdef timeFilename
// Saving VOLTAGE on only one seg, id: 0, in the only cell in OrigChansCellGroup
// Saving vector for segment: Soma(ID: 0)
for i=0, 0 {
f_OrigChansCellGroup_seg_Soma_v[i] = new File()
strdef filename
{sprint(filename, "%sOrigChansCellGroup_%d.dat", targetDir, i)}
f_OrigChansCellGroup_seg_Soma_v[i].wopen(filename)
v_OrigChansCellGroup_seg_Soma_v[i].printf(f_OrigChansCellGroup_seg_Soma_v[i])
f_OrigChansCellGroup_seg_Soma_v[i].close()
}
// Saving VOLTAGE on only one seg, id: 0, in the only cell in SampleCellGroup
// Saving vector for segment: Soma(ID: 0)
for i=0, 0 {
f_SampleCellGroup_seg_Soma_v[i] = new File()
strdef filename
{sprint(filename, "%sSampleCellGroup_%d.dat", targetDir, i)}
f_SampleCellGroup_seg_Soma_v[i].wopen(filename)
v_SampleCellGroup_seg_Soma_v[i].printf(f_SampleCellGroup_seg_Soma_v[i])
f_SampleCellGroup_seg_Soma_v[i].close()
}
// Saving K2_nmodl:z on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl = new File()
strdef filename
{sprint(filename, "%sOrigChansCellGroup_%d.K2_nmodl_z.dat", targetDir, 0)}
{f_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl.wopen(filename)}
{v_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl.printf(f_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl)}
{f_OrigChansCellGroup_cn0_seg_Soma_z_K2_nmodl.close()}
// Saving K2_nmodl:m on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl = new File()
strdef filename
{sprint(filename, "%sOrigChansCellGroup_%d.K2_nmodl_m.dat", targetDir, 0)}
{f_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl.wopen(filename)}
{v_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl.printf(f_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl)}
{f_OrigChansCellGroup_cn0_seg_Soma_m_K2_nmodl.close()}
// Saving K2:z on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_SampleCellGroup_cn0_seg_Soma_z_K2 = new File()
strdef filename
{sprint(filename, "%sSampleCellGroup_%d.K2_z.dat", targetDir, 0)}
{f_SampleCellGroup_cn0_seg_Soma_z_K2.wopen(filename)}
{v_SampleCellGroup_cn0_seg_Soma_z_K2.printf(f_SampleCellGroup_cn0_seg_Soma_z_K2)}
{f_SampleCellGroup_cn0_seg_Soma_z_K2.close()}
// Saving K2:m on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_SampleCellGroup_cn0_seg_Soma_m_K2 = new File()
strdef filename
{sprint(filename, "%sSampleCellGroup_%d.K2_m.dat", targetDir, 0)}
{f_SampleCellGroup_cn0_seg_Soma_m_K2.wopen(filename)}
{v_SampleCellGroup_cn0_seg_Soma_m_K2.printf(f_SampleCellGroup_cn0_seg_Soma_m_K2)}
{f_SampleCellGroup_cn0_seg_Soma_m_K2.close()}
// Saving ica on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_OrigChansCellGroup_cn0_seg_Soma_ica = new File()
strdef filename
{sprint(filename, "%sOrigChansCellGroup_%d.ica.dat", targetDir, 0)}
{f_OrigChansCellGroup_cn0_seg_Soma_ica.wopen(filename)}
{v_OrigChansCellGroup_cn0_seg_Soma_ica.printf(f_OrigChansCellGroup_cn0_seg_Soma_ica)}
{f_OrigChansCellGroup_cn0_seg_Soma_ica.close()}
// Saving CaP:CURR_DENS:ca on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_SampleCellGroup_cn0_seg_Soma_ica = new File()
strdef filename
{sprint(filename, "%sSampleCellGroup_%d.CaP_CURR_DENS_ca.dat", targetDir, 0)}
{f_SampleCellGroup_cn0_seg_Soma_ica.wopen(filename)}
{v_SampleCellGroup_cn0_seg_Soma_ica.printf(f_SampleCellGroup_cn0_seg_Soma_ica)}
{f_SampleCellGroup_cn0_seg_Soma_ica.close()}
// Saving cai on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_OrigChansCellGroup_cn0_seg_Soma_cai = new File()
strdef filename
{sprint(filename, "%sOrigChansCellGroup_%d.cai.dat", targetDir, 0)}
{f_OrigChansCellGroup_cn0_seg_Soma_cai.wopen(filename)}
{v_OrigChansCellGroup_cn0_seg_Soma_cai.printf(f_OrigChansCellGroup_cn0_seg_Soma_cai)}
{f_OrigChansCellGroup_cn0_seg_Soma_cai.close()}
// Saving cad:CONC:ca on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_SampleCellGroup_cn0_seg_Soma_cai = new File()
strdef filename
{sprint(filename, "%sSampleCellGroup_%d.cad_CONC_ca.dat", targetDir, 0)}
{f_SampleCellGroup_cn0_seg_Soma_cai.wopen(filename)}
{v_SampleCellGroup_cn0_seg_Soma_cai.printf(f_SampleCellGroup_cn0_seg_Soma_cai)}
{f_SampleCellGroup_cn0_seg_Soma_cai.close()}
// Saving CaP_nmodl:h on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl = new File()
strdef filename
{sprint(filename, "%sOrigChansCellGroup_%d.CaP_nmodl_h.dat", targetDir, 0)}
{f_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl.wopen(filename)}
{v_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl.printf(f_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl)}
{f_OrigChansCellGroup_cn0_seg_Soma_h_CaP_nmodl.close()}
// Saving CaP_nmodl:m on only one seg, id: 0, in only cell: 0 in OrigChansCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl = new File()
strdef filename
{sprint(filename, "%sOrigChansCellGroup_%d.CaP_nmodl_m.dat", targetDir, 0)}
{f_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl.wopen(filename)}
{v_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl.printf(f_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl)}
{f_OrigChansCellGroup_cn0_seg_Soma_m_CaP_nmodl.close()}
// Saving CaP:h on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_SampleCellGroup_cn0_seg_Soma_h_CaP = new File()
strdef filename
{sprint(filename, "%sSampleCellGroup_%d.CaP_h.dat", targetDir, 0)}
{f_SampleCellGroup_cn0_seg_Soma_h_CaP.wopen(filename)}
{v_SampleCellGroup_cn0_seg_Soma_h_CaP.printf(f_SampleCellGroup_cn0_seg_Soma_h_CaP)}
{f_SampleCellGroup_cn0_seg_Soma_h_CaP.close()}
// Saving CaP:m on only one seg, id: 0, in only cell: 0 in SampleCellGroup
// Saving vector for segment: Soma(ID: 0) in cell number: 0
f_SampleCellGroup_cn0_seg_Soma_m_CaP = new File()
strdef filename
{sprint(filename, "%sSampleCellGroup_%d.CaP_m.dat", targetDir, 0)}
{f_SampleCellGroup_cn0_seg_Soma_m_CaP.wopen(filename)}
{v_SampleCellGroup_cn0_seg_Soma_m_CaP.printf(f_SampleCellGroup_cn0_seg_Soma_m_CaP)}
{f_SampleCellGroup_cn0_seg_Soma_m_CaP.close()}
{ sprint(timeFilename, "%s%s", targetDir, "time.dat")}
{ f_time.wopen(timeFilename) }
{ v_time.printf(f_time) }
{ f_time.close() }
{savetime = stopsw()}
propsFile = new File()
strdef propsFilename
{sprint(propsFilename, "%ssimulator.props", targetDir)}
{propsFile.wopen(propsFilename)}
{propsFile.printf("#This is a list of properties generated by NEURON during the simulation run\n")}
{propsFile.printf("Host=%s\n", host)}
{propsFile.printf("RealSimulationTime=%g\n", realruntime)}
{propsFile.printf("SimulationSaveTime=%g\n", savetime)}
{propsFile.printf("SimulationSetupTime=%g\n", setuptime)}
{propsFile.printf("NEURONversion=%s\n", nrnversion())}
{propsFile.close()}
print "Data stored in ",savetime, "secs in directory: ", targetDir
// This code pops up a simple Run Control
{
xpanel("RunControl", 0)
v_init = -60.0
xbutton("Init & Run","run()")
xbutton("Stop","stoprun=1")
t = 0
xvalue("t","t", 2 )
tstop = 300.0
xvalue("Tstop","tstop", 1,"tstop_changed()", 0, 1 )
dt = 0.005
xvalue("dt","dt", 1,"setdt()", 0, 1 )
xpanel(80,80)
}