-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtGAR_block_deltaV.py
More file actions
81 lines (61 loc) · 2.58 KB
/
Copy pathtGAR_block_deltaV.py
File metadata and controls
81 lines (61 loc) · 2.58 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
import matplotlib.pyplot as plt
plt.ion()
import numpy as np
from glob import glob
template_path= \
"20260123vShift_0_LVA_0p6IClamp_amp_index*/data/loc200_v_traces/loc200*"
t_vec_path= \
"20260123vShift_0_LVA_0p6IClamp_amp_index*/data/loc200_v_traces/t*"
t_vecs = glob(t_vec_path)
t_vec = np.loadtxt(t_vecs[0])
# verified that t_vec[2000] = 200 (ms) the last time point before the bAP stim effects
pre_bAP_index = 2000
files = glob(template_path)
blocked_dend_v = {} # dict of pre_bAP v with keys of index for soma control target v
# and 200 um location dendrite name for blocked tonic GABA A receptor (tGAR) sims
control_dend_v = {} # dict of pre_bAP v with keys of index for soma control target v
# and 200 um location dendrite name for control tonic GABA A receptor (tGAR) sims
blocked_dend_list_dict = {} # keys of index value of list of voltages
control_dend_list_dict = {}
for file in files:
index = int(file.split('index')[1].split('/')[0])
dend_name = file.split('loc200_')[2].split('_control')[0].split('_block')[0]
status = file.split('_')[-1].split('.')[0]
v_trace = np.loadtxt(file)
if status=='control':
control_dend_v[(dend_name, index)] = v_trace[pre_bAP_index]
else:
blocked_dend_v[(dend_name, index)] = v_trace[pre_bAP_index]
ctrl_v_of_index = [i for i in range(-70, -58, 2)]
delta_dend_list_dict = {} # k of pre_bAP index value of list of delta v's for dends
for k in control_dend_v:
pre_bAP_index = k[1]
dend_name = k[0]
if pre_bAP_index in delta_dend_list_dict:
delta_dend_list_dict[pre_bAP_index].append( \
blocked_dend_v[k] - control_dend_v[k] )
else:
delta_dend_list_dict[pre_bAP_index] = [ \
blocked_dend_v[k] - control_dend_v[k] ]
# delta v fig
plt.figure()
for index in delta_dend_list_dict:
ctrl_V = ctrl_v_of_index[index]
for delta_v in delta_dend_list_dict[index]:
plt.plot(ctrl_V, delta_v, marker='o', linestyle='None', color='black')
plt.title('$\Delta$V')
plt.xlabel('pre bAP v (mV)')
plt.ylabel('$\Delta$V = blocked dend loc 200 - control dend loc 200')
plt.show()
# g_GABA Block (mV) fig
plt.figure()
for k in control_dend_v:
pre_bAP_index = k[1]
dend_name = k[0]
ctrl_V = ctrl_v_of_index[pre_bAP_index]
plt.plot(ctrl_V, control_dend_v[k], marker='o', linestyle='None', color='black')
plt.plot(ctrl_V, blocked_dend_v[k], marker='o', linestyle='None', color='red')
plt.title('location 200 um Dendritic Vm')
plt.ylabel('pre bAP Vm (mV) blocked $g_{GABA}$ (red), control (black)')
plt.xlabel('Control soma target Vm (mV)')
plt.show()