+'_aina12_'+str(aina12_x[p])\
            +'_aina16_'+str(aina16_x[p])\
            +'_aik_'+str(aik_x[p])\
            +'_dist_'+str(d)+'_len_'+str(l)+'_v_vec.p'
         print(na_type, p, d, l)
         cell = nm.NeuronModel(hl=int(d),\
                   ail=int(l),\
                na_type=na_type,\
                aina12=aina12_x[p],\
                aina16=aina16_x[p],\
                aik=aik_x[p])
         stim = nm.attach_current_clamp(cell, amp=.7)
         vec = nm.set_recording_vectors(cell)
         nm.simulate()
         nm.save_vec(vec, save_data_path + file_name)
         nm.show_output(vec, save_figure_path + file_name)
         bpv_sum[i, j], fwv_sum[i,
                                j], ___ = nm.cal_velocity(vec, ['ais'])
         cell.dend1 = None
         cell.dend2 = None
         cell.soma = None
         cell.hill = None
         cell.ais = None
         cell.axon = None
         for sec in h.allsec():
             print(sec)
 with open(save_data_path+'type'+str(na_type)\
      +'_aina12_'+str(aina12_x[p])\
      +'_aina16_'+str(aina16_x[p])\
      +'_aik_'+str(aik_x[p])\
      +'_bpv.p', 'wb') as file:
Esempio n. 2
0
                na16_map=1,
                aina12=aina12_x[p],\
                aina16=aina16_x[p],\
                aik=aik_x[p])
         stim = nm.attach_current_clamp(cell, amp=.7)
         vec = nm.set_recording_vectors(cell)
         nm.simulate()
         nm.save_vec(vec, save_data_path\
            +'type2_map1'\
            +'_aina12_'+str(aina12_x[p])\
            +'_aina16_'+str(aina16_x[p])\
            +'_aik_'+str(aik_x[p])\
            +'_dist_'+str(d)+'_len_'+str(l)+'_')
         nm.show_output(vec, save_figure_path\
            +'type2_map1'\
            +'_aina12_'+str(aina12_x[p])\
            +'_aina16_'+str(aina16_x[p])\
            +'_aik_'+str(aik_x[p])\
            +'_dist_'+str(d)+'_len_'+str(l)+'_')
         bpv_sum[i, j], fwv_sum[i, j], ___ = nm.cal_velocity(vec, ['ais'])
         cell.dend1 = None
         cell.dend2 = None
         cell.soma = None
         cell.hill = None
         cell.ais = None
         cell.axon = None
         for sec in h.allsec():
             print(sec)
 with open(save_data_path+'type2_map1'\
      +'_aina12_'+str(aina12_x[p])\
      +'_aina16_'+str(aina16_x[p])\
      +'_aik_'+str(aik_x[p])\
                print('na12m:', na12m, '; na16m:', na16m, ';gna:', gna,
                      'pS/um2; len:', l, 'um;')
                cell = nm.NeuronModel(ail=int(l),
                                      na_type=2,
                                      na12_map=na12m,
                                      na16_map=na16m,
                                      aina12=gna,
                                      aina16=gna)
                stim = nm.attach_current_clamp(cell, amp=.7)
                vec = nm.set_recording_vectors(cell)
                nm.simulate()
                nm.save_vec(
                    vec, save_data_path + str(na12m) + str(na16m) + '_gna_' +
                    str(gna) + '_len_' + str(l) + '_')
                nm.show_output(
                    vec, save_figure_path + str(na12m) + str(na16m) + 'gna_' +
                    str(gna) + '_len_' + str(l) + '_')
                bpv_len_sum[i, j], fwv_len_sum[i, j], ___ = nm.cal_velocity(
                    vec, ['ais'])
                cell.dend1 = None
                cell.dend2 = None
                cell.soma = None
                cell.hill = None
                cell.ais = None
                cell.axon = None
                for sec in h.allsec():
                    print(sec)

            for j, d in enumerate(dist_x):
                print('na12m:', na12m, '; na16m:', na16m, ';gna:', gna,
                      'pS/um2; dist:', d, 'um;')
fwv_dist_sum = np.zeros([len(hill_gna_x), len(dist_x)])

save_data_path = 'E:/02_AIS/Simulation/AIS/190708/fit_v2/data/hna/'
save_figure_path = 'E:/02_AIS/Simulation/AIS/190708/fit_v2/figure/hna/'

for i, gna in enumerate(hill_gna_x):

    for j, l in enumerate(len_x):
        print('hna:', gna, 'pS/um2; len:', l, 'um;')
        cell = nm.NeuronModel(ail=int(l), na_type=1, hna=gna)
        stim = nm.attach_current_clamp(cell, amp=.7)
        vec = nm.set_recording_vectors(cell)
        nm.simulate()
        nm.save_vec(
            vec, save_data_path + 'hna_' + str(gna) + '_len_' + str(l) + '_')
        nm.show_output(
            vec, save_figure_path + 'hna_' + str(gna) + '_len_' + str(l) + '_')
        bpv_len_sum[i, j], fwv_len_sum[i,
                                       j], ___ = nm.cal_velocity(vec, ['ais'])
        cell.dend1 = None
        cell.dend2 = None
        cell.soma = None
        cell.hill = None
        cell.ais = None
        cell.axon = None
        for sec in h.allsec():
            print(sec)

    for j, d in enumerate(dist_x):
        print('hna:', gna, 'pS/um2; dist:', d, 'um;')
        cell = nm.NeuronModel(hl=int(d), na_type=1, hna=gna)
        stim = nm.attach_current_clamp(cell, amp=.7)
 for i, d in enumerate(dist_x):
     for j, l in enumerate(len_x):
         print(p, d, l)
         cell = nm.NeuronModel(hl=int(d), \
                   ail=int(l), \
                na_type=1, \
                aina=p,\
                aik=aik)
         stim = nm.attach_current_clamp(cell, amp=.7)
         vec = nm.set_recording_vectors(cell)
         nm.simulate()
         nm.save_vec(
             vec, save_data_path + 'aina_' + str(p) + '_aik_' + str(aik) +
             '_dist_' + str(d) + '_len_' + str(l) + '_')
         nm.show_output(
             vec, save_figure_path + 'aina_' + str(p) + '_aik_' + str(aik) +
             '_dist_' + str(d) + '_len_' + str(l) + '_')
         bpv_sum[i, j], fwv_sum[i, j], ___ = nm.cal_velocity(vec, ['ais'])
         cell.dend1 = None
         cell.dend2 = None
         cell.soma = None
         cell.hill = None
         cell.ais = None
         cell.axon = None
         for sec in h.allsec():
             print(sec)
 with open(
         save_data_path + 'aina_' + str(p) + '_aik_' + str(aik) + '_bpv.p',
         'wb') as file:
     pickle.dump(bpv_sum, file)
 with open(
Esempio n. 6
0
from neuron import h
import os
import pickle

plt.close('all')
seg = ['ais']

cell = nm.NeuronModel(dl=1000, dd=2,  sl=40, sd=20, \
       hl=10, hd=2, ail=40, aid=1.2, axl=1000, axd=1.2,\
       dna=100, sna=100, hna=300, aina=4000, axna=300, dk=20, \
       sk=20, hk=150, aik=1000, axk=150,\
       na_type=6, aina12=6000, aina16=6000)
stim = nm.attach_current_clamp(cell, amp=1.0)
vec = nm.set_recording_vectors(cell)
nm.simulate()
nm.show_output(vec, None)
bpv, fwv, __ = nm.cal_velocity(vec, seg)
print('normal:', bpv, fwv)
cell.dend1 = None
cell.soma = None
cell.hill = None
cell.ais = None
cell.axon = None
for sec in h.allsec():
    print(sec)


cell = nm.NeuronModel(dl=1000, dd=2,  sl=40, sd=20,\
       hl=10, hd=2, ail=60, aid=1.2, axl=1000, axd=1.2,\
       dna=100, sna=100, hna=300, aina=4000, axna=300, dk=20,\
       sk=20, hk=150, aik=500, axk=150,\
	print(j,l)
	cell = nm.NeuronModel(ail=int(l), \
					   na_type=na_type_i, \
					   na12_map=na12_map_i, \
					   na16_map=na16_map_i, \
					   aina12=aina12_i, \
					   aina16=aina16_i, \
					   aik=aik_i,\
					   hna=hna_i,\
					   hk=hk_i,\
					   hl = hl_i,\
					   hd = hd_i)
	stim = nm.attach_current_clamp(cell, amp=.7)
	vec = nm.set_recording_vectors(cell)
	nm.simulate()
	nm.show_output(vec, save_figure_log_path+'len_'+str(l)+'_')
	bpv_len_sum[0,j], fwv_len_sum[0,j], ___ = nm.cal_velocity(vec, ['ais'])
	cell.dend1 = None
	cell.dend2 = None
	cell.soma = None
	cell.hill = None
	cell.ais  = None
	cell.axon = None
	for sec in h.allsec():
		print(sec)
		
for j, d in enumerate(dist_x):	
	print(j,d)	
	cell = nm.NeuronModel(hl=int(d), \
					   na_type=na_type_i, \
					   na12_map=na12_map_i, \
Esempio n. 8
0
#						   na16_map=na16_map_i, \
               aina12=aina12_ii, \
               aina16=aina16_i, \
               aik=aik_i,\
               hna=hna_i,\
               hk=hk_i,\
               hl = hl_i,\
               hd = hd_i)
        stim = nm.attach_current_clamp(cell, amp=.7)
        vec = nm.set_recording_vectors(cell)
        nm.simulate()
        nm.save_vec(
            vec, save_data_path + 'aina12_' + str(aina12_ii) + '_dist_' +
            str(hl_i) + '_len_' + str(l) + '_')
        nm.show_output(
            vec, save_figure_path + 'aina12_' + str(aina12_ii) + '_dist_' +
            str(hl_i) + '_len_' + str(l) + '_')
        bpv_len_sum[i, j], fwv_len_sum[i,
                                       j], ___ = nm.cal_velocity(vec, ['ais'])
        cell.dend1 = None
        cell.dend2 = None
        cell.soma = None
        cell.hill = None
        cell.ais = None
        cell.axon = None
        for sec in h.allsec():
            print(sec)

    for j, d in enumerate(dist_x):
        print('aina12:', aina12_ii, j, d)
        cell = nm.NeuronModel(hl=int(d), \