forked from ModelDBRepository/127388
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pBGconfData.hoc
173 lines (119 loc) · 3.12 KB
/
pBGconfData.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
//proc setMPTPinput()
//proc setNORMALinput()
//proc setPROBinput()
//proc saveData(indx, resVec)
//proc setDBS(bSTNflag, bGPiFlag)
//-----------------------------------------------------------------------------------------------------
proc setMPTPinput() {local i
//---------------
probCtxSTN.fill(.25)
probStrGPe.fill(.25)
probStrGPi.fill(.25)
imnCtxSTN = 75
imnStrGPe = 75
imnStrGPi = 150
gDA_CtxSTN = 1.25
gDA_StrGPe = 1.25
gDA_StrGPi = 1
gDA_STNGPe = 1.25
gDA_STNGPi = 1
gDA_GPeSTN = 1.25
gDA_GPeGPe = 1
gDA_GPeGPi = 1.25
INPupdateWeights()
CONupdateWeights()
}
//-----------------------------------------------------------------------------------------------------
proc setNORMALinput() {local i
//---------------
probCtxSTN.fill(.05)
probStrGPe.fill(.05)
probStrGPi.fill(.05)
imnCtxSTN = 100
imnStrGPe = 100
imnStrGPi = 100
gDA_CtxSTN = 1
gDA_StrGPe = 1
gDA_StrGPi = 1
gDA_STNGPe = 2
gDA_STNGPi = 1
gDA_GPeSTN = 1
gDA_GPeGPe = 1
gDA_GPeGPi = 1
INPupdateWeights()
CONupdateWeights()
}
//-----------------------------------------------------------------------------------------------------
proc setPROBinput() {local i
//---------------
probCtxSTN.fill($1)
probStrGPe.fill($1)
probStrGPi.fill($1)
INPupdateWeights()
}
strdef str
//-----------------------------------------------------------------------------------------------------
proc saveData() {local i localobj resVec, f //(indx, resVec)
//---------------
//Append line of result vector values to filename encoding numeric value indx - eg stats000.txt
resVec = $o2
f = new File()
sprint(str, "stats%03d.txt", $1)
f.aopen(str)
for i=0,resVec.size-1 {
f.printf("%f\t", resVec.x(i))
}
f.printf("\n")
f.close()
}
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
objref r2
r2 = new Random(seedVal)
//-----------------------------------------------------------------------------------------------------
proc setDBS() {local i,j,k,p //(bSTNflag, bGPiFlag)
//---------------
//Set DBS flags to stimulate bSTNflag percent of STN axons and bGPiFlag percent of GPi axons
//... and then turn on DBS inputs if any flags were actually set
dbsRESET()
if ($1 > 0) {
if ($1 > 1) {
p = 1
} else {
p = $1
}
// p% central block of STN
j = ((1-p)/2)*numSTN
k = j + p*numSTN - 1
for i=int(j),int(k) {
dbsONflags[DBS_STN].append(i)
}
}
if ($2 > 0) {
if ($2 > 1) {
p = 1
} else {
p = $2
}
// p% randomly chosen GPi
for i=0,numGPi-1 {
if (r2.repick() < p) {
dbsONflags[DBS_GPiTha].append(i)
}
}
}
if ($1 || $2) {
//Override current DBS parameters with the following values
//... if not otherwise save, the old values will be lost
dbs_del = 0
dbs_dur = tstop
dbs_direct_amp = 10
dbs_direct_pw = .25
dbs_ad_amp = .15
dbs_ad_pw = 2
dbs_period = 7.35 // _136_ Hz STIupdateWeights()
dbsON()
}
}
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------