-
Notifications
You must be signed in to change notification settings - Fork 1
/
drawfig3.py
225 lines (193 loc) · 9.68 KB
/
drawfig3.py
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
from pylab import *
import scipy.io
import pickle
from os.path import exists
from matplotlib.collections import PatchCollection
import mytools
def discontlog(ax,x,y,width=18,height=1.05,col='#000000'):
ax.plot([x-width/2,x+width/2],[y/sqrt(height),y*sqrt(height)],'k-',lw=2.3,clip_on=False,color=col)
ax.plot([x-width,x+width],[y/height,y*height],'w-',lw=1.0,clip_on=False,zorder=100)
def discontlogopp(ax,x,y,width=18,height=1.05,col='#000000'):
ax.plot([x-width/2,x+width/2],[y*sqrt(height),y/sqrt(height)],'k-',lw=2.3,clip_on=False,color=col)
ax.plot([x-width,x+width],[y*height,y/height],'w-',lw=1.0,clip_on=False,zorder=100)
f,axarr = subplots(6,1)
axarr[0].set_position([0.065,0.75,0.15,0.18])
axarr[1].set_position([0.27,0.75,0.15,0.18])
axarr[2].set_position([0.065,0.45,0.15,0.18])
axarr[3].set_position([0.27,0.45,0.15,0.18])
axarr[4].set_position([0.065,0.15,0.15,0.18])
axarr[5].set_position([0.27,0.15,0.15,0.18])
for iax in range(0,5):
for tick in axarr[iax].xaxis.get_major_ticks() + axarr[iax].yaxis.get_major_ticks():
tick.label.set_fontsize(3.5)
axarr[iax].spines['top'].set_visible(False)
axarr[iax].spines['right'].set_visible(False)
axarr[iax].get_xaxis().tick_bottom()
axarr[iax].get_yaxis().tick_left()
axarr[iax].set_xlim([0,1000])
pos = axarr[iax].get_position()
if iax ==2:
f.text(pos.x0 - 0.035, pos.y1 - 0.025, chr(ord('A')+iax), fontsize=12)
else:
f.text(pos.x0 + 0.01, pos.y1 - 0.025, chr(ord('A')+iax), fontsize=12)
Is1 = [1.0, 3.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0, 100.0]
Is = [1.0, 3.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0, 100.0]
dists = [50.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0, 850.0, 900.0, 950.0, 1000.0]
Ihcoeffs = [0.0,1.0]
styles = ['bx-','kx-']
styles_timecourse = ['b-','k-']
styles_timecourse2 = ['b--','k--']
#Thresholds, normal
Ithreshs_all = []
for idist in range(0,len(dists)):
dist = dists[idist]
Ithreshs_both = []
for iIhcoeff in range(0,len(Ihcoeffs)):
Ihcoeff = Ihcoeffs[iIhcoeff]
filename = 'modulhcn_almog/strongdendthresh'+str(dist)+'_Ihcoeff'+str(Ihcoeff)+'_absbound.sav'
if not exists(filename):
print(filename+" does not exist")
continue
print(filename+" loaded")
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
Ithreshs_both.append(unpickledlist[0][-1])
Ithreshs_all.append(Ithreshs_both[:])
axarr[4].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0, color='#AAAAFF')
axarr[4].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0, color='#CCCCCC')
#Hay Thresholds, normal
Ithreshs_all = []
for idist in range(0,len(dists)):
dist = dists[idist]
Ithreshs_both = []
for iIhcoeff in range(0,len(Ihcoeffs)):
Ihcoeff = Ihcoeffs[iIhcoeff]
filename = 'modulhcn_hay/strongdendthresh'+str(dist)+'_Ihcoeff'+str(Ihcoeff)+'_absbound.sav'
if not exists(filename):
print(filename+" does not exist")
continue
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
print(filename+" loaded")
Ithreshs_both.append(unpickledlist[0][-1])
Ithreshs_all.append(Ithreshs_both[:])
axarr[0].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0,color='#AAAAFF')
axarr[0].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0,color='#CCCCCC')
axarr[1].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0,color='#AAAAFF')
axarr[1].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0,color='#CCCCCC')
#Hay: Thresholds, cond-based
Ithreshs_all = []
for idist in range(0,len(dists)):
dist = dists[idist]
Ithreshs_both = []
for iIhcoeff in range(0,len(Ihcoeffs)):
Ihcoeff = Ihcoeffs[iIhcoeff]
filename = 'modulhcn_hay/strongdendcondthresh'+str(dist)+'_Ihcoeff'+str(Ihcoeff)+'_absbound.sav'
if not exists(filename):
print(filename+" does not exist")
continue
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
print(filename+" loaded")
Ithreshs_both.append(unpickledlist[0][-1])
Ithreshs_all.append(Ithreshs_both[:])
axarr[2].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0,color='#AAAAFF')
axarr[2].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0,color='#CCCCCC')
#Hay Thresholds, no CaLVA
Ithreshs_all = []
for idist in range(0,len(dists)):
dist = dists[idist]
Ithreshs_both = []
for iIhcoeff in range(0,len(Ihcoeffs)):
Ihcoeff = Ihcoeffs[iIhcoeff]
filename = 'modulhcn_hay/strongdendthresh'+str(dist)+'_gCa_LVAstbar_Ca_LVAst_Ihcoeff'+str(Ihcoeff)+'_absbound.sav'
if not exists(filename):
print(filename+" does not exist")
continue
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
print(filename+" loaded")
Ithreshs_both.append(unpickledlist[0][-1])
Ithreshs_all.append(Ithreshs_both[:])
axarr[0].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0)
axarr[0].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0)
axarr[0].set_xlabel('distance ($\mu$m)',fontsize=6)
axarr[0].set_ylabel('$I$ (nA)',fontsize=6)
axarr[0].set_title('Hay, no LVA CCs',fontsize=6)
#Hay Thresholds, no LVA hot zone
Ithreshs_all = []
for idist in range(0,len(dists)):
dist = dists[idist]
Ithreshs_both = []
for iIhcoeff in range(0,len(Ihcoeffs)):
Ihcoeff = Ihcoeffs[iIhcoeff]
filename = 'modulhcn_hay/nohotLVA_strongdendthresh'+str(dist)+'_Ihcoeff'+str(Ihcoeff)+'_absbound.sav'
if not exists(filename):
print(filename+" does not exist")
continue
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
print(filename+" loaded")
Ithreshs_both.append(unpickledlist[0][-1])
Ithreshs_all.append(Ithreshs_both[:])
axarr[1].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0)
axarr[1].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0)
axarr[1].set_xlabel('distance ($\mu$m)',fontsize=6)
axarr[1].set_ylabel('$I$ (nA)',fontsize=6)
axarr[1].set_title('Hay, no hot zone of LVA CCs',fontsize=6)
#Hay: Thresholds, cond-based, no hot zone
Ithreshs_all = []
for idist in range(0,len(dists)):
dist = dists[idist]
Ithreshs_both = []
for iIhcoeff in range(0,len(Ihcoeffs)):
Ihcoeff = Ihcoeffs[iIhcoeff]
filename = 'modulhcn_hay/nohotLVA_strongdendcondthresh'+str(dist)+'_Ihcoeff'+str(Ihcoeff)+'_absbound.sav'
if not exists(filename):
print(filename+" does not exist")
continue
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
print(filename+" loaded")
Ithreshs_both.append(unpickledlist[0][-1])
Ithreshs_all.append(Ithreshs_both[:])
axarr[2].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0)
axarr[2].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0)
axarr[2].set_xlabel('distance ($\mu$m)',fontsize=6)
axarr[2].set_ylabel('$g$ ($\mu$S)',fontsize=6)
axarr[2].set_title('Hay, no hot zone of LVA CCs',fontsize=6)
discontlog(axarr[2],690,30,col='#0000FF')
discontlog(axarr[2],810,30,col='#AAAAFF')
discontlog(axarr[2],760,18,col='#000000')
discontlog(axarr[2],0,30,col='#000000')
#Hay: time course of inactivation
iamp = 1 #0.01 nS
for iIhcoeff in range(0,2):
filename = 'modulhcn_hay/strongdendstimcond800.0_Ihcoeff'+str(Ihcoeffs[iIhcoeff])+'_recCaLVA_Ih.sav'
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
#picklelist = [times_all,Vsoma_all,Vdend_all,ihsoma_all,ihdend_all,h_ih_all,m_calva_all,h_calva_all]
axarr[3].plot([x-800 for x in unpickledlist[0][iamp]],unpickledlist[7][iamp],styles_timecourse[iIhcoeff],lw=0.5)
axarr[3].set_xlim([-5,50])
axarr[3].set_ylim([0,0.6])
axarr[3].set_xlabel('$t$ (ms)',fontsize=6)
axarr[3].set_ylabel('h',fontsize=6)
axarr[3].set_title('Hay, LVA CC inactivation',fontsize=6)
#Thresholds, Almog, added LVA hot zone
Ithreshs_all = []
for idist in range(0,len(dists)):
dist = dists[idist]
Ithreshs_both = []
for iIhcoeff in range(0,len(Ihcoeffs)):
Ihcoeff = Ihcoeffs[iIhcoeff]
filename = 'modulhcn_almog/strongdendthresh'+str(dist)+'_Ihcoeff'+str(Ihcoeff)+'_apicalCaLVAHay_0.003_100.0_dists585-985_absbound.sav'
if not exists(filename):
print(filename+" does not exist")
continue
print(filename+" loaded")
unpicklefile = open(filename,'rb');unpickledlist = pickle.load(unpicklefile);unpicklefile.close()
Ithreshs_both.append(unpickledlist[0][-1])
Ithreshs_all.append(Ithreshs_both[:])
axarr[4].semilogy(dists, [Ithreshs_all[i][0] for i in range(0,len(Ithreshs_all))], styles[0],lw=0.5,mew=0.5,ms=2.0)
axarr[4].semilogy(dists, [Ithreshs_all[i][1] for i in range(0,len(Ithreshs_all))], styles[1],lw=0.5,mew=0.5,ms=2.0)
axarr[4].set_xlabel('distance ($\mu$m)',fontsize=6)
axarr[4].set_ylabel('$I$ (nA)',fontsize=6)
axarr[4].set_title('Almog, with hot zone of LVA CCs',fontsize=6)
axarr[5].set_visible(False)
myleg = mytools.mylegend(f,[0.13,0.968,0.25,0.03],['b-','k-'],['$I_h$ blocked','Control'],2,2,0.55,0.35,myfontsize=7)
for q in ['top','right','bottom','left']:
myleg.spines[q].set_visible(False)
f.savefig("fig3.eps")