dendrotweaks 0.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. dendrotweaks/__init__.py +10 -0
  2. dendrotweaks/analysis/__init__.py +11 -0
  3. dendrotweaks/analysis/ephys_analysis.py +482 -0
  4. dendrotweaks/analysis/morphometric_analysis.py +106 -0
  5. dendrotweaks/membrane/__init__.py +6 -0
  6. dendrotweaks/membrane/default_mod/AMPA.mod +65 -0
  7. dendrotweaks/membrane/default_mod/AMPA_NMDA.mod +100 -0
  8. dendrotweaks/membrane/default_mod/CaDyn.mod +54 -0
  9. dendrotweaks/membrane/default_mod/GABAa.mod +65 -0
  10. dendrotweaks/membrane/default_mod/Leak.mod +27 -0
  11. dendrotweaks/membrane/default_mod/NMDA.mod +72 -0
  12. dendrotweaks/membrane/default_mod/vecstim.mod +76 -0
  13. dendrotweaks/membrane/default_templates/NEURON_template.py +354 -0
  14. dendrotweaks/membrane/default_templates/default.py +73 -0
  15. dendrotweaks/membrane/default_templates/standard_channel.mod +87 -0
  16. dendrotweaks/membrane/default_templates/template_jaxley.py +108 -0
  17. dendrotweaks/membrane/default_templates/template_jaxley_new.py +108 -0
  18. dendrotweaks/membrane/distributions.py +324 -0
  19. dendrotweaks/membrane/groups.py +103 -0
  20. dendrotweaks/membrane/io/__init__.py +11 -0
  21. dendrotweaks/membrane/io/ast.py +201 -0
  22. dendrotweaks/membrane/io/code_generators.py +312 -0
  23. dendrotweaks/membrane/io/converter.py +108 -0
  24. dendrotweaks/membrane/io/factories.py +144 -0
  25. dendrotweaks/membrane/io/grammar.py +417 -0
  26. dendrotweaks/membrane/io/loader.py +90 -0
  27. dendrotweaks/membrane/io/parser.py +499 -0
  28. dendrotweaks/membrane/io/reader.py +212 -0
  29. dendrotweaks/membrane/mechanisms.py +574 -0
  30. dendrotweaks/model.py +1916 -0
  31. dendrotweaks/model_io.py +75 -0
  32. dendrotweaks/morphology/__init__.py +5 -0
  33. dendrotweaks/morphology/domains.py +100 -0
  34. dendrotweaks/morphology/io/__init__.py +5 -0
  35. dendrotweaks/morphology/io/factories.py +212 -0
  36. dendrotweaks/morphology/io/reader.py +66 -0
  37. dendrotweaks/morphology/io/validation.py +212 -0
  38. dendrotweaks/morphology/point_trees.py +681 -0
  39. dendrotweaks/morphology/reduce/__init__.py +16 -0
  40. dendrotweaks/morphology/reduce/reduce.py +155 -0
  41. dendrotweaks/morphology/reduce/reduced_cylinder.py +129 -0
  42. dendrotweaks/morphology/sec_trees.py +1112 -0
  43. dendrotweaks/morphology/seg_trees.py +157 -0
  44. dendrotweaks/morphology/trees.py +567 -0
  45. dendrotweaks/path_manager.py +261 -0
  46. dendrotweaks/simulators.py +235 -0
  47. dendrotweaks/stimuli/__init__.py +3 -0
  48. dendrotweaks/stimuli/iclamps.py +73 -0
  49. dendrotweaks/stimuli/populations.py +265 -0
  50. dendrotweaks/stimuli/synapses.py +203 -0
  51. dendrotweaks/utils.py +239 -0
  52. dendrotweaks-0.3.1.dist-info/METADATA +70 -0
  53. dendrotweaks-0.3.1.dist-info/RECORD +56 -0
  54. dendrotweaks-0.3.1.dist-info/WHEEL +5 -0
  55. dendrotweaks-0.3.1.dist-info/licenses/LICENSE +674 -0
  56. dendrotweaks-0.3.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,100 @@
1
+ TITLE NMDA synapse
2
+
3
+ COMMENT
4
+ Custom NMDA synapse model developed for DendroTweaks
5
+ ENDCOMMENT
6
+
7
+ NEURON {
8
+ POINT_PROCESS AMPA_NMDA
9
+ NONSPECIFIC_CURRENT i
10
+ RANGE gmax_AMPA, gmax_NMDA, mg, mgblock
11
+ RANGE tau_rise_AMPA, tau_decay_AMPA, tau_rise_NMDA, tau_decay_NMDA
12
+ RANGE mu, gamma
13
+ RANGE i, i_AMPA, i_NMDA, g, g_AMPA, g_NMDA, e
14
+ }
15
+
16
+ UNITS {
17
+ (nA) = (nanoamp)
18
+ (mV) = (millivolt)
19
+ (uS) = (microsiemens)
20
+ (mM) = (millimole)
21
+ }
22
+
23
+ PARAMETER {
24
+ gmax_AMPA = 0 (uS)
25
+ gmax_NMDA = 0 (uS)
26
+ e = 0 (mV)
27
+ tau_rise_AMPA = 0.1 (ms)
28
+ tau_decay_AMPA = 2.5 (ms)
29
+ tau_rise_NMDA = 2 (ms)
30
+ tau_decay_NMDA = 30 (ms)
31
+ mg = 1 (mM)
32
+ mu = 0.28 (/mM)
33
+ gamma = 0.062 (/mV)
34
+ }
35
+
36
+ ASSIGNED {
37
+ v (mV)
38
+ i (nA)
39
+ i_AMPA (nA)
40
+ i_NMDA (nA)
41
+ g (uS)
42
+ g_AMPA (uS)
43
+ g_NMDA (uS)
44
+ factor_AMPA (1)
45
+ factor_NMDA (1)
46
+ mgblock (1)
47
+ }
48
+
49
+ STATE {
50
+ A_AMPA (1)
51
+ B_AMPA (1)
52
+ A_NMDA (1)
53
+ B_NMDA (1)
54
+ }
55
+
56
+ BREAKPOINT {
57
+ SOLVE state METHOD cnexp
58
+ g_AMPA = gmax_AMPA * (B_AMPA - A_AMPA)
59
+ i_AMPA = g_AMPA * (v - e)
60
+
61
+ mgblock = 1 / (1 + (mu * mg) * exp(-gamma * v))
62
+ g_NMDA = mgblock * gmax_NMDA * (B_NMDA - A_NMDA)
63
+ i_NMDA = g_NMDA * (v - e)
64
+
65
+ g = g_AMPA + g_NMDA
66
+ i = i_AMPA + i_NMDA
67
+ }
68
+
69
+ DERIVATIVE state {
70
+ A_AMPA' = -A_AMPA / tau_rise_AMPA
71
+ B_AMPA' = -B_AMPA / tau_decay_AMPA
72
+ A_NMDA' = -A_NMDA / tau_rise_NMDA
73
+ B_NMDA' = -B_NMDA / tau_decay_NMDA
74
+ }
75
+
76
+ INITIAL {
77
+ LOCAL tp_AMPA, tp_NMDA
78
+
79
+ A_AMPA = 0
80
+ B_AMPA = 0
81
+
82
+ tp_AMPA = (tau_rise_AMPA * tau_decay_AMPA) / (tau_decay_AMPA - tau_rise_AMPA) * log(tau_decay_AMPA / tau_rise_AMPA)
83
+ factor_AMPA = -exp(-tp_AMPA / tau_rise_AMPA) + exp(-tp_AMPA / tau_decay_AMPA)
84
+ factor_AMPA = 1 / factor_AMPA
85
+
86
+ A_NMDA = 0
87
+ B_NMDA = 0
88
+
89
+ tp_NMDA = (tau_rise_NMDA * tau_decay_NMDA) / (tau_decay_NMDA - tau_rise_NMDA) * log(tau_decay_NMDA / tau_rise_NMDA)
90
+ factor_NMDA = -exp(-tp_NMDA / tau_rise_NMDA) + exp(-tp_NMDA / tau_decay_NMDA)
91
+ factor_NMDA = 1 / factor_NMDA
92
+
93
+ }
94
+
95
+ NET_RECEIVE(weight (1)) {
96
+ A_AMPA = A_AMPA + weight * factor_AMPA
97
+ B_AMPA = B_AMPA + weight * factor_AMPA
98
+ A_NMDA = A_NMDA + weight * factor_NMDA
99
+ B_NMDA = B_NMDA + weight * factor_NMDA
100
+ }
@@ -0,0 +1,54 @@
1
+ TITLE Decay of internal calcium concentration
2
+
3
+ NEURON {
4
+ SUFFIX CaDyn
5
+ USEION ca READ ica, cai WRITE cai
6
+ RANGE depth, taur, cainf, gamma, kt, kd
7
+ }
8
+
9
+ UNITS {
10
+ (molar) = (1/liter) : moles do not appear in units
11
+ (mM) = (millimolar)
12
+ (um) = (micron)
13
+ (mA) = (milliamp)
14
+ (msM) = (ms mM)
15
+ FARADAY = (faraday) (coulomb)
16
+ }
17
+
18
+ PARAMETER {
19
+ depth = 0.1 (um) : Depth of calcium shell
20
+ taur = 700 (ms) : Time constant for calcium removal
21
+ cainf = 1e-8 (mM) : Steady-state calcium concentration
22
+ gamma = 1 : Fraction of free calcium (not buffered)
23
+ kt = 1 (mM/ms) : Michaelis-Menten rate (not used by default)
24
+ kd = 5e-4 (mM) : Michaelis-Menten dissociation constant (not used by default)
25
+ }
26
+
27
+ STATE { cai (mM) }
28
+
29
+ ASSIGNED {
30
+ ica (mA/cm2)
31
+ drive_channel (mM/ms)
32
+ drive_pump (mM/ms)
33
+ }
34
+
35
+ INITIAL {
36
+ cai = cainf
37
+ }
38
+
39
+ BREAKPOINT {
40
+ SOLVE state METHOD cnexp
41
+ }
42
+
43
+ DERIVATIVE state {
44
+ drive_channel = - (10000) * (ica * gamma) / (2 * FARADAY * depth)
45
+
46
+ if (drive_channel <= 0.) {
47
+ drive_channel = 0.
48
+ } : Prevent inward pumping
49
+
50
+ drive_pump = - kt * cai / (cai + kd) : Michaelis-Menten removal
51
+
52
+ cai' = drive_channel + drive_pump + (cainf - cai) / taur
53
+
54
+ }
@@ -0,0 +1,65 @@
1
+ TITLE GABAa synapse
2
+
3
+ COMMENT
4
+ Custom GABAa synapse model developed for DendroTweaks
5
+ ENDCOMMENT
6
+
7
+ NEURON {
8
+ POINT_PROCESS GABAa
9
+ NONSPECIFIC_CURRENT i
10
+ RANGE gmax
11
+ RANGE tau_rise, tau_decay
12
+ RANGE i, g, e
13
+ }
14
+
15
+ UNITS {
16
+ (nA) = (nanoamp)
17
+ (mV) = (millivolt)
18
+ (uS) = (microsiemens)
19
+ }
20
+
21
+ PARAMETER {
22
+ gmax = 0 (uS)
23
+ e = -70 (mV)
24
+ tau_rise = 0.2 (ms)
25
+ tau_decay = 1.4 (ms)
26
+ }
27
+
28
+ ASSIGNED {
29
+ v (mV)
30
+ i (nA)
31
+ g (uS)
32
+ factor (1)
33
+ }
34
+
35
+ STATE {
36
+ A (1)
37
+ B (1)
38
+ }
39
+
40
+ BREAKPOINT {
41
+ SOLVE state METHOD cnexp
42
+ g = gmax * (B - A)
43
+ i = g * (v - e)
44
+ }
45
+
46
+ DERIVATIVE state {
47
+ A' = -A / tau_rise
48
+ B' = -B / tau_decay
49
+ }
50
+
51
+ INITIAL {
52
+ LOCAL tp
53
+ A = 0
54
+ B = 0
55
+
56
+ tp = (tau_rise * tau_decay) / (tau_decay - tau_rise) * log(tau_decay / tau_rise)
57
+ factor = -exp(-tp / tau_rise) + exp(-tp / tau_decay)
58
+ factor = 1 / factor
59
+
60
+ }
61
+
62
+ NET_RECEIVE(weight (1)) {
63
+ A = A + weight * factor
64
+ B = B + weight * factor
65
+ }
@@ -0,0 +1,27 @@
1
+ TITLE Leak channel
2
+
3
+ COMMENT
4
+ NEURON Book Listing 9.1,
5
+ Replaced g with gbar for consistency with other channels
6
+ Overridden the default values of gbar to 0.0 and e to -70 mV
7
+ ENDCOMMENT
8
+
9
+ NEURON {
10
+ SUFFIX Leak
11
+ NONSPECIFIC_CURRENT i
12
+ RANGE i, e, gbar
13
+ }
14
+
15
+ PARAMETER {
16
+ gbar = 0.0 (siemens/cm2)
17
+ e = -70 (millivolt)
18
+ }
19
+
20
+ ASSIGNED {
21
+ v (millivolt)
22
+ i (milliamp/cm2)
23
+ }
24
+
25
+ BREAKPOINT {
26
+ i = gbar * (v - e)
27
+ }
@@ -0,0 +1,72 @@
1
+ TITLE NMDA synapse
2
+
3
+ COMMENT
4
+ Custom NMDA synapse model developed for DendroTweaks
5
+ ENDCOMMENT
6
+
7
+ NEURON {
8
+ POINT_PROCESS NMDA
9
+ NONSPECIFIC_CURRENT i
10
+ RANGE gmax, mg, mgblock
11
+ RANGE tau_rise, tau_decay
12
+ RANGE mu, gamma
13
+ RANGE i, g, e
14
+ }
15
+
16
+ UNITS {
17
+ (nA) = (nanoamp)
18
+ (mV) = (millivolt)
19
+ (uS) = (microsiemens)
20
+ (mM) = (millimole)
21
+ }
22
+
23
+ PARAMETER {
24
+ gmax = 0 (uS)
25
+ e = 0 (mV)
26
+ tau_rise = 2 (ms)
27
+ tau_decay = 30 (ms)
28
+ mg = 1 (mM)
29
+ mu = 0.28 (/mM)
30
+ gamma = 0.062 (/mV)
31
+ }
32
+
33
+ ASSIGNED {
34
+ v (mV)
35
+ i (nA)
36
+ g (uS)
37
+ factor (1)
38
+ mgblock (1)
39
+ }
40
+
41
+ STATE {
42
+ A (1)
43
+ B (1)
44
+ }
45
+
46
+ BREAKPOINT {
47
+ SOLVE state METHOD cnexp
48
+ mgblock = 1 / (1 + (mu * mg) * exp(-gamma * v))
49
+ g = mgblock * gmax * (B - A)
50
+ i = g * (v - e)
51
+ }
52
+
53
+ DERIVATIVE state {
54
+ A' = -A / tau_rise
55
+ B' = -B / tau_decay
56
+ }
57
+
58
+ INITIAL {
59
+ LOCAL tp
60
+ A = 0
61
+ B = 0
62
+
63
+ tp = (tau_rise * tau_decay) / (tau_decay - tau_rise) * log(tau_decay / tau_rise)
64
+ factor = -exp(-tp / tau_rise) + exp(-tp / tau_decay)
65
+ factor = 1 / factor
66
+
67
+ }
68
+
69
+ NET_RECEIVE(weight (1)) {
70
+ A = A + weight * factor
71
+ B = B + weight * factor
72
+ }
@@ -0,0 +1,76 @@
1
+ : Vector stream of events
2
+
3
+ NEURON {
4
+ ARTIFICIAL_CELL VecStim
5
+ RANGE delay
6
+ }
7
+
8
+ ASSIGNED {
9
+ index
10
+ etime (ms)
11
+ space
12
+ delay
13
+ }
14
+
15
+ PARAMETER {
16
+ :delay = 0.0
17
+ }
18
+
19
+ INITIAL {
20
+ index = 0
21
+ :delay = 0
22
+ element()
23
+ if (index > 0) {
24
+ net_send(delay + etime - t, 1)
25
+ }
26
+ }
27
+
28
+ NET_RECEIVE (w) {
29
+ if (flag == 1) {
30
+ net_event(t)
31
+ element()
32
+ if (index > 0) {
33
+ net_send(delay + etime -t, 1)
34
+ }
35
+ }
36
+ }
37
+
38
+ VERBATIM
39
+ extern double* vector_vec();
40
+ extern int vector_capacity();
41
+ extern void* vector_arg();
42
+ ENDVERBATIM
43
+
44
+ PROCEDURE element() {
45
+ VERBATIM
46
+ { void* vv; int i, size; double* px;
47
+ i = (int)index;
48
+ if (i >= 0) {
49
+ vv = *((void**)(&space));
50
+ if (vv) {
51
+ size = vector_capacity(vv);
52
+ px = vector_vec(vv);
53
+ if (i < size) {
54
+ etime = px[i];
55
+ index += 1.;
56
+ }else{
57
+ index = -1.;
58
+ }
59
+ }else{
60
+ index = -1.;
61
+ }
62
+ }
63
+ }
64
+ ENDVERBATIM
65
+ }
66
+
67
+ PROCEDURE play() {
68
+ VERBATIM
69
+ void** vv;
70
+ vv = (void**)(&space);
71
+ *vv = (void*)0;
72
+ if (ifarg(1)) {
73
+ *vv = vector_arg(1);
74
+ }
75
+ ENDVERBATIM
76
+ }