Example #1
0
                        'membrane.T': 297.15}
conditions.append(cm_conditions)

# Inactivation kinetics (Sakakibara voltage shifted)
protocols.append(
    myokit.pacing.steptrain_linear(-30, 10, 10, -140, 1000, 100)
)
conditions.append(cm_conditions)

# Recovery kinetics (Sakakibara voltage shifted)
# Time used doesn't matter as we aren't fitting to
# recovery curve directly
twaits = [0,2,5,10,15,20,25,30,35,40,45,50,75,100,200,300,400,500,600,700,800,900,1000]
for v in vsteps_th_depol:
    protocols.append(
        recovery(twaits, v, -20, -20, 1000, 1000, 1000)
    )
    conditions.append(cm_conditions)

# Create model and simulations
m = myokit.load_model(modelfile)
ena = m.get('na_conc.E_Na').value()
v = m.get('membrane.V')
v.demote()
v.set_rhs(0)
v.set_binding('pace')

simulations, times = [], []
for p, c in zip(protocols, conditions):
    s = myokit.Simulation(m, p)
    for ci, vi in c.items():
Example #2
0
prepulses_recov_taus, recov_taus, sd_recov_taus = data.TauS_Recov_Li()
variances_recov_taus = [sd_**2 for sd_ in sd_recov_taus]
li_recov_taus_dataset = np.asarray([prepulses_recov_taus, recov_taus, variances_recov_taus])

tpre = 10000 # ms
tstep1 = 300
twaits_recov = [2**i for i in range(1,12)]
tstep2 = 300
vstep1 = 10
vstep2 = 10

tmp_protocols = []
for v in prepulses_recov_taus:
    tmp_protocols.append(
        recovery(twaits_recov, v, vstep1, vstep2, tpre, tstep1, tstep2)
    )
li_recov_protocol = tmp_protocols[0]
tsplit_recov = tmp_protocols[0].characteristic_time()
for p in tmp_protocols[1:]:
    for e in p.events():
        li_recov_protocol.add_step(e.level(), e.duration())

tsplits_recov = [t+tstep1+tstep2+tpre for t in twaits_recov]
for i in range(len(tsplits_recov)-1):
    tsplits_recov[i+1] += tsplits_recov[i]

def li_recov_sum_stats(data, fast=True, slow=True):
    def double_exp(t, tau_f, tau_s, Af, As, A0):
        return A0-Af*np.exp(-t/tau_f)-As*np.exp(-t/tau_s)
    def single_exp(t, tau_s, As, A0):
vsteps_th_depol = [v_ + 20 for v_ in vsteps_th_depol]
th_depol = [temperature_adjust(th_, 290, 310, Q10) for th_ in th_depol]
max_th_depol = np.max(np.abs(th_depol))
th_depol = [th_ / max_th_depol for th_ in th_depol]
variances_th_depol = [0.] * len(th_depol)

# Protocol creation a little more complicated as multiple recovery protocols
# need to be combined. We therefore create the protocols for each depolarisation
# potential separately then combine them with a large time gap.
twaits = [
    0, 2, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100, 200, 300, 400, 500,
    600, 700, 800, 900, 1000
]
tmp_protocols = []
for v in vsteps_th_depol:
    tmp_protocols.append(recovery(twaits, v, -20, -20, 1000, 1000, 1000))
sakakibara_tauh_depol_protocol = tmp_protocols[0]
for p in tmp_protocols[1:]:
    for e in p.events():
        sakakibara_tauh_depol_protocol.add(e)

twaits_split = [t + 3000 for t in twaits]
for i in range(len(twaits_split) - 1):
    twaits_split[i + 1] += twaits_split[i]


def sakakibara_tauh_depol_sum_stats(data):
    output = []

    def simple_exp(t, tauh):
        return np.exp(-t / tauh)
Example #4
0
                       description=rao_inact_desc,
                       Q10=None,
                       Q10_factor=0)

#
# Recovery [Rao2009]
#
rao_rec_desc = """Recovery curve for iCaL in HL-1 cells from Rao 2009.
Measurements taken at room temperature.
"""

times_rec, rec, sd_rec = data.Rec_Rao()
variances_rec = [sd**2 for sd in sd_rec]
rao_rec_dataset = np.asarray([times_rec, rec, variances_rec])

rao_rec_protocol = recovery(times_rec, -80, -20, -20, 10000, 400, 400)

split_times = [10800 + tw for tw in times_rec]
for i, time in enumerate(split_times[:-1]):
    split_times[i + 1] += split_times[i]


def rao_rec_sum_stats(data):
    pulse_traces = []
    for i, time in enumerate(split_times):
        d_, data = data.split(time)
        pulse_traces.append(
            d_.trim(d_['engine.time'][0] + 10000,
                    d_['engine.time'][0] + 10800 + times_rec[i],
                    adjust=True))
    output = []
variances_rec_taus = [sd_**2 for sd_ in sd_rec_taus]
sakakibara_rec_taus_dataset = np.array(
    [prepulse_rec, rec_taus, variances_rec_taus])

tpre = 10000 # ms
tstep1 = 1000
twaits_rec = [2**i for i in range(1,11)]
tstep2 = 1000
vstep1 = -20
vstep2 = -20
vhold = -140

tmp_protocols = []
for v in prepulse_rec:
    tmp_protocols.append(
        recovery(twaits_rec,vhold,vstep1,vstep2,tpre,tstep1,tstep2,v)
    )
sakakibara_rec_protocol = tmp_protocols[0]
tsplit_rec = tmp_protocols[0].characteristic_time()
for p in tmp_protocols[1:]:
    for e in p.events():
        sakakibara_rec_protocol.add_step(e.level(), e.duration())

tsplits_rec = [t+tstep1+tstep2+tpre for t in twaits_rec]
for i in range(len(tsplits_rec)-1):
    tsplits_rec[i+1] += tsplits_rec[i]

def sakakibara_rec_sum_stats(data, fast=True, slow=True):
    def double_exp(t, tau_r1, tau_r2, A0, A1, A2):
        return A0-A1*np.exp(-t/tau_r1)-A2*np.exp(-t/tau_r2)
    output1 = []
prepulse_recov_r2, tau_r2, sd_r2 = dataSch.Recovery_Schneider_tau_r2()
variances_r2 = [sd_**2 for sd_ in sd_r2]
schneider_taur2_dataset = np.array([prepulse_recov_r2, tau_r2, variances_r2])

tpre = 10000  #ms
tstep1 = 200
twaits_recov = [2**i for i in range(1, 11)]
tstep2 = 12
vstep1 = -20
vstep2 = -20
vhold = -135

tmp_protocols = []
for v in prepulse_recov_r2:
    tmp_protocols.append(
        recovery(twaits_recov, vhold, vstep1, vstep2, tpre, tstep1, tstep2, v))
schneider_recov_protocol = tmp_protocols[0]
tsplit_recov = tmp_protocols[0].characteristic_time()
for p in tmp_protocols[1:]:
    for e in p.events():
        schneider_recov_protocol.add_step(e.level(), e.duration())

tsplits_recov = [t + tstep1 + tstep2 + tpre for t in twaits_recov]
for i in range(len(tsplits_recov) - 1):
    tsplits_recov[i + 1] += tsplits_recov[i]


def schneider_recov_sum_stats(data):
    def double_exp(t, tau_r1, tau_r2, A0, A1, A2):
        return A0 - A1 * np.exp(-t / tau_r1) - A2 * np.exp(-t / tau_r2)
Example #7
0
    We assume the SD is 10% of the given time constants as
    no error is reported.

    Two idential depolarizing voltage-clamp pulses from the holding
    potential were applied to a potential (+20 mV) that activated
    a large outward current, and the interval between the two
    pulses was varied.
    """
prepulses, tau_r, _ = data.Rec_Nygren()
sd_taur = 0.1 * np.asarray(tau_r)
variances_taur = [sd_**2 for sd_ in sd_taur]
nygren_rec_dataset = np.asarray([prepulses, tau_r, variances_taur])

twaits = [2**i for i in range(1, 8)]
nygren_rec_protocol = recovery(twaits, prepulses[0], 20, 20, 20000, 100, 100)

tsplits_rec = [t + 100 + 100 + 20000 for t in twaits]
for i in range(len(tsplits_rec) - 1):
    tsplits_rec[i + 1] += tsplits_rec[i]


def nygren_rec_sum_stats(data):
    def single_exp(t, tau, A, A0):
        return A0 - A * np.exp(-t / tau)

    output = []
    timename = 'engine.time'
    recov = []
    for t in tsplits_rec:
        d_, data = data.split(t)
Example #8
0
                                   description=nakajima_desc,
                                   Q10=None,
                                   Q10_factor=0)

#
# Recovery [Zhang2013]
#
zhang_rec_desc = """Recovery curve for iNa in Zhang 2013.
Experiments conducted at room temperature.
"""

tsteps_rec, rec, sd_rec = data.Recovery_Zhang()
variances_rec = [sd_**2 for sd_ in sd_rec]
zhang_rec_dataset = np.asarray([tsteps_rec, rec, variances_rec])

zhang_rec_protocol = recovery(tsteps_rec, -120, -30, -30, 3000, 20, 20)
zhang_conditions = {
    'extra.Na_o': 136e3,
    'sodium.Na_i': 10e3,
    'extra.K_o': 0.,  # Cs used to avoid contamination
    'potassium.K_i': 0.,
    'phys.T': room_temp
}

split_times = [3040 + tw for tw in tsteps_rec]
for i, time in enumerate(split_times[:-1]):
    split_times[i + 1] += split_times[i]


def zhang_rec_sum_stats(data):
    dsplit = []
Example #9
0
                          description=nguyen_inact_desc,
                          Q10=None,
                          Q10_factor=0)

#
# Recovery kinetics [Deng2009]
#
deng_rec_desc = """Recovery curve in HL-1 from Deng 2009 Fig 4B.
Measurements taken at room temperature so no temp adjustment.
"""

tsteps_rec, rec, sd_rec = data.Rec_Deng()
variances_rec = [sd**2 for sd in sd_rec]
deng_rec_dataset = np.asarray([tsteps_rec, rec, variances_rec])

deng_rec_protocol = recovery(tsteps_rec, -80, -20, -20, 5000, 300, 300)
deng_conditions = {
    'extra.Ca_o': 5000,
    'calcium.Ca_i': 0.2,  # estimated LR1994
    'phys.T': room_temp
}

split_times = [5600 + tw for tw in tsteps_rec]
for i, time in enumerate(split_times[:-1]):
    split_times[i + 1] += split_times[i]


def deng_rec_sum_stats(data):
    pulse_traces = []
    for i, time in enumerate(split_times):
        d_, data = data.split(time)
prepulse_rec_cou_adjust = [v + cou_adjust for v in prepulse_rec]
sakakibara_rec_taus_cou_adjust_dataset = np.array(
    [prepulse_rec_cou_adjust, rec_taus, variances_rec_taus])

tpre = 10000  # ms
tstep1 = 1000
twaits_rec = [2**i for i in range(1, 11)]
tstep2 = 1000
vstep1 = -20
vstep2 = -20
vhold = -140

tmp_protocols = []
for v in prepulse_rec:
    tmp_protocols.append(
        recovery(twaits_rec, vhold, vstep1, vstep2, tpre, tstep1, tstep2, v))
sakakibara_rec_protocol = tmp_protocols[0]
tsplit_rec = tmp_protocols[0].characteristic_time()
for p in tmp_protocols[1:]:
    for e in p.events():
        sakakibara_rec_protocol.add_step(e.level(), e.duration())

tmp_protocols = []
for v in prepulse_rec_nyg_adjust:
    tmp_protocols.append(
        recovery(twaits_rec, vhold + nyg_adjust_inact,
                 vstep1 + nyg_adjust_inact, vstep2 + nyg_adjust_inact, tpre,
                 tstep1, tstep2, v))
sakakibara_rec_nyg_adjust_protocol = tmp_protocols[0]
tsplit_rec = tmp_protocols[0].characteristic_time()
for p in tmp_protocols[1:]:
Example #11
0
    no error is reported.

    The reactivation process was assessed by a paired-pulse
    protocol consisting of two identical pulses to +50 mV from
    a holding potential of -60 to +40 mV for 200 ms, at a
    variety of P1-P2 intervals.
    """
prepulses, tau_r, _ = data.Rec_Courtemanche()
sd_taur = 0.1 * np.asarray(tau_r)
variances_taur = [sd_**2 for sd_ in sd_taur]
courtemanche_rec_dataset = np.asarray([prepulses, tau_r, variances_taur])

twaits = [2**i for i in range(1, 8)]
tmp_protocols = []
for v in prepulses:
    tmp_protocols.append(recovery(twaits, v, 50, 50, 20000, 200, 200))
courtemanche_rec_protocol = tmp_protocols[0]
tsplit_rec = tmp_protocols[0].characteristic_time()
for p in tmp_protocols[1:]:
    for e in p.events():
        courtemanche_rec_protocol.add_step(e.level(), e.duration())

tsplits_rec = [t + 200 + 200 + 20000 for t in twaits]
for i in range(len(tsplits_rec) - 1):
    tsplits_rec[i + 1] += tsplits_rec[i]


def courtemanche_rec_sum_stats(data):
    def single_exp(t, tau, A, A0):
        return A0 - A * np.exp(-t / tau)