forked from songting858/DIF_model
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrace.hoc
More file actions
162 lines (121 loc) · 2.97 KB
/
Copy pathtrace.hoc
File metadata and controls
162 lines (121 loc) · 2.97 KB
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
//record traces of EPSP, IPSP, SUM, Linear SUM and Residue
/*apical trunk list: 0(41.50)-2(94.47)-14(122.82)-28(151.46)-30(179.70)-32(195.53)-40(201.79)-
-44(227.96)-52(254.45)-60(262.17)-66(268.27)-72(283.71)-74(311.14)-78(343.59)*/
load_file("preload_files.hoc")
cvode.active(0)
dt=0.1
tstop=100
I_loc=72
E_loc=78
objectvar b, ampa, nmda, gabaa, gabab
objref stim_gaba, stim_glut
access soma
distance()
stim_gaba = new NetStim1(0.5)
stim_gaba.number=1
stim_glut = new NetStim1(0.5)
stim_glut.number=1
proc step() { local i
fadvance()
if(ngraph!=0) {
for i=0, ngraph-1{
g[i].plot(t)
g[i].flush()
doNotify()
}
}
}
proc run() { local j
init()
if(ngraph!=0) {
for j=0, ngraph-1{
g[j].begin()
}
}
while(t<tstop) {
step()}
}
objref savdata, recv, rect
recv=new Vector()
rect=new Vector()
recv.record(&soma.v(0))
rect.record(&t)
objref vEPSP, vIPSP, vSUM, aSUM, diff, T
vEPSP=new Vector()
vIPSP=new Vector()
vSUM= new Vector()
aSUM= new Vector()
diff= new Vector()
T = new Vector()
strdef source_path, target_path
proc main() {
//print I_loc, E_loc, gaba_gstart, gaba_gend, ampa_gstart, ampa_gend
dend[I_loc] {
print distance(0.5)
I_dist=distance(0.5)
gabaa= new GABAa()
gabab= new GABAb()
gabaa.loc(0.5)
gabab.loc(0.5)
setpointer gabaa.pre, stim_gaba.y // assign presynaptic compartment
setpointer gabab.pre, stim_gaba.y
gabaa.gmax=2e-2 //0.019
gabab.gmax= 0//gabaa.gmax*gabab_gabaa_ratio
}
dend[E_loc] {
print distance(0.9)
E_dist=distance(0.9)
ampa = new AMPA()
nmda = new NMDA()
ampa.loc(0.9)
nmda.loc(0.9)
setpointer ampa.pre, stim_glut.y // assign presynaptic compartment
setpointer nmda.pre, stim_glut.y
if(!Block_NMDA_Flag){
nmda_ampa_ratio = 0.6/(1+E_dist/300)
}else{
nmda_ampa_ratio = 0.1*0.6/(1+E_dist/300)
}
// print "nmda_ampa_ratio = ", nmda_ampa_ratio
ampa.gmax =7e-3//0.005 // (umho) maximum conductance
nmda.gmax =0// ampa.gmax*nmda_ampa_ratio
}
// EPSP record //
stim_gaba.start=1000
stim_glut.start=5
run()
vEPSP = recv.c.sub(0)
T = rect.c
// IPSP record //
stim_gaba.start=5
stim_glut.start=1000
run()
vIPSP = recv.c.sub(0)
// SUM record //
stim_gaba.start=5
stim_glut.start=5
run()
vSUM = recv.c.sub(0)
// Base_line record //
stim_gaba.start=1000
stim_glut.start=1000
run()
print "Done!\n"
savdata = new File()
sprint(target_path, "%s", "traceEI.dat")
savdata.wopen(target_path)
vEPSP.printf(savdata,"%g \t")
vIPSP.printf(savdata,"%g \t")
vSUM.printf(savdata,"%g \t")
savdata.close()
}
// Result Plot //
b = new HBox()
b.intercept(1)
addgraph("soma.v(0)", -75, -55)
//addgraph("dend[prox].v(0)", -75, -55)
//addgraph("dend[dist].v(0)", -75, -55)
b.intercept(0)
b.map()
//morph_plot()
main()