예제 #1
0
v = np.loadtxt('data/protocol-staircaseramp.csv', delimiter=',',
               skiprows=1)[::2, 1]

traces1 = [i1, v]
traces2 = [i2, v]
traces3 = [i3, v]

iv_i1s, iv_v1s, iv_tau1s = [], [], []
liv_i1s = []
if cached:
    iv_i1s.append(np.loadtxt('out/manual-1/i_s.txt'))
    iv_v1s.append(np.loadtxt('out/manual-1/v_s.txt'))
    iv_tau1s.append(np.loadtxt('out/manual-1/tau_s.txt'))
else:
    ivi, ivv, ivt = estimate_iv.get_iv(i1, v, t1, out='manual-1')
    iv_i1s.append(ivi)
    iv_v1s.append(ivv)
    iv_tau1s.append(ivt)
liv_i1s.append(compute_leak([i1, v]))
selected = [
    [1, 7, 1],
    [2, 1, 0],
]
for s in selected:
    i = hr.load('data-rev/silicone/Sylguard_20201020.dat', s)[0]
    if cached:
        iv_i1s.append(np.loadtxt('out/manual-1-1-%s/i_s.txt' % s[0]))
        iv_v1s.append(np.loadtxt('out/manual-1-1-%s/v_s.txt' % s[0]))
        iv_tau1s.append(np.loadtxt('out/manual-1-1-%s/tau_s.txt' % s[0]))
    else:
i1 = traces1[0] * 1e12  # A -> pA
i2 = traces2[0] * 1e12  # A -> pA
i3 = traces3[0] * 1e12  # A -> pA

v = np.loadtxt('data/protocol-staircaseramp.csv', delimiter=',', skiprows=1)[:,
                                                                             1]

i1 = i1[::2]
t1 = times1[::2]
i2 = i2[::2]
t2 = times2[::2]
i3 = i3[::2]
t3 = times3[::2]
v = v[::2]

iv_i1, iv_v1, iv_tau1 = estimate_iv.get_iv(i1, v, t1, out='manual-1')
iv_i2, iv_v2, iv_tau2 = estimate_iv.get_iv(i2, v, t2, out='manual-2')
iv_i3, iv_v3, iv_tau3 = estimate_iv.get_iv(i3, v, t3, out='manual-3')

# Plot
fig = plt.figure(figsize=(8, 4))
grid = plt.GridSpec(7, 4, hspace=0.125, wspace=0.5)
axes = np.empty([4, 2], dtype=object)

# Voltage
axes[0, 0] = fig.add_subplot(grid[:1, :3])
axes[0, 0].plot(t1, v, c='#7f7f7f')
axes[0, 0].set_xlim([t1[0], t1[-1]])
axes[0, 0].set_xticks([])

# Current
예제 #3
0
liv_i1s = []
f1s = 'data-rev/cho-herg/selected-hergcho.txt'
selected = []
with open(f1s, 'r') as f:
    for l in f:
        if not l.startswith('#'):
            selected.append(l.split()[0])
for s in selected:
    f = 'data-rev/cho-herg/hergcho-staircaseramp-%s-after-sweep1.csv' % s
    i = np.loadtxt(f, delimiter=',', skiprows=1)
    if cached:
        iv_i1s.append(np.loadtxt('out/auto-1-%s/i_s.txt' % s))
        iv_v1s.append(np.loadtxt('out/auto-1-%s/v_s.txt' % s))
        iv_tau1s.append(np.loadtxt('out/auto-1-%s/tau_s.txt' % s))
    else:
        ivi, ivv, ivt = estimate_iv.get_iv(i, v, t, out='auto-1-%s' % s)
        iv_i1s.append(ivi)
        iv_v1s.append(ivv)
        iv_tau1s.append(ivt)

iv_i2s, iv_v2s, iv_tau2s = [], [], []
liv_i2s = []
f2s = 'data-rev/cho-herg-2/selected-hergcho2.txt'
selected = []
with open(f2s, 'r') as f:
    for l in f:
        if not l.startswith('#'):
            selected.append(l.split()[0])
for s in selected:
    f = 'data-rev/cho-herg-2/hergcho2-staircaseramp-%s-after-sweep1.csv' % s
    i = np.loadtxt(f, delimiter=',', skiprows=1)
예제 #4
0
f3 = 'data/no-cell/nocell-staircaseramp-B01-after.csv'
ft = 'data/cho-cell/herg25oc1-staircaseramp-times.csv'

t = np.loadtxt(ft, delimiter=',', skiprows=1)
i1 = np.loadtxt(f1, delimiter=',', skiprows=1)
i2 = np.loadtxt(f2, delimiter=',', skiprows=1)
i3 = np.loadtxt(f3, delimiter=',', skiprows=1)

v = np.loadtxt('data/protocol-staircaseramp.csv', delimiter=',',
        skiprows=1)[::2, 1]

traces1 = [i1, v]
traces2 = [i2, v]
traces3 = [i3, v]

iv_i1, iv_v1, iv_tau1 = estimate_iv.get_iv(i1, v, t, out='auto-1')
iv_i2, iv_v2, iv_tau2 = estimate_iv.get_iv(i2, v, t, out='auto-2')
iv_i3, iv_v3, iv_tau3 = estimate_iv.get_iv(i3, v, t, out='auto-3')

# Plot
fig = plt.figure(figsize=(8, 4))
grid = plt.GridSpec(7, 4, hspace=0.125, wspace=0.5)
axes = np.empty([4, 2], dtype=object)

# Voltage
axes[0, 0] = fig.add_subplot(grid[:1, :3])
axes[0, 0].plot(t, v, c='#7f7f7f')
axes[0, 0].set_xlim([t[0], t[-1]])
axes[0, 0].set_xticks([])

# Current