-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cells.xml
1156 lines (765 loc) · 51.1 KB
/
Cells.xml
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
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Lems xmlns="http://www.neuroml.org/lems/0.7.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.neuroml.org/lems/0.7.1 ../../LEMS/Schemas/LEMS/LEMS_v0.7.1.xsd"
description="Defines both abstract cell models (e.g. _izhikevichCell_, adaptive exponential integrate and fire cell, _adExIaFCell_), point conductance based cell models (_pointCellCondBased_, _pointCellCondBasedCa_) and cells models (_cell_) which specify the _morphology_ (containing _segment_s) and _biophysicalProperties_ separately.">
<!-- A number of cell types for use in NeuroML 2 documents -->
<Include file="NeuroMLCoreDimensions.xml"/>
<Include file="Channels.xml"/>
<Include file="Synapses.xml"/>
<Include file="Inputs.xml"/>
<ComponentType name="baseCell"
description="Base type of any cell which can be used in a population">
<Child name="notes" type="notes"/>
</ComponentType>
<ComponentType name="baseSpikingCell"
extends="baseCell"
description="Base type of any cell which can emit _spike events.">
<EventPort name="spike" direction="out" description="Spike event"/>
</ComponentType>
<ComponentType name="baseCellMembPot"
extends="baseSpikingCell"
description="Any spiking cell which has a membrane potential _v with voltage units.">
<Exposure name="v" dimension="voltage" description="Membrane potential"/>
</ComponentType>
<ComponentType name="baseCellMembPotDL"
extends="baseSpikingCell"
description="Any spiking cell which has a dimensioness membrane potential, _V.">
<Exposure name="V" dimension="none" description="Membrane potential"/>
</ComponentType>
<ComponentType name="baseChannelPopulation"
extends="baseVoltageDepPointCurrent"
description="Base type for any current produced by a population of channels, all of type _ionChannel">
<ComponentReference name="ionChannel" type="baseIonChannel"/>
</ComponentType>
<ComponentType name="channelPopulation"
extends="baseChannelPopulation"
description="Population of _number ohmic ion channels. These each produce a conductance _channelg across a reversal potential _erev, giving a total current _i.">
<Parameter name="number" dimension="none"/>
<Parameter name="erev" dimension="voltage"/>
<ComponentReference name="ionChannel" type="baseIonChannel"/>
<Text name="ion"/> <!-- TODO: Ideally this needs to be a property of ionChannel only! But it's here as it makes it easier to select channelPopulations transmitting specific ions...-->
<Dynamics>
<DerivedVariable name="channelg" dimension="conductance" select="ionChannel/g"/>
<DerivedVariable name="geff" dimension="conductance" value="channelg * number"/>
<DerivedVariable name="i" dimension="current" exposure="i" value="geff * (erev - v)"/>
</Dynamics>
<Structure>
<ChildInstance component="ionChannel"/>
</Structure>
</ComponentType>
<ComponentType name="channelPopulationNernst"
extends="baseChannelPopulation"
description="Population of channels with a time varying reversal potential _erev determined by Nernst equation. Hard coded for Ca only! Work in progress!!">
<Parameter name="number" dimension="none"/>
<Constant name="R" dimension="idealGasConstantDims" value="8.3144621 J_per_K_per_mol" description="TODO: Make this a global constant!"/>
<Constant name="zCa" dimension="none" value="2" description="TODO: Make this a global constant!"/>
<Constant name="F" dimension="charge_per_mole" value="96485.3 C_per_mol" description="TODO: Make this a global constant!"/>
<ComponentReference name="ionChannel" type="baseIonChannel"/>
<Exposure name="erev" dimension="voltage"/> <!-- Calculated from caConcExt and caConc-->
<Requirement name="temperature" dimension="temperature"/>
<Requirement name="caConc" dimension="concentration"/>
<Requirement name="caConcExt" dimension="concentration"/>
<Text name="ion"/> <!-- TODO: Ideally this needs to be a property of ionChannel only! But it's here as it makes it easier to select channelPopulations transmitting specific ions...-->
<Dynamics>
<DerivedVariable name="singleChannelConductance" dimension="conductance" select="ionChannel/g"/>
<DerivedVariable name="totalConductance" dimension="conductance" value="singleChannelConductance * number"/>
<DerivedVariable name="erev" dimension="voltage" exposure="erev" value="(R * temperature / (zCa * F)) * log(caConcExt / caConc)"/>
<!--TODO: see if the check on caconcext needed: DerivedVariable name="i" dimension="current" exposure="i" value="totalConductance * (erev - v)" valueCondition="caConcExt .gt. 0" valueIfFalse="0"/> -->
<DerivedVariable name="i" dimension="current" exposure="i" value="totalConductance * (erev - v)"/>
</Dynamics>
<Structure>
<ChildInstance component="ionChannel"/>
</Structure>
</ComponentType>
<ComponentType name="baseChannelDensity"
description="Base type for current distributed on an area of a cell">
<ComponentReference name="ionChannel" type="baseIonChannel"/>
<Exposure name="iDensity" dimension="currentDensity"/>
<Requirement name="v" dimension="voltage"/>
</ComponentType>
<ComponentType name="baseChannelDensityCond"
description="Base type for distributed conductances on an area of a cell producing a (not necessarily ohmic) current"
extends="baseChannelDensity">
<Parameter name="condDensity" dimension="conductanceDensity"/>
<Exposure name="gDensity" dimension="conductanceDensity"/>
</ComponentType>
<ComponentType name="variableParameter"
description="Specifies a parameter which can vary its value across a _segmentGroup">
<Child name="inhomogeneousValue" type="inhomogeneousValue"/>
<Text name="parameter"/>
<Text name="segmentGroup"/>
</ComponentType>
<ComponentType name="inhomogeneousValue"
description="Specifies the value of a _variableParameter_">
<Text name="inhomogeneousParameter"/>
<Text name="value"/>
</ComponentType>
<ComponentType name="channelDensityNonUniform"
extends="baseChannelDensity"
description="Specifies a time varying ohmic conductance density, which is distributed on a region of the cell. The conductance density of the channel is not uniform, but is set using the _variableParameter_. Note, there is no dynamical description of this in LEMS yet, as this type only makes sense for multicompartmental cells. A ComponentType for this needs to be present to enable export of NeuroML 2 multicompartmental cells via LEMS/jNeuroML to NEURON">
<Parameter name="erev" dimension="voltage"/>
<Child name="variableParameter" type="variableParameter"/>
<!-- TODO: Ensure Text elements are inherited from base type -->
<Text name="segmentGroup"/>
<Text name="ion"/> <!-- TODO: Ideally this needs to be a property of ionChannel only!
But it's here as it makes it easier to select channelPopulations transmitting specific ions...-->
<Dynamics>
<!--<DerivedVariable name="iDensity" dimension="currentDensity" exposure="iDensity" value="0"/>-->
</Dynamics>
<Structure>
<ChildInstance component="ionChannel"/>
</Structure>
</ComponentType>
<ComponentType name="channelDensityNonUniformNernst"
extends="baseChannelDensity"
description="Specifies a time varying conductance density, which is distributed on a region of the cell, and whose reversal potential is calculated from the Nernst equation. Hard coded for Ca only!. The conductance density of the channel is not uniform, but is set using the _variableParameter_. Note, there is no dynamical description of this in LEMS yet, as this type only makes sense for multicompartmental cells. A ComponentType for this needs to be present to enable export of NeuroML 2 multicompartmental cells via LEMS/jNeuroML to NEURON">
<Child name="variableParameter" type="variableParameter"/>
<!-- TODO: Ensure Text elements are inherited from base type -->
<Text name="segmentGroup"/>
<Text name="ion"/> <!-- TODO: Ideally this needs to be a property of ionChannel only!
But it's here as it makes it easier to select channelPopulations transmitting specific ions...-->
<Dynamics>
<!--<DerivedVariable name="iDensity" dimension="currentDensity" exposure="iDensity" value="0"/>-->
</Dynamics>
<Structure>
<ChildInstance component="ionChannel"/>
</Structure>
</ComponentType>
<ComponentType name="channelDensity"
extends="baseChannelDensityCond"
description="Specifies a time varying ohmic conductance density, _gDensity, which is distributed on an area of the cell with fixed reversal potential _erev producing a current density _iDensity">
<Parameter name="erev" dimension="voltage"/>
<!-- TODO: Ensure Text elements are inherited from base type -->
<Text name="segmentGroup"/>
<Text name="ion"/> <!-- TODO: Ideally this needs to be a property of ionChannel only!
But it's here as it makes it easier to select channelPopulations transmitting specific ions...-->
<Dynamics>
<DerivedVariable name="channelf" dimension="none" select="ionChannel/fopen"/>
<DerivedVariable name="gDensity" dimension="conductanceDensity" exposure="gDensity" value="condDensity * channelf"/>
<DerivedVariable name="iDensity" dimension="currentDensity" exposure="iDensity" value="gDensity * (erev - v)"/>
</Dynamics>
<Structure>
<ChildInstance component="ionChannel"/>
</Structure>
</ComponentType>
<ComponentType name="channelDensityNernst"
extends="baseChannelDensityCond"
description="Specifies a time varying conductance density, _gDensity, which is distributed on an area of the cell, producing a current density _iDensity and whose reversal potential is calculated from the Nernst equation. Hard coded for Ca only!">
<Constant name="R" dimension="idealGasConstantDims" value="8.3144621 J_per_K_per_mol" description="TODO: Make this a global constant!"/>
<Constant name="zCa" dimension="none" value="2" description="TODO: Make this a global constant!"/>
<Constant name="F" dimension="charge_per_mole" value="96485.3 C_per_mol" description="TODO: Make this a global constant!"/>
<ComponentReference name="ionChannel" type="baseIonChannel"/>
<Exposure name="erev" dimension="voltage"/> <!-- Calculated from caConcExt and caConc-->
<Requirement name="temperature" dimension="temperature"/>
<Requirement name="caConc" dimension="concentration"/>
<Requirement name="caConcExt" dimension="concentration"/>
<!-- TODO: Ensure Text elements are inherited from base type -->
<Text name="segmentGroup"/>
<Text name="ion"/> <!-- TODO: Ideally this needs to be a property of ionChannel only!
But it's here as it makes it easier to select channelPopulations transmitting specific ions...-->
<Dynamics>
<DerivedVariable name="channelf" dimension="none" select="ionChannel/fopen"/>
<ConditionalDerivedVariable name="gDensity" dimension="conductanceDensity" exposure="gDensity">
<Case condition="caConcExt .gt. 0" value="condDensity * channelf"/>
<Case condition="caConcExt .leq. 0" value="0"/>
</ConditionalDerivedVariable>
<ConditionalDerivedVariable name="erev" dimension="voltage" exposure="erev">
<Case condition="caConcExt .gt. 0" value="(R * temperature / (zCa * F)) * log(caConcExt / caConc)"/>
<Case condition="caConcExt .leq. 0" value="0"/>
</ConditionalDerivedVariable>
<!-- TODO check if needed <DerivedVariable name="iDensity" dimension="currentDensity" exposure="iDensity"
value="gDensity * (erev - v)" valueCondition="caConcExt .gt. 0" valueIfFalse="0"/> -->
<ConditionalDerivedVariable name="iDensity" dimension="currentDensity" exposure="iDensity">
<Case condition="caConcExt .gt. 0" value="gDensity * (erev - v)"/>
<Case condition="caConcExt .leq. 0" value="0"/>
</ConditionalDerivedVariable>
</Dynamics>
<Structure>
<ChildInstance component="ionChannel"/>
</Structure>
</ComponentType>
<ComponentType name="channelDensityGHK"
extends="baseChannelDensity"
description="Specifies a time varying conductance density, _gDensity, which is distributed on an area of the cell, producing a current density _iDensity and whose reversal potential is calculated from the Goldman Hodgkin Katz equation. Hard coded for Ca only! Work in progress!">
<Parameter name="permeability" dimension="permeability"/>
<Constant name="R" dimension="idealGasConstantDims" value="8.3144621 J_per_K_per_mol" description="TODO: Make this a global constant!"/>
<Constant name="zCa" dimension="none" value="2" description="TODO: Make this a global constant!"/>
<Constant name="F" dimension="charge_per_mole" value="96485.3 C_per_mol" description="TODO: Make this a global constant!"/>
<ComponentReference name="ionChannel" type="baseIonChannel"/>
<Requirement name="temperature" dimension="temperature"/>
<Requirement name="caConc" dimension="concentration"/>
<Requirement name="caConcExt" dimension="concentration"/>
<!-- TODO: Ensure Text elements are inherited from base type -->
<Text name="segmentGroup"/>
<Text name="ion"/> <!-- TODO: Ideally this needs to be a property of ionChannel only!
But it's here as it makes it easier to select channelPopulations transmitting specific ions...-->
<Dynamics>
<DerivedVariable name="K" dimension="per_voltage" value="(zCa * F) / (R * temperature)"/>
<DerivedVariable name="expKv" dimension="none" value="exp(-1 * K * v)"/>
<DerivedVariable name="channelf" dimension="none" select="ionChannel/fopen"/>
<!--TODO: used conditional var, just as in nernst above, to circumvent problems with initialization. -->
<ConditionalDerivedVariable name="iDensity" dimension="currentDensity" exposure="iDensity">
<Case condition="caConcExt .gt. 0" value="-1 * channelf * permeability * zCa * F * K * v * ( caConc - (caConcExt * expKv) ) / (1 - expKv)"/>
<Case condition="caConcExt .leq. 0" value="0"/>
</ConditionalDerivedVariable>
</Dynamics>
<Structure>
<ChildInstance component="ionChannel"/>
</Structure>
</ComponentType>
<ComponentType name="pointCellCondBased"
extends="baseCellMembPotCap"
description="Simple model of a conductance based cell, with no separate morphology element, just an absolute capacitance _C, and a set of channel populations">
<Parameter name="v0" dimension="voltage"/> <!--TEMP: needs to be removed... -->
<Parameter name="thresh" dimension="voltage"/>
<Children name="populations" type="baseChannelPopulation"/>
<Attachments name="synapses" type="basePointCurrent"/>
<Dynamics>
<StateVariable name="v" exposure="v" dimension="voltage"/>
<StateVariable name="spiking" dimension="none"/>
<DerivedVariable name="iChannels" dimension="current" select="populations[*]/i" reduce="add"/>
<DerivedVariable name="iSyn" dimension="current" exposure="iSyn" select="synapses[*]/i" reduce="add" />
<DerivedVariable name="iMemb" dimension="current" exposure="iMemb" value="iChannels + iSyn"/>
<TimeDerivative variable="v" value="iMemb / C"/>
<OnStart>
<StateAssignment variable="v" value="v0"/>
<StateAssignment variable="spiking" value="0"/>
</OnStart>
<OnCondition test="v .gt. thresh .and. spiking .lt. 0.5">
<StateAssignment variable="spiking" value="1"/>
<EventOut port="spike"/>
</OnCondition>
<OnCondition test="v .lt. thresh">
<StateAssignment variable="spiking" value="0"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="pointCellCondBasedCa"
extends="baseCellMembPotCap"
description="TEMPORARY: Point cell with conductances and Ca concentration info. Not yet fully tested!!!">
<Parameter name="v0" dimension="voltage"/> <!--TEMP: needs to be removed... -->
<Parameter name="thresh" dimension="voltage"/>
<Children name="populations" type="baseChannelPopulation"/>
<Children name="concentrationModels" type="concentrationModel"/>
<Attachments name="synapses" type="basePointCurrent"/>
<Exposure name="iCa" dimension="current"/>
<Exposure name="caConc" dimension="concentration"/>
<Dynamics>
<StateVariable name="v" exposure="v" dimension="voltage"/>
<StateVariable name="spiking" dimension="none"/>
<DerivedVariable name="iChannels" dimension="current" select="populations[*]/i" reduce="add"/>
<DerivedVariable name="iCa" dimension="current" exposure="iCa" select="populations[ion='ca']/i" reduce="add"/>
<DerivedVariable name="caConc" dimension="concentration" exposure="caConc" select="concentrationModels[species='ca']/concentration" reduce="add"/>
<DerivedVariable name="iSyn" dimension="current" exposure="iSyn" select="synapses[*]/i" reduce="add" />
<DerivedVariable name="iMemb" dimension="current" exposure="iMemb" value="iChannels + iSyn"/>
<TimeDerivative variable="v" value="iMemb / C"/>
<OnStart>
<StateAssignment variable="v" value="v0"/>
<StateAssignment variable="spiking" value="0"/>
</OnStart>
<OnCondition test="v .gt. thresh .and. spiking .lt. 0.5">
<StateAssignment variable="spiking" value="1"/>
<EventOut port="spike"/>
</OnCondition>
<OnCondition test="v .lt. thresh">
<StateAssignment variable="spiking" value="0"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="distal"
extends="point3DWithDiam"
description="Point furthest from the soma in a segment">
</ComponentType>
<ComponentType name="proximal"
extends="point3DWithDiam"
description="Point closest to the soma in a segment. Note, if the proximal point is equal to the distal point of the parent segment, proximal can be omitted.">
</ComponentType>
<ComponentType name="parent"
description="Specifies the segment which is this segment's parent">
<Text name="segment"/>
<Text name="fractionAlong"/>
</ComponentType>
<ComponentType name="segment"
description="A segment defines the smallest unit within a possibly branching structure (_morphology_), such as a dendrite or axon. The shape is given by the _proximal_ and _distal_ points. If _proximal_ is missing, the proximal point is assumed to be the _distal_ point of the parent. _parent_ specifies the parent segment. The first segment (no _parent_) usually represents the soma. NOTE: LEMS does not yet support multicompartmental modelling, so the Dynamics here is only appropriate for single compartment modelling. ">
<Constant name="LEN" dimension="length" value="1m"/>
<Child name="parent" type="parent"/>
<Child name="distal" type="distal"/>
<Child name="proximal" type="proximal"/>
<Exposure name="surfaceArea" dimension="area"/>
<Exposure name="radDist" dimension="length"/>
<Exposure name="length" dimension="length"/>
<Text name="name"/>
<Dynamics>
<!-- TODO: make all of these derived params!! -->
<DerivedVariable name="radDist" dimension="length" exposure="radDist" select = "distal/radius"/>
<DerivedVariable name="dx" dimension="length" select = "distal/xLength"/>
<DerivedVariable name="dy" dimension="length" select = "distal/yLength"/>
<DerivedVariable name="dz" dimension="length" select = "distal/zLength"/>
<DerivedVariable name="px" dimension="length" select = "proximal/xLength"/>
<DerivedVariable name="py" dimension="length" select = "proximal/yLength"/>
<DerivedVariable name="pz" dimension="length" select = "proximal/zLength"/>
<DerivedVariable name="length" dimension="length" exposure="length" value = "sqrt(((dx - px) * (dx - px) + (dy - py) * (dy - py) + (dz - pz) * (dz - pz))/(LEN * LEN)) * LEN"/>
<!--<DerivedVariable name="surfaceArea" dimension="area" exposure="surfaceArea" value = "4 * radDist * radDist * 3.14159265" valueCondition="length .eq. 0" valueIfFalse = "2 * radDist * 3.14159265 * length"/>-->
<ConditionalDerivedVariable name="surfaceArea" dimension="area" exposure="surfaceArea">
<Case condition="length .eq. 0" value="4 * radDist * radDist * 3.14159265"/>
<Case condition="length .gt. 0" value="2 * radDist * 3.14159265 * length"/>
</ConditionalDerivedVariable>
</Dynamics>
</ComponentType>
<ComponentType name="segmentGroup" description="A method to describe a group of _segment_s in a _morphology_">
<Child name="notes" type="notes"/>
<Child name="annotation" type="annotation"/>
<Children name="members" type="member"/>
<Children name="paths" type="path"/>
<Children name="subTrees" type="subTree"/>
<Children name="includes" type="include"/> <!-- TODO deal with <include> used also for including ext NML files... -->
<Children name="inhomogeneousParameter" type="inhomogeneousParameter"/>
<Text name="neuroLexId"/>
</ComponentType>
<ComponentType name="member" description="A single identified _segment_ which is part of the _segmentGroup_">
<Text name="segment"/>
</ComponentType>
<ComponentType name="from" description="Specifies which _segment_ distal from which to calculate the _segmentGroup_">
<Text name="segment"/>
</ComponentType>
<ComponentType name="to" description="Specifies which _segment_ up to which to calculate the _segmentGroup_">
<Text name="segment"/>
</ComponentType>
<ComponentType name="include" description="Include all members of another _segmentGroup_ in this">
<Text name="href"/> <!--TODO: sort this!!! Needed since <include> is used to include external nml files!! -->
<Text name="segmentGroup"/>
</ComponentType>
<ComponentType name="path" description="Include all the segments between those specified by _from_ and _to_, inclusive">
<Child name="from" type="from"/>
<Child name="to" type="to"/>
</ComponentType>
<ComponentType name="subTree" description="Include all the segments distal to that specified by _from_ in the _segmentGroup_">
<Child name="from" type="from"/>
</ComponentType>
<ComponentType name="inhomogeneousParameter" description="An inhomogeneous parameter specified across the _segmentGroup_">
<Child name="proximal" type="proximalProperties"/>
<Child name="distal" type="distalProperties"/>
<Text name="variable"/>
<Text name="metric"/>
</ComponentType>
<ComponentType name="proximalProperties" description="What to do at the proximal point when creating an inhomogeneous parameter">
<Text name="translationStart"/>
</ComponentType>
<ComponentType name="distalProperties" description="What to do at the distal point when creating an inhomogeneous parameter">
<Text name="normalizationEnd"/>
</ComponentType>
<ComponentType name="morphology" description="The collection of _segment_s which specify the 3D structure of the cell, along with a number of _segmentGroup_s">
<Children name="segments" type="segment"/>
<Children name="segmentGroups" type="segmentGroup"/>
</ComponentType>
<ComponentType name="specificCapacitance"
description="Capacitance per unit area">
<Parameter name="value" dimension="specificCapacitance"/>
<Exposure name="totSpecCap" dimension="specificCapacitance"/>
<Dynamics>
<DerivedVariable name="totSpecCap" dimension="specificCapacitance" exposure="totSpecCap" value="value"/>
</Dynamics>
</ComponentType>
<ComponentType name="initMembPotential"
description="Explicitly set initial membrane potential for the cell">
<Parameter name="value" dimension="voltage"/>
</ComponentType>
<ComponentType name="spikeThresh"
description="Membrane potential at which to emit a spiking event. Note, usually the spiking event will not be emitted again until the membrane potential has fallen below this value and rises again to cross it in a positive direction">
<Parameter name="value" dimension="voltage"/>
</ComponentType>
<ComponentType name="membraneProperties"
description="Properties specific to the membrane, such as the _populations of channels, _channelDensities, _specificCapacitance, etc.">
<Child name="specificCapacitance" type="specificCapacitance"/>
<Child name="initMembPotential" type="initMembPotential"/> <!--TEMP: needs to be removed... -->
<Child name="spikeThresh" type="spikeThresh"/>
<Children name="populations" type="baseChannelPopulation"/>
<Children name="channelDensities" type="baseChannelDensity"/>
<Exposure name="totChanCurrent" dimension="current"/>
<Exposure name="iCa" dimension="current"/>
<Exposure name="totSpecCap" dimension="specificCapacitance"/>
<Requirement name="surfaceArea" dimension="area"/>
<Dynamics>
<DerivedVariable name="totSpecCap" dimension="specificCapacitance" exposure="totSpecCap" select="specificCapacitance/totSpecCap"/>
<DerivedVariable name="totChanPopCurrent" dimension="current" select="populations[*]/i" reduce="add"/>
<DerivedVariable name="totChanDensCurrentDensity" dimension="currentDensity" select="channelDensities[*]/iDensity" reduce="add"/>
<DerivedVariable name="totChanCurrent" dimension="current" exposure="totChanCurrent" value="totChanPopCurrent + (totChanDensCurrentDensity * surfaceArea)"/>
<DerivedVariable name="totChanPopCurrentCa" dimension="current" select="populations[ion='ca']/i" reduce="add"/>
<DerivedVariable name="totChanDensCurrentDensityCa" dimension="currentDensity" select="channelDensities[ion='ca']/iDensity" reduce="add"/>
<DerivedVariable name="iCa" dimension="current" exposure="iCa" value="totChanPopCurrentCa + (totChanDensCurrentDensityCa * surfaceArea)"/>
</Dynamics>
</ComponentType>
<ComponentType name="biophysicalProperties"
description="The biophysical properties of the _cell_, including the _membraneProperties_ and the _intracellularProperties_">
<Child name="membraneProperties" type="membraneProperties"/>
<Child name="intracellularProperties" type="intracellularProperties"/>
<Exposure name="totSpecCap" dimension="specificCapacitance"/>
<Dynamics>
<DerivedVariable name="totSpecCap" dimension="specificCapacitance" exposure="totSpecCap" select="membraneProperties/totSpecCap"/>
</Dynamics>
</ComponentType>
<ComponentType name="intracellularProperties"
description="Biophysical properties related to the intracellular space within the _cell_, such as the _resistivity_ and the list of _species_ present. _caConc and _caConcExt are explicitly exposed here to facilitate accessing these values from other Components, even though _caConcExt is clearly not an intracellular property">
<Child name="resistivity" type="resistivity"/>
<Children name="speciesList" type="species"/>
<Exposure name="caConc" dimension="concentration"/>
<Exposure name="caConcExt" dimension="concentration"/>
<Dynamics>
<DerivedVariable name="caConc" dimension="concentration" exposure="caConc" select="speciesList[ion='ca']/concentration" reduce="add" required="false"/>
<DerivedVariable name="caConcExt" dimension="concentration" exposure="caConcExt" select="speciesList[ion='ca']/extConcentration" reduce="add" required="false"/>
</Dynamics>
</ComponentType>
<ComponentType name="resistivity"
description="The resistivity, or specific axial resistance, of the cytoplasm">
<Parameter name="value" dimension="resistivity"/>
</ComponentType>
<ComponentType name="concentrationModel"
description="Base for any model of an _ion concentration which changes with time. Internal, _concentration, and external, _extConcentration, values for the concentration of the ion are given.">
<Exposure name="concentration" dimension="concentration"/>
<Exposure name="extConcentration" dimension="concentration"/>
<Requirement name="surfaceArea" dimension="area"/>
<Requirement name="initialConcentration" dimension="concentration"/>
<Requirement name="initialExtConcentration" dimension="concentration"/>
<Text name="ion"/>
<Dynamics>
<StateVariable name="concentration" exposure="concentration" dimension="concentration"/>
<StateVariable name="extConcentration" exposure="extConcentration" dimension="concentration"/>
<OnStart>
<StateAssignment variable="concentration" value="initialConcentration"/>
<StateAssignment variable="extConcentration" value="initialExtConcentration"/>
</OnStart>
</Dynamics>
</ComponentType>
<ComponentType name="decayingPoolConcentrationModel"
extends="concentrationModel"
description="Model of buffering of concentration of an _ion (currently hard coded to be calcium, due to requirement for _iCa) which has a baseline level _restingConc and tends to this value with time course _decayConstant. The ion is assumed to occupy a shell inside the membrane of thickness _shellThickness.">
<Parameter name="restingConc" dimension="concentration"/>
<Parameter name="decayConstant" dimension="time"/>
<Parameter name="shellThickness" dimension="length"/>
<!--<Parameter name="radius" dimension="length"/> needed to calc volume of pools, etc. -->
<!--<Exposure name="debugVal" dimension="none"/>-->
<Constant name="Faraday" dimension="charge_per_mole" value="96485.3C_per_mol"/>
<Constant name="AREA_SCALE" dimension="area" value="1m2"/>
<Constant name="LENGTH_SCALE" dimension="length" value="1m"/>
<Requirement name="iCa" dimension="current"/>
<Text name="ion"/> <!-- TODO: check why this isn't inherited from concentrationModel -->
<Dynamics>
<StateVariable name="concentration" exposure="concentration" dimension="concentration"/>
<StateVariable name="extConcentration" exposure="extConcentration" dimension="concentration"/>
<!--<StateVariable name="debugVal" exposure="debugVal" dimension="none"/>-->
<!--<DerivedVariable name="debug" dimension="none" value="shell_volume"/>-->
<!-- TODO: make these derived vars! -->
<DerivedVariable name="effectiveRadius" dimension="length" value="LENGTH_SCALE * sqrt(surfaceArea/(AREA_SCALE * (4 * 3.14159)))"/> <!-- needed to calc volume of pools, etc. -->
<DerivedVariable name="innerRadius" dimension="length" value="effectiveRadius - shellThickness"/>
<DerivedVariable name="shellVolume" dimension="volume" value="(4 * (effectiveRadius * effectiveRadius * effectiveRadius) * 3.14159 / 3) - (4 * (innerRadius * innerRadius * innerRadius) * 3.14159 / 3)"/>
<TimeDerivative variable="concentration" value="iCa / (2 * Faraday * shellVolume) - ((concentration - restingConc) / decayConstant)"/>
<OnStart>
<StateAssignment variable="concentration" value="initialConcentration"/>
<StateAssignment variable="extConcentration" value="initialExtConcentration"/>
</OnStart>
<OnCondition test="concentration .lt. 0">
<StateAssignment variable="concentration" value="0"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="fixedFactorConcentrationModel"
extends="concentrationModel"
description="Model of buffering of concentration of an ion (currently hard coded to be calcium, due to requirement for _iCa) which has a baseline level _restingConc and tends to this value with time course _decayConstant. A fixed factor _rho is used to scale the incoming current INDEPENDENTLY OF THE SIZE OF THE COMPARTMENT to produce a concentration change.">
<Parameter name="restingConc" dimension="concentration"/>
<Parameter name="decayConstant" dimension="time"/>
<Parameter name="rho" dimension="rho_factor"/>
<Requirement name="iCa" dimension="current"/>
<Requirement name="surfaceArea" dimension="area"/>
<Text name="species"/> <!-- TODO: check why this isn't inherited from concentrationModel -->
<Dynamics>
<StateVariable name="concentration" exposure="concentration" dimension="concentration"/>
<StateVariable name="extConcentration" exposure="extConcentration" dimension="concentration"/>
<TimeDerivative variable="concentration" value="(iCa/surfaceArea) * rho - ((concentration - restingConc) / decayConstant)"/>
<OnStart>
<StateAssignment variable="concentration" value="initialConcentration"/>
<StateAssignment variable="extConcentration" value="initialExtConcentration"/>
</OnStart>
<OnCondition test="concentration .lt. 0">
<StateAssignment variable="concentration" value="0"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="species"
description="Description of a chemical species identified by _ion, which has internal, _concentration, and external, _extConcentration values for its concentration">
<Parameter name="initialConcentration" dimension="concentration"/>
<Parameter name="initialExtConcentration" dimension="concentration"/>
<ComponentReference name="concentrationModel" type="concentrationModel"/>
<Exposure name="concentration" dimension="concentration"/>
<Exposure name="extConcentration" dimension="concentration"/>
<Text name="ion"/> <!-- TODO: this should be in id!!! -->
<Dynamics>
<DerivedVariable name="concentration" exposure="concentration" dimension="concentration" select="concentrationModel/concentration"/>
<DerivedVariable name="extConcentration" exposure="extConcentration" dimension="concentration" select="concentrationModel/extConcentration"/>
</Dynamics>
<Structure>
<ChildInstance component="concentrationModel"/>
</Structure>
</ComponentType>
<ComponentType name="cell"
extends="baseCellMembPot"
description="Cell with _segment_s specified in a _morphology_ element along with details on its _biophysicalProperties_. NOTE: this can only be correctly simulated using LEMS when there is a single segment in the cell, and _v of this cell represents the membrane potential in that isopotential segment!!!">
<Child name="notes" type="notes"/>
<Child name="annotation" type="annotation"/>
<Child name="morphology" type="morphology"/>
<Child name="biophysicalProperties" type="biophysicalProperties"/>
<Attachments name="synapses" type="basePointCurrent"/>
<Exposure name="spiking" dimension="none"/>
<Exposure name="debugVal" dimension="none"/>
<Exposure name="iChannels" dimension="current"/>
<Exposure name="iSyn" dimension="current"/>
<Exposure name="totSpecCap" dimension="specificCapacitance"/>
<Exposure name="surfaceArea" dimension="area"/>
<Exposure name="iCa" dimension="current"/>
<Exposure name="caConc" dimension="concentration"/>
<Exposure name="caConcExt" dimension="concentration"/>
<Text name="neuroLexId"/>
<Dynamics>
<StateVariable name="v" exposure="v" dimension="voltage"/>
<StateVariable name="spiking" exposure="spiking" dimension="none"/>
<StateVariable name="debugVal" exposure="debugVal" dimension="none"/>
<DerivedVariable name="initMembPot" dimension="voltage" select="biophysicalProperties/membraneProperties/initMembPotential/value"/>
<DerivedVariable name="thresh" dimension="voltage" select="biophysicalProperties/membraneProperties/spikeThresh/value"/>
<DerivedVariable name="debug" dimension="none" select="biophysicalProperties/membraneProperties/totChanCurrent"/>
<!--TODO replace this with just using first segment!!-->
<DerivedVariable name="surfaceArea" exposure="surfaceArea" dimension="area" select="morphology/segments[*]/surfaceArea" reduce="add"/>
<DerivedVariable name="totSpecCap" dimension="specificCapacitance" exposure="totSpecCap" select="biophysicalProperties/totSpecCap"/>
<DerivedVariable name="totCap" dimension="capacitance" value="totSpecCap * surfaceArea "/>
<DerivedVariable name="iChannels" dimension="current" exposure="iChannels" select="biophysicalProperties/membraneProperties/totChanCurrent"/>
<DerivedVariable name="iSyn" dimension="current" exposure="iSyn" select="synapses[*]/i" reduce="add" />
<DerivedVariable name="iCa" dimension="current" exposure="iCa" select="biophysicalProperties/membraneProperties/iCa"/>
<DerivedVariable name="caConc" dimension="concentration" exposure="caConc" select="biophysicalProperties/intracellularProperties/caConc"/>
<DerivedVariable name="caConcExt" dimension="concentration" exposure="caConcExt" select="biophysicalProperties/intracellularProperties/caConcExt"/>
<TimeDerivative variable="v" value="(iChannels + iSyn) / totCap"/>
<OnStart>
<StateAssignment variable="spiking" value="0"/>
<StateAssignment variable="v" value="initMembPot"/>
</OnStart>
<OnCondition test="v .gt. thresh .and. spiking .lt. 0.5">
<StateAssignment variable="spiking" value="1"/>
<EventOut port="spike"/>
</OnCondition>
<OnCondition test="v .lt. thresh">
<StateAssignment variable="spiking" value="0"/>
</OnCondition>
<OnCondition test="t .geq. 0">
<StateAssignment variable="debugVal" value="debug"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="baseCellMembPotCap"
extends="baseCellMembPot"
description="Any cell with a membrane potential _v with voltage units and a membrane capacitance _C. Also defines exposed value _iSyn for current due to external synapses and _iMemb for total current crossing membrane (normally channel currents plus _iSyn)">
<Parameter name="C" dimension="capacitance" description="Total capacitance of the cell membrane"/>
<Exposure name="iSyn" dimension="current" description="Total current due to synaptic inputs"/>
<Exposure name="iMemb" dimension="current" description="Total current crossing the cell membrane"/>
</ComponentType>
<ComponentType name="baseIaf"
extends="baseCellMembPot"
description="Base ComponentType for an integrate and fire cell which emits a spiking event at membrane potential _thresh and and resets to _reset">
<Parameter name="thresh" dimension="voltage" description="The membrane potential at which to emit a spiking event and reset voltage"/>
<Parameter name="reset" dimension="voltage" description="The value the membrane potential is reset to on spiking"/>
</ComponentType>
<ComponentType name="iafTauCell"
extends="baseIaf"
description="Integrate and fire cell which returns to its leak reversal potential of _leakReversal with a time course _tau">
<Parameter name="leakReversal" dimension="voltage"/>
<Parameter name="tau" dimension="time"/>
<Dynamics>
<StateVariable name="v" exposure="v" dimension="voltage"/>
<TimeDerivative variable="v" value="(leakReversal - v) / tau"/>
<OnStart>
<StateAssignment variable="v" value="reset"/>
</OnStart>
<OnCondition test="v .gt. thresh">
<StateAssignment variable="v" value="reset"/>
<EventOut port="spike"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="iafTauRefCell"
extends="iafTauCell"
description="Integrate and fire cell which returns to its leak reversal potential of _leakReversal with a time course _tau. It has a refractory period of _refract after spiking">
<Parameter name="refract" dimension="time"/>
<Dynamics>
<StateVariable name="v" exposure="v" dimension="voltage"/>
<StateVariable name="lastSpikeTime" dimension="time"/>
<OnStart>
<StateAssignment variable="v" value="reset"/>
</OnStart>
<Regime name="refractory">
<OnEntry>
<StateAssignment variable="lastSpikeTime" value="t" />
<StateAssignment variable="v" value="reset" />
</OnEntry>
<OnCondition test="t .gt. lastSpikeTime + refract">
<Transition regime="integrating" />
</OnCondition>
</Regime>
<Regime name="integrating" initial="true">
<TimeDerivative variable="v" value="(leakReversal - v) / tau" />
<OnCondition test="v .gt. thresh">
<EventOut port="spike"/>
<Transition regime="refractory" />
</OnCondition>
<!--<OnEvent port="in">
<StateAssignment variable="v" value="v + deltaV"/>
</OnEvent>-->
</Regime>
</Dynamics>
</ComponentType>
<ComponentType name="baseIafCapCell"
extends="baseCellMembPotCap"
description="Base Type for all Integrate and Fire cells with a capacitance _C, threshold _thresh and reset membrane potential _reset">
<Parameter name="thresh" dimension="voltage"/> <!-- These are repeated from baseIaf since there can't yet be multiple inheritance -->
<Parameter name="reset" dimension="voltage"/>
</ComponentType>
<ComponentType name="iafCell"
extends="baseIafCapCell"
description="Integrate and fire cell with capacitance _C, _leakConductance and _leakReversal">
<Parameter name="leakConductance" dimension="conductance"/>
<Parameter name="leakReversal" dimension="voltage"/>
<Attachments name="synapses" type="basePointCurrent"/>
<Dynamics>
<StateVariable name="v" exposure="v" dimension="voltage"/>
<DerivedVariable name="iSyn" dimension="current" exposure="iSyn" select="synapses[*]/i" reduce="add" />
<DerivedVariable name="iMemb" dimension="current" exposure="iMemb" value="leakConductance * (leakReversal - v) + iSyn"/>
<TimeDerivative variable="v" value="iMemb / C"/>
<OnStart>
<StateAssignment variable="v" value="reset"/>
</OnStart>
<OnCondition test="v .gt. thresh">
<StateAssignment variable="v" value="reset"/>
<EventOut port="spike"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="iafRefCell"
extends="iafCell"
description="Integrate and fire cell with capacitance _C, _leakConductance, _leakReversal and refractory period _refract">
<Parameter name="refract" dimension="time"/>
<Attachments name="synapses" type="basePointCurrent"/>
<Dynamics>
<StateVariable name="v" exposure="v" dimension="voltage"/>
<StateVariable name="lastSpikeTime" dimension="time"/>
<!-- iSyn and iMemb value is meaningless in the refractory regime -->
<DerivedVariable name="iSyn" dimension="current" exposure="iSyn" select="synapses[*]/i" reduce="add" />
<DerivedVariable name="iMemb" dimension="current" exposure="iMemb" value="leakConductance * (leakReversal - v) + iSyn"/>
<OnStart>
<StateAssignment variable="v" value="reset"/>
</OnStart>
<Regime name="refractory">